Repository navigation
feat(site/src/components/DateRangePicker): add maxDays and minDate props - #29625
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc33009f62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Do we need it to be possible for this component to be marked as disabled? |
… limit of their own start Check each calendar candidate in handleCalendarSelect against the DST-aware limit computed from the candidate's own start instead of passing react-day-picker's max, which was derived from the previous start and treats a max of zero (maxDays 1) as unlimited. A backward extension from a range starting after a fall transition can no longer commit a window longer than maxDays * 24 hours, and maxDays 1 keeps a single day selected. Hide presets and calendar days before the first whole day on or after minDate, so a cutoff inside a day never produces a committed midnight start earlier than the cutoff. Close the popover when the picker becomes disabled so it does not reopen on its own once enabled again, and add a Disabled story.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc512005e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…xDays Presets committed immediately without the maxDays check applied to calendar selections, so a picker with maxDays 7 still offered and committed the 14 and 30 day presets. Filter presets with the same DST-aware limit the calendar uses, computed from each preset's own start, so the list only offers ranges the picker would accept.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d1078b6ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Update: the disabled prop has been removed; see the implemented follow-up. Edit: this analysis was wrong; see the correction below.
@DanielleMaywood No. It has a single consumer, I will drop the prop, together with the reopen guard, story, and test that exist only for it, from the component here and from
|
|
Update: the disabled prop has been removed; see the implemented follow-up. Correction to my previous comment: it is needed, and I had the analysis wrong.
I am keeping the prop. If you would rather not have a disabled state at all, the alternative is remembering the last known
|
Its only caller now renders a skeleton instead of a disabled picker, so the prop, its close-on-disable handling, and the disabled story and test have no consumer left.
|
Removed the This supersedes my earlier decision to keep the prop. The picker and spend-page regression tests pass.
|
Adds
maxDaysandminDatetoDateRangePicker, and labels the trigger with the committed inclusive days rather than the exclusive API boundary.Why
The spend page higher in this stack must cap a custom range at the endpoint's 31-day limit and hide days and presets that start before the retention cutoff the report echoes. The page shows a skeleton until the first retention bound arrives, then keeps the picker mounted during report reloads. The picker does not need a disabled prop.
toBoundarystays private here; the reporting-period PR exports it when the page first needs it.What to scrutinize
selectableDaysFrom: when the maximal range ofmaxDayslocal days crosses a fall daylight-saving shift, the committed interval runs long by the shift, so the calendar allows one day less from that start instead of trimming the committed range.excludeDisabledrestarts a calendar selection if its previously committed start has fallen behindminDate.fromBoundary(value), so a midnight exclusive end displays the previous day.TemplateInsightsPageis the other caller and is affected by that label change.Validation
pnpm test src/components/DateRangePicker/DateRangePicker.test.tsx(new: maxDays restart, DST shave, minDate),pnpm test:storybookonDateRangePicker.stories.tsx(newClosedExclusiveEndandRetentionLimited), repository pre-commit (biome, tsc, knip).Delivery record
Published head
d1fc9334360passed per-layer integration checks and commit hooks. The composed headd899228f798passed format, check, full frontend lint, 125 unit tests, and 86 story tests. Pre-push hooks were skipped as requested. See #28964 for audit findings, their disposition, and historical UAT limits. No exact-head live UAT or new independent re-review is claimed.Stack context
PR 1 of 9. The stack adds a User spend page under Admin settings > AI > User spend: total and per-user AI Gateway spend for one organization over a reporting period, read from
GET /api/v2/organizations/{organization}/ai/spend/users(#29129, merged). It is #28964 split into one-concern PRs. Historical UAT covers earlier heads only; live UAT has not been rerun after these review fixes. Bottom to top: DateRangePicker limits, shared dimension badge, API client method, spend table, page view, page container, reporting period, dimension filters, route and navigation (#28964).