Skip to content

[scheduler] Add content slots for the Event Timeline event block and resource title cell - #23557

Open
rita-codes wants to merge 14 commits into
mui:masterfrom
rita-codes:23552-scheduler-timeline-content-slots
Open

rita-codes wants to merge 14 commits into
mui:masterfrom
rita-codes:23552-scheduler-timeline-content-slots

Conversation

@rita-codes

@rita-codes rita-codes commented Sep 9, 2026

Copy link
Copy Markdown
Member

Closes #23552. Split out of #23468, which keeps the discussion about the Base UI render prop on the event root.

The slots

Two new slots on EventTimelinePremium, following the eventDialogGeneralTab pattern from #23338:

  • timelineEventContent replaces the text inside an event block. Props: occurrence, resource (the row's resource) and variant ("placeholder" while the block previews a drag, a resize or a creation). The block keeps its geometry, handles and button semantics, and the slot renders in both the regular and the placeholder branch.
  • timelineResourceTitle replaces the text inside a resource title cell. Props: resource. The legend color and the collapse toggle stay.

resource is the processed resource, typed Omit<SchedulerResource, 'children'>, because the store strips children from its lookup.

Types

  • EventTimelinePremiumSlots / EventTimelinePremiumSlotProps extend the shared SchedulerSlots / SchedulerSlotProps, and only EventTimelinePremiumProps uses them. They live in @mui/x-scheduler-premium/models, like GridPremiumSlotsComponent in the Data Grid.
  • TimelineEventContentPropsOverrides and TimelineResourceTitlePropsOverrides are augmented from @mui/x-scheduler-premium/models to type slotProps. TimelineEventContentProps and TimelineResourceTitleProps are exported to type custom slot components.
  • The slots context keeps the shared SchedulerSlots type and each surface reads it with a generic useSchedulerSlots<TSlots, TSlotProps>(), like useChartsSlots. Adding the Event Calendar slots later does not touch the provider.
  • The docs generator resolves EventTimelinePremiumSlots for the timeline and SchedulerSlots for the other components, so each API page lists only its own slots.

Interactive content in the slots

Links, buttons and inputs rendered by a slot keep their own clicks and keys:

  • The row keyboard navigation ignores keys coming from nested content, so the arrows move the caret in an input instead of the focus to another cell.
  • The collapse toggle of the title cell and the click-to-edit trigger of the event ignore clicks on nested interactive elements.
  • Tab reaches the focusable content of an event before moving to the next event, and Shift+Tab mirrors it.

The guard is isEventFromNestedInteractiveElement in @mui/x-internals/domUtils, next to getTarget. Pickers and Chat have their own copies and can migrate to it later.

Docs

A section with a demo on the events page and on the resources page. Both mention that the slot content is part of the accessible name of the events (the title demo uses describeChild on its tooltip for that reason), and the events page mentions that the slot also renders in the placeholder.

Notes for reviewers

  • The slot names are prefixed with the surface on purpose: the calendar views render occurrence.title in three different layouts, so a shared eventContent slot would not fit them. Calendar slots can be added next to these later without a rename.
  • No default content component is exported: the slot replaces the text and nothing else consumes such a component yet.
  • The drag preview shown when dragging an event outside the scheduler still renders the plain title. EventDragPreview is shared with the calendar views, so it is left for a follow-up.
  • simulateDragAndDrop gains a hold option that stops after the dragover, so a test can assert on the placeholder. The test awaits one animation frame, which is when pragmatic-drag-and-drop delivers onDrag, and ends the drag in a finally.

…resource title cell

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBYMarDHeuysLnbKifmMaP
@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 Sep 9, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy preview

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 🔺+259B(+0.07%) 🔺+114B(+0.11%)
@mui/x-scheduler-premium 🔺+994B(+0.18%) 🔺+313B(+0.20%)
@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 Sep 9, 2026
rita-codes and others added 12 commits September 9, 2026 11:04
… slots

Keys and clicks on links, buttons and inputs rendered by the
`timelineEventContent` and `timelineResourceTitle` slots are left to
that content: the row keyboard navigation, the collapse toggle and the
click-to-edit trigger ignore them, and Tab reaches the focusable
content of an event before moving to the next one.

The event slot receives the row `resource` and the block `variant`
instead of `resourceId`, both slots get the processed resource type,
and the demos, docs and tests follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
The context is typed with the shared `SchedulerSlots` and each surface
reads it through a generic `useSchedulerSlots`, like `useChartsSlots`,
so adding the calendar slots does not touch the provider.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
…-slots' into 23552-scheduler-timeline-content-slots
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
`EventTimelineSlots`, `EventTimelineSlotProps` and the slot props
interfaces are exported from `@mui/x-scheduler-premium/models`, next
to the component they describe. The community package keeps the shared
`SchedulerSlots`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
…m suffix

`EventTimelinePremiumSlots`, `EventTimelinePremiumSlotProps` and
`EventTimelinePremiumSlotsAndSlotProps`, following the other types of
the premium package.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
`isEventFromNestedInteractiveElement` and `getTabbableDescendants` live
in `@mui/x-internals/domUtils`, and the first one resolves the target
through `getTarget` so it works inside a shadow root.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb1k7h8uiiEjJnsob4GQW3
@rita-codes
rita-codes marked this pull request as ready for review September 11, 2026 15:51
@rita-codes
rita-codes requested a review from romgrk as a code owner September 11, 2026 15:51
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.

[scheduler] Add content slots for the Event Timeline event block and resource title cell

1 participant