feat: make time-grid event height floor and gap configurable - #56
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
🟡 Changes recommended
The implementation does not match the PR description regarding minEventHeight affecting the drag-to-create ghost height (native + dom), so either behavior or description/tests should be aligned.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR makes timed event box sizing configurable across both renderers by introducing minEventHeight (height floor, also the boxHeight floor passed to custom renderers) and eventGap (per-side inset), replacing previously hard-coded constants and documenting the new behavior.
Changes:
- Add
minEventHeightandeventGapprops to native + domCalendarandTimeGrid, with renderer-appropriate defaults. - Thread the new sizing params through native previews/ghosts and dom layout/preview styles, replacing hard-coded floors/insets.
- Add unit tests and docs updates describing the new props and their impact on
boxHeight.
File summaries
| File | Description |
|---|---|
| packages/native/src/components/TimeGrid.tsx | Replaces hard-coded sizing constants with configurable props and threads eventGap/minEventHeight through TimeGrid internals. |
| packages/native/src/components/MultiDayMovePreview.tsx | Uses passed minEventHeight/eventGap for multi-day move preview sizing/inset. |
| packages/native/src/components/Calendar.tsx | Exposes new props on Calendar and forwards them into the native TimeGrid. |
| packages/native/src/components/tests/TimeGrid.test.tsx | Adds native tests for default sizing, overrides, and Calendar forwarding. |
| packages/dom/src/TimeGrid.tsx | Adds new props with defaults and applies them to event box geometry + previews. |
| packages/dom/src/Calendar.tsx | Exposes new props on dom Calendar and forwards them into dom TimeGrid. |
| packages/dom/src/tests/TimeGrid.test.tsx | Adds dom tests for default sizing, overrides, and inset behavior. |
| packages/dom/src/tests/Calendar.test.tsx | Adds dom Calendar forwarding test for the new sizing props. |
| docs/reference/api.mdx | Documents the new props in the native API reference. |
| docs/guides/time-grid.mdx | Adds an “Event boxes” section documenting minEventHeight and eventGap. |
| docs/guides/events.mdx | Notes that boxHeight is floored by minEventHeight and references eventGap. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a14b0f0 to
1a7bad8
Compare
Closes #54
Closes #55
What
Two new
Calendar/TimeGridprops on both renderers replace the hard-codedMIN_EVENT_HEIGHTandEVENT_GAPconstants in the native time grid:minEventHeightsets the floor on a timed event box's pixel height. It is also the floor of theboxHeighthanded torenderEvent, which is what Override hard-coded MIN_EVENT_HEIGHT #55 needs for custom appointment renderers. Pass0to size every box strictly by its duration.eventGapsets the inset between an event box and its slot on each side. Pass0to let events fill the full slot, which is what Override hard-coded EVENT_GAP #54 asks for.Defaults keep today's look on each renderer: native
32/2, dom14/1. With both props set explicitly the two renderers produce identical geometry.Where it applies
minEventHeightfloors every rendered event box: resting boxes, the live drag/resize height, the midnight spill preview, the multi-day move preview (native), and the cross-page drag ghost (native). Every place the old hard-coded floor lived.eventGapinsets those same boxes and, since it shares the old constant, also the drag-to-create ghost on both renderers.minEventHeight.Validation
Calendarpass-through.pnpm lint,pnpm format,pnpm typecheck(root and both examples),pnpm test, andpnpm buildall pass; the renderer parity and docs-sync guards stay green.boxHeightargminEventHeight={0} eventGap={0}minEventHeight={40} eventGap={6}minEventHeight={0} eventGap={0}minEventHeight={40} eventGap={6}Docs
docs/guides/time-grid.mdxgains an "Event boxes" section,docs/reference/api.mdxlists both props, anddocs/guides/events.mdxnotes thatboxHeightis floored byminEventHeight.