feat: RFC calendar rewrite (CalendarPreview) - #890
Conversation
Proposes replacing Calendar, DatePicker, and RangePicker with a single subcomposed root that owns date and popover state explicitly and exposes every surface as a dot-notation part. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 54 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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. Comment |
commit: |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rohanchkrabrty
left a comment
There was a problem hiding this comment.
@Shreyag02 can you make the RFC a bit more concise? Currently it feels bloated and hard to understand.
Proposes replacing Calendar, DatePicker, and RangePicker with a single subcomposed root that owns date and popover state explicitly and exposes every surface as a dot-notation part.
Description
Adds
docs/rfcs/005-calendar-preview.md. Docs only — no component code in this PR.The calendar family is the only part of Apsara that never adopted the composition contract. The RFC argues every recurring bug is downstream of that, and proposes
CalendarPreview: one export, dot-notation parts,value/onValueChange+open/onOpenChange, react-day-picker isolated behind one file.open/onOpenChangeon the root;use-picker-popover.tsdeletedcaptionLayout='dropdown'reverted — month/year nav can't be the default inside a picker.Navis ours, a sibling of the grid; RDP never mounts aSelect, so nav is default-onslotPropsbags,children-as-function,onErrorChange— idioms found nowhere else in the libraryrender+Fieldcomposition; zeroslotPropsmode/selected/requiredto be overridden after the consumer spread.Gridonly;...propsspread-last becomes satisfiabledayjs.extend()in four modules, import-order dependent — the cause of a past P0date-adapter.ts; failure class becomes impossiblelock="from"/lock="to"Findings turned up while writing it, each cited to file and line in the RFC:
date-picker.tsxdefaultMonth; its three siblings were hardened, this one missedrange-picker.tsxRangePickerPropsnot exported and in no barrel — consumers can't type a wrapper, yet the docs render its type tableprops.tsslotProps.calendaras the fullCalendarProps, including four props the real type excludesCHANGELOG.mdDataViewfilterProps.calendarslot that was never builtfilter-chip.tsxslotProps.inputmerge silently drops a consumer's container class; CSS reaches intoInput's hashed classespackage.jsonmode/requiredunion is unchanged, so upgrading ≠ fixing thisinternals/temporal*adapters exist —date-adapter.tsis shaped to that surfaceBreaking, no shim: the new component ships alongside, the old family is removed one release later. The migration map is mechanical and codemod-able. Seven open items for review — the
quarter/half-yearvalue shape needs a decision before implementation, since it shapes the type union.Type of Change
Docs-only PR; the change it proposes is breaking, noted so the label isn't a surprise later.
How Has This Been Tested?
No code, so nothing to run. The RFC's claims were verified instead:
pnpm-lock.yamlUIvalues,classNameskeys,componentsoverrides, removed propsNote: the citations predate the latest styling commit on
main, so somecalendar.module.cssline numbers may have drifted. Worth a re-check before merge.Checklist:
.mdxlands with the implementationScreenshots (if appropriate):
N/A — no visual change.
Related Issues
FilterChiprewrite,DataViewfilterProps.calendarslot,filter-operations→date-adapter.ts@base-ui/react→~1.7.0,react-day-picker→~10.0.1