Skip to content

refactor(web): drop the expired month-picker locale clone - #5338

Merged
tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-pimu00
Nov 22, 2026
Merged

tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-pimu00

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

What and why

Tech-debt sweep of the merges that landed after the 2026-11-21 ledger (#5278, #5305, #5331, #5332, #5333, #5335, #5336, #5337). One finding.

monthPickerLocale cloned en-US with weekStartsOn overridden to the view's start day. #5279 extracted that workaround on 2026-11-17 for react-datepicker 4.x, which passed calendarStartDay to its Month and Week components but not to Day, so in showWeekPicker mode each day decided "am I the start of my week" from the locale alone; a Monday-start view would otherwise have left no day as a tab stop. #5305 upgraded to react-datepicker 9.x four days later, where Week spreads its props into Day (src/week.tsx), so Day receives calendarStartDay, and getStartOfWeek(date, locale, calendarStartDay) hands it to date-fns as weekStartsOn, which outranks locale.options.weekStartsOn. The condition expired, so the clone no longer decides anything.

The divergence this prevents: #5305 also replaced the comment recording that condition with a generic one-liner, so the clone read as deliberate design rather than a workaround. That left two sources of truth for the picker's week start, a cloned locale and the calendarStartDay prop beside it, with only the prop actually in force. Anyone changing week-start behavior would have had to change one of them and could not tell which. The picker keeps calendarStartDay={weekStartDay} and takes plain en-US for formatting, which is what the clone already resolved to for every other purpose.

Behavior preserving, and already pinned: MonthPicker.test.tsx's "anchors the cursor week on Monday when the view starts Monday" asserts the Monday-start tab stop the workaround protected, and passes unchanged.

Examined and deliberately left alone, so the next sweep does not redo it (recorded in full in judged-fine.md): the ShortcutKeycap consolidation and the two key-token normalizers (#5278); the paste-placement store rework, which left no residue (#5332); GRID_POPPER_MODIFIERS and the react-datepicker-popper selectors, which still name a class react-datepicker 9 emits, with @popperjs/core and @types/react-datepicker both removed cleanly (#5305); captureBootShell's module state and useResetLoadingOnPageRestore (#5333); c-not-found, still used by SomethingBrokeView (#5335); the context-menu details array (#5337); and #5331 and #5336, a scoped CSS override and CI workflow plus docs config.

Verify

VERDICT: PASS

Checks run: test:web, type-check, lint, knip, test:a11y (baseline: no new failures), test:e2e (baseline: no new failures).

PRE-EXISTING (0): none.

FLAKY, passed on rerun (3):

  • test:a11y: [chromium-desktop] › e2e/accessibility/narrow-sidebar-layout.spec.ts › week sidebar fits a 360px viewport without horizontal overflow
  • test:e2e: [chromium-desktop] › e2e/accessibility/narrow-sidebar-layout.spec.ts › week sidebar fits a 360px viewport without horizontal overflow
  • test:e2e: [chromium-desktop] › e2e/timed/event-form-fast-typing.spec.ts › title keeps every character when typed quickly in day view

Generated by Claude Code

`monthPickerLocale` cloned en-US with `weekStartsOn` overridden to the
view's start day. #5279 extracted that workaround on 2026-11-17 for
react-datepicker 4.x, which passed `calendarStartDay` to its Month and
Week components but not to Day, so in `showWeekPicker` mode each day
decided "am I the start of my week" from the locale alone.

#5305 upgraded to react-datepicker 9.x four days later. There, `Week`
spreads its props into `Day`, so `Day` receives `calendarStartDay`, and
`getStartOfWeek` hands it to date-fns as `weekStartsOn`, which outranks
`locale.options.weekStartsOn`. The clone no longer decides anything.

#5305 also replaced the comment recording that condition with a generic
one-liner, leaving a second, now-inert week-start source of truth beside
the `calendarStartDay` prop that actually governs it.

The picker keeps `calendarStartDay={weekStartDay}` and takes plain en-US
for formatting. "anchors the cursor week on Monday when the view starts
Monday" already pins the behavior the workaround protected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwVQFkX42gVYDoms2HYwB
@tyler-dane
tyler-dane enabled auto-merge November 22, 2026 11:30
@github-actions

Copy link
Copy Markdown
Contributor

Boot bundle: 602.3 KB gzip (+0.0 KB vs main)

@tyler-dane
tyler-dane added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 08deb86 Nov 22, 2026
23 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-pimu00 branch November 22, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants