fix(web): palette intent preload + shortcut chips (train #1026) #1029

Closed
kayg wants to merge 5 commits from fix/palette-preload-chips into dev
Owner

Fixes the two real regressions from the daily train, #1026 (prod 20eab8d3a passes, dev 4906cdb11 failed 3/3).

1. Palette intent preload fetched two scripts (preload.spec.ts:118)

Cause: the pickers merge (#853) made the phrase reader (composer/recognise.ts) shared by the Palette and the Tasks screen (DatePicker, RepeatPicker, WhenField). The bundler then split it into its own recognise chunk (next to the old dates chunk's contents), and a Control/Meta intent fetched Palette-*.js + recognise-*.js.
Fix (apps/web/vite.config.ts): one named group dates = composer/dates.ts, task-input.ts, recognise.ts. The Palette always needs the reader, so it rides along in the one shared chunk the spec already allows. No lazy loading needed. Palette's imports now: dates-* + index-* only (bundle graph checked). Spec unchanged.
Budgets: chunk.recognise (1.48) removed, chunk.dates 0.55 → 1.48, total_js_brotli 506.69 → 506.14 (it must equal the sum).

2. .wt-content kbd strict mode violation (shortcuts.spec.ts:280)

Decision: the code is right, the spec is stale. keyChips() (packages/ui/src/lib/tooltip.ts, from the rows port) deliberately renders one <kbd> per key (⌘ and B, Ctrl and B), the warm-tooltip key-chip style. The spec now expects two chips: ['⌘', 'B'] / ['Ctrl', 'B']. Intent kept: the tooltip shows the right shortcut.

Gates (dev-01 compute02, ~/bin/slot)

  • preload.spec.ts Control/Meta + shortcuts.spec.ts tooltip test, --repeat-each=5, all projects: 60 passed, 20 skipped (mobile/platform skips), 0 failed.
  • Targeted picker/palette/preload/lazy/shortcut specs (preload, shortcuts, picker, picker-lazy, search-palette, slash-menu, tag-picker, tasks-lazy, lazy-ui, lazy-sheet-recovery, lazy-offline, lazy-styled), all four projects: 220 passed, 51 skipped, 9 failed. All 9 are phone-only (390) and identical on unmodified dev 4906cdb11 (baseline run, same 7 on chromium-390 plus the 2 Palette ones this PR fixes): lazy-offline.spec.ts:3, lazy-ui.spec.ts:70 (failed idle-screens warming), preload.spec.ts:89 phone Search pointerover/pointerdown/focusin (idle-screens fetched on Search intent). Not caused by this PR; they need their own fix (phone Search pulls idle-screens, likely from the pickers merge). Not in scope here.
  • perf/web.sh --bundle-only --gate: exit 0. first_js_brotli 221.788 KB (dev 221.802, no growth); chunk.dates 1.479 ≤ 1.48; Palette 19.935 (dev 19.946); total_js_brotli 496.353 (dev 496.236, +0.12 KB lazy, from the merged chunk's own header; first paint unchanged).

Link: #1026

Fixes the two real regressions from the daily train, #1026 (prod 20eab8d3a passes, dev 4906cdb11 failed 3/3). ## 1. Palette intent preload fetched two scripts (`preload.spec.ts:118`) Cause: the pickers merge (#853) made the phrase reader (`composer/recognise.ts`) shared by the Palette and the Tasks screen (DatePicker, RepeatPicker, WhenField). The bundler then split it into its own `recognise` chunk (next to the old `dates` chunk's contents), and a Control/Meta intent fetched `Palette-*.js` + `recognise-*.js`. Fix (`apps/web/vite.config.ts`): one named group `dates` = `composer/dates.ts`, `task-input.ts`, `recognise.ts`. The Palette always needs the reader, so it rides along in the one shared chunk the spec already allows. No lazy loading needed. Palette's imports now: `dates-*` + `index-*` only (bundle graph checked). Spec unchanged. Budgets: `chunk.recognise` (1.48) removed, `chunk.dates` 0.55 → 1.48, `total_js_brotli` 506.69 → 506.14 (it must equal the sum). ## 2. `.wt-content kbd` strict mode violation (`shortcuts.spec.ts:280`) Decision: the code is right, the spec is stale. `keyChips()` (`packages/ui/src/lib/tooltip.ts`, from the rows port) deliberately renders one `<kbd>` per key (⌘ and B, Ctrl and B), the warm-tooltip key-chip style. The spec now expects two chips: `['⌘', 'B']` / `['Ctrl', 'B']`. Intent kept: the tooltip shows the right shortcut. ## Gates (dev-01 compute02, `~/bin/slot`) - `preload.spec.ts` Control/Meta + `shortcuts.spec.ts` tooltip test, `--repeat-each=5`, all projects: **60 passed, 20 skipped (mobile/platform skips), 0 failed**. - Targeted picker/palette/preload/lazy/shortcut specs (preload, shortcuts, picker, picker-lazy, search-palette, slash-menu, tag-picker, tasks-lazy, lazy-ui, lazy-sheet-recovery, lazy-offline, lazy-styled), all four projects: 220 passed, 51 skipped, 9 failed. All 9 are phone-only (390) and **identical on unmodified dev 4906cdb11** (baseline run, same 7 on chromium-390 plus the 2 Palette ones this PR fixes): `lazy-offline.spec.ts:3`, `lazy-ui.spec.ts:70` (failed idle-screens warming), `preload.spec.ts:89` phone Search pointerover/pointerdown/focusin (idle-screens fetched on Search intent). Not caused by this PR; they need their own fix (phone Search pulls `idle-screens`, likely from the pickers merge). Not in scope here. - `perf/web.sh --bundle-only --gate`: exit 0. first_js_brotli 221.788 KB (dev 221.802, no growth); chunk.dates 1.479 ≤ 1.48; Palette 19.935 (dev 19.946); total_js_brotli 496.353 (dev 496.236, +0.12 KB lazy, from the merged chunk's own header; first paint unchanged). Link: #1026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Palette preload now fetches Palette plus this one chunk, as before. The chunk grew
because the phrase reader (recognise) and the task text helper joined it instead of
being their own chunks that the Palette fetched on top. Total JS stays within 0.2 KB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
perf(budgets): one dates chunk (1.48 KB) replaces dates (0.55) + recognise (1.48); total follows (train #1026)
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
c10f0b801d
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Merged into dev locally (head 2931715c5 is in origin/dev); closing.

Merged into dev locally (head `2931715c5` is in origin/dev); closing.
kayg closed this pull request 2026-11-09 18:55:12 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!1029
No description provided.