Skip to content

[scheduler] Honor viewConfig hour limits in the compact day and week views - #23316

Merged
rita-codes merged 1 commit into
mui:masterfrom
rita-codes:scheduler-compact-views-view-config
Aug 10, 2026
Merged

rita-codes merged 1 commit into
mui:masterfrom
rita-codes:scheduler-compact-views-view-config

Conversation

@rita-codes

@rita-codes rita-codes commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

CompactDayView and CompactWeekView never read the store's time-grid config, so viewConfig.day / viewConfig.week silently did nothing on the touch views while DayView and WeekView honored them. The props already existed and were forwarded all the way down (CompactDayTimeGrid spreads DayTimeGridProps into DayTimeGrid) — the views just never filled them in.

Changes

  • CompactDayView / CompactWeekView read eventCalendarViewSelectors.timeGridConfig and forward startTime / endTime, mirroring DayView / WeekView exactly.
  • The four standalone prop types (community + premium) re-add the narrowed viewConfig they were omitting, matching StandaloneDayViewProps / StandaloneWeekViewProps.
  • Tests extend the existing renderWithProviders helper in each file with a provider-props argument instead of duplicating the JSX.

Out of scope

CompactThreeDayView is left as is: EventCalendarViewConfig has no threeDay key and the view has no non-compact counterpart, so which key it should read is an open API question rather than a bug fix.

…views

CompactDayView and CompactWeekView never read the store's time-grid config, so
viewConfig.day / viewConfig.week silently did nothing on the touch views while
DayView and WeekView honored them. Read the same selector and forward the range,
and re-add the narrowed viewConfig prop the standalone types were omitting.

CompactThreeDayView is left out: EventCalendarViewConfig has no threeDay key and
the view has no non-compact counterpart, so which key it should read is an open
API question.
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23316--material-ui-x.netlify.app/
QR code for https://deploy-preview-23316--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 🔺+157B(+0.04%) 🔺+10B(+0.01%)
@mui/x-scheduler-premium 🔺+157B(+0.03%) 🔺+51B(+0.04%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@rita-codes rita-codes self-assigned this Aug 7, 2026
@rita-codes rita-codes added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: scheduler Changes related to the scheduler. labels Aug 7, 2026

@flaviendelangle flaviendelangle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR review

No findings. This PR extends the existing viewConfig hour-limit support (already shipped for DayView/WeekView) to the compact day and week views, and it does so by mirroring the sibling views exactly — same timeGridConfig selector, same prop ordering, same Omit + narrowed re-declaration type shape (Pick<EventCalendarViewConfig, 'day' | 'week'>). Nothing is merge-blocking.

What I verified:

  • Selector and null path: eventCalendarViewSelectors.timeGridConfig returns state.viewConfig?.[view] ?? null; the config?.startTime optional chaining handles the unset case, confirmed by the passing "24 rows by default" tests.
  • Prop spread reorder (days={days} now before {...props}): CompactDayViewProps extends only React.HTMLAttributes, so no typed prop can collide with days/startTime/endTime; the ordering is identical to DayView.tsx/WeekView.tsx.
  • Standalone flow: viewConfig was already extracted into store parameters by useExtractEventCalendarParameters (used by both community and premium standalone wrappers), so the newly typed prop reaches the store in all four standalone components.
  • Runtime: all 348 x-scheduler unit tests pass in a worktree at the PR head, and pnpm --filter "@mui/x-scheduler*" run typescript passes for both touched packages.
  • Docs/generated files: compact views have no public docs page yet (only the experiments playground), and scheduler is outside proptypes/API-docs generation, so no stale or missing generated artifacts.

Residual gap, not actionable: the new tests exercise viewConfig through EventCalendarProvider rather than through the public StandaloneCompactDayView/StandaloneCompactWeekView prop, but that matches the coverage level of the sibling standalone views and the extraction hook is shared, pre-existing code.

Verdict

Approve - faithful replication of the proven DayView/WeekView pattern with passing tests and typecheck, and no behavioral deviations found.


🤖 Review generated with Claude Code

@rita-codes
rita-codes merged commit 18b8892 into mui:master Aug 10, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: scheduler Changes related to the scheduler. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants