refactor(emcn): consolidate date pickers onto the chip Calendar (range support + retire legacy DatePicker)#5222
Conversation
… modal The document tags modal used the legacy DatePicker primitive for date-typed tag values while the rest of the knowledge base date inputs use the canonical ChipDatePicker. Swap both usages (edit + create) to ChipDatePicker (same YYYY-MM-DD value contract, full-width to match sibling fields) so the chrome matches the chip design system, and align a tag-row value label to the caption text size used by its sibling.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Consumers switch as follows: modals and forms use Also removes the unused Reviewed by Cursor Bugbot for commit 58512c0. Configure here. |
Greptile SummaryThis PR consolidates date selection onto the chip Calendar components. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (6): Last reviewed commit: "fix(logs): keep the date-range popover a..." | Re-trigger Greptile |
ChipDatePicker was single-date only, so date-range surfaces had to fall back to the legacy DatePicker primitive. Add range support as a discriminated mode on the existing canonical Calendar (not a parallel component): a start/end selection staged behind Clear/Cancel/Apply with optional time-of-day inputs, built from the chip family (CalendarDayCell, chipVariants, ChipTimePicker) and fully tokenized. ChipDatePicker gains a matching mode='range' that renders it behind the same chip trigger. Extract the range-bounds serialization into a pure, unit-tested helper, and remove the dead logs-toolbar directory (LogsToolbar/AutocompleteSearch had no consumers; the logs page renders its toolbar inline).
|
@greptile |
|
@cursor review |
…e chip calendar Removes the parallel DatePicker component (its own dual-month CalendarMonth, hardcoded colors, non-chip chrome) so the chip Calendar is the single date surface. Migrates every consumer: - tables row modal -> ChipDatePicker (single) - tables inline grid editor, logs filter, ee audit-logs filter -> canonical Calendar inside an emcn Popover (the same headless/anchored pattern DatePicker rendered internally; single for the grid cell, range+time for the log filters) - playground -> ChipDatePicker showcase (single, range, range+time) The range bounds keep the exact YYYY-MM-DD / YYYY-MM-DDTHH:mm wire format, so the log filters' parsing is unchanged. Calendar is imported via its component path (the emcn barrel already exports a Calendar icon).
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 967104d. Configure here.
Cursor Bugbot: RangeCalendarView seeded its staged selection from props only once. Closing the popover unmounts it (so a fresh open re-seeds), but if the bound startDate/endDate change while it stays mounted the grid could linger on a stale draft. Add a render-phase reset keyed on the bound props.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ed21a26. Configure here.
…resync Replaces the imperative render-phase state reset with React's idiomatic key-based reset: the range view is keyed on its committed bounds in the Calendar dispatcher, so a newly applied range remounts it with fresh draft state. Cleaner and fully encapsulated — consumers need no special handling. Move the rationale into TSDoc (no inline comment).
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 520aa22. Configure here.
…range select The custom-range Calendar is anchored with an always-rendered PopoverAnchor overlaying the time-range combobox (absolute inset-0). Without pointer-events-none it would intercept clicks meant for the select, leaving it unclickable. The anchor is only a positioning reference, so disable its pointer events on both the logs and audit-logs filters.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 58512c0. Configure here.

Summary
Consolidates all date selection onto the canonical chip
Calendar, retiring the parallel legacyDatePicker.Calendargains amode='range'variant (not a new component): start/end staged behind Clear/Cancel/Apply with optional time-of-day inputs, built from the chip family (CalendarDayCell,chipVariants,ChipTimePicker) and fully tokenized. Single mode is byte-identical to before.ChipDatePickergains a matchingmode='range'behind the same chip trigger.DatePicker(its own dual-month grid, hardcoded colors, non-chip chrome) and migrated every consumer:ChipDatePicker(single)Calendarinside an emcnPopover(the same headless/anchored patternDatePickerrendered internally)ChipDatePickershowcase (single, range, range+time)ChipDatePickerfor date tags.logs-toolbar/directory.Wire-format compatibility
The range bounds keep the exact
YYYY-MM-DD/YYYY-MM-DDTHH:mm(:59-closed end) format the legacyDatePickeremitted, so the log/audit-log filter parsing is unchanged (verified by unit tests).Visual QA needed before merge
The headless/anchored calendars can't be verified from code alone — please eyeball:
Type of Change
Testing
Checklist