Skip to content

Conversation

@MartinSchoeler
Copy link
Member

@MartinSchoeler MartinSchoeler commented Dec 9, 2025

Proposed changes (including videos or screenshots)

The default value for the rangepicker component was hardcoded to be "all dates", fixed by allowing a custom default value (if no value is provided, default to all dates)

Issue(s)

ABAC-90

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Improvements
    • Admin logs page now defaults to showing today's date range for immediate relevance.
    • Date range selector can now initialize to a chosen preset (e.g., today, yesterday, this week), allowing configurable default behavior on load.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 9, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

⚠️ No Changeset found

Latest commit: 608cff0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

The DateRangePicker component gains a configurable defaultSelectedKey prop to control which preset is selected on mount. LogsPage now passes defaultSelectedKey='today' so the logs panel initializes with today's date range instead of the epoch.

Changes

Cohort / File(s) Summary
DateRangePicker enhancement
apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx
Added optional defaultSelectedKey to DateRangePickerProps (union of preset keys). Component signature now accepts defaultSelectedKey with default 'alldates'. Replaced previous on-mount epoch initialization with a useEffect that calls handleOptionClick(defaultSelectedKey). Updated Select defaultSelectedKey usage to use the prop.
LogsPage integration
apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx
Passed defaultSelectedKey='today' into DateRangePicker to set today's range as the initial selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus review on:
    • DateRangePicker.tsx — correctness of new prop typing, default value, and the on-mount effect invoking handleOptionClick.
    • LogsPage.tsx — ensure prop is passed correctly and no unexpected side effects.

Poem

🐇 I nudged the picker, soft and spry,
"Choose today," I whispered with a sigh.
No more old epochs in our sight,
Logs wake up to morning light. ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly identifies the bug (wrong default date range) and the component affected (ABAC Logs page), accurately reflecting the main change.
Linked Issues check ✅ Passed The PR implementation addresses ABAC-90 by modifying DateRangePicker to accept a defaultSelectedKey prop and initializing LogsPage with 'today', fixing the incorrect default date display.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the default date range issue: DateRangePicker refactoring and LogsPage initialization are both necessary and in-scope for ABAC-90.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/abac/default-date

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e36b13e and 608cff0.

📒 Files selected for processing (2)
  • apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx (1 hunks)
  • apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx
  • apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MartinSchoeler MartinSchoeler changed the base branch from develop to feat/abac December 9, 2025 17:05
@MartinSchoeler MartinSchoeler changed the title Fix/abac/default date regression(ABAC): Wrong default date range in ABAC Logs page Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 360MiB 349MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +12KiB
queue-worker-service 132MiB 132MiB +11KiB
ddp-streamer-service 126MiB 126MiB +8.7KiB
account-service 113MiB 113MiB +9.6KiB
authorization-service 111MiB 111MiB +70KiB
stream-hub-service 111MiB 111MiB +9.5KiB
presence-service 111MiB 111MiB +8.7KiB

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 16:35", "12/10 17:23 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 17 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37749
  • Baseline: develop
  • Timestamp: 2025-12-10 17:23:52 UTC
  • Historical data points: 17

Updated: Wed, 10 Dec 2025 17:23:52 GMT

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.56%. Comparing base (b3fd9fb) to head (608cff0).
⚠️ Report is 3 commits behind head on feat/abac.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           feat/abac   #37749      +/-   ##
=============================================
+ Coverage      54.50%   54.56%   +0.06%     
=============================================
  Files           2633     2633              
  Lines          50105    50105              
  Branches       11224    11224              
=============================================
+ Hits           27308    27339      +31     
+ Misses         20607    20590      -17     
+ Partials        2190     2176      -14     
Flag Coverage Δ
e2e 57.33% <ø> (+0.07%) ⬆️
e2e-api 44.70% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MartinSchoeler MartinSchoeler marked this pull request as ready for review December 10, 2025 13:07
@MartinSchoeler MartinSchoeler requested a review from a team as a code owner December 10, 2025 13:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx (1)

8-11: Configurable defaultSelectedKey and mount initialization look correct

The new defaultSelectedKey prop, its default to 'alldates', the mount-time handleOptionClick(defaultSelectedKey) call, and wiring through to the Select together give a clean, backwards-compatible way to choose the initial range while preserving existing “all dates” behavior for callers that don’t pass it.

If you ever need the picker to react to a changing defaultSelectedKey prop (beyond just initial mount), you could add defaultSelectedKey (and handleOptionClick) to the useEffect dependency array, but as-is the “initialize once” behavior matches the “default*” naming.

Also applies to: 27-27, 73-75, 79-79

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between aeafe26 and e36b13e.

📒 Files selected for processing (2)
  • apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx (1 hunks)
  • apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx
  • apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx (1)

122-128: Using defaultSelectedKey='today' here correctly fixes ABAC-90

Passing defaultSelectedKey='today' aligns the DateRangePicker’s initial selection with the locally initialized startDate/endDate, so the logs panel now opens with a “today” range instead of “all dates” (epoch). This is scoped to this page and preserves the default 'alldates' behavior elsewhere.

@tassoevan tassoevan merged commit 71f3bdd into feat/abac Dec 10, 2025
51 checks passed
@tassoevan tassoevan deleted the fix/abac/default-date branch December 10, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants