Skip to content

refactor: fold duplicate keyboard predicates, coverage rule, page size, and quote indexes from this week's merges - #5164

Merged
tyler-dane merged 3 commits into
mainfrom
claude/kind-dirac-gkuydy
Nov 6, 2026
Merged

tyler-dane merged 3 commits into
mainfrom
claude/kind-dirac-gkuydy

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

What and why

Technical-debt sweep over the merges from the last 7 days. Three independent cleanups, one commit each, no behavior change in any of them.

refactor(web): reuse shared keyboard predicates in meeting types (#5160, #5112, #5078 touched this file). BookingMeetingTypesField carried its own hasModifier copy of hasAnyModifier plus its own Enter predicate, which is the exact drift keyboard-modifiers.util.ts documents itself against ("easy to copy with one modifier missing"). It also spelled [data-settings-shortcut="add-meeting-type"] twice and booking-meeting-type-label- once as literals, beside the helpers that build both, and rendered the row keycaps twice so the two copies could diverge. Now it reuses hasAnyModifier/isPlainEnterKey (keeping the IME isComposing guard), a new settingsShortcutSelector sits next to settingsShortcutAttrs so the stamp and the query cannot drift (clickSettingsShortcut uses it too), the id prefix is shared with labelInputId, and one keycap fragment renders with a conditional "On row:" lead-in.

refactor(sync): one certification predicate and a named page size (#5150, #5152, #5140, #5143, #5145). Successive history-coverage fixes left repairCalendar stating the certification rule twice: once as the pre-activation revoke condition (!cursor || skipped > 0 || supportsFullHistory !== true) and once as the final complete argument. A single certified boolean now drives both. recordHistoryCoverage stores historyCoverageVersion = complete && skipped === 0, and the final call is only reached with a truthy cursor, so the stored row is byte-identical. Separately, readReflectionPage repeated the literal 25 in the query limit, the merge slice, and the next-cursor test, where a partial edit would silently stop paging; it is PAGE_SIZE now.

refactor(email): name the weekly review quotes, drop redundant spreads (#5083, #5154, #5156). The weekly review picked its quotes as LIFE_QUOTES[2], [13] and [23], so inserting or reordering a quote in the Life catalog would silently change what the email sends, and the test only asserted the quote came from the catalog at all. The three are named constants now, exported as REFLECTION_EMAIL_QUOTES, with the catalog built from the same constants; the test asserts against that list and that the catalog still contains it. Verified the rendered selection is unchanged (same three strings, same order). Two lines: [...(cond ? [a] : [b])] spreads fold into the arrays they copied.

Noted and deliberately left alone: the prepared.pngBase64 read path in reflection-dispatch.ts is still live transitional code for editions queued before the PDF switch (#5158/#5161) and should drain on its own; and renderReflectionLife{Svg,Png,Pdf} still thread a positional (birthDate, date, lifeUrl) triple of same-typed strings, worth an input object in a follow-up that is not squeezed under the size rails with this one.

Verify

bun lint, bun knip, bun type-check: pass. bun test:core, bun test:sync:fast, bun test:web (booking + settings), bun test:backend:fast (email): pass.

PRE-EXISTING (fail on origin/main in this sandbox too, unrelated to the diff):

  • packages/core configureHttpServer > does not reject a request that exceeds maxHeadersCount
  • packages/backend email Mongo-backed specs (computeEmailSendHeartbeat and the *.db.test.ts set): the sandbox cannot bind ::, so mongodb-memory-server never starts. The same binding failure blocks bun test:sync *.db.test.ts, including calendar-repair.service.db.test.ts and reflection-read.service.db.test.ts, which cover the sync commit; CI runs them.

bun run verify --strict was still running when this PR opened; its VERDICT: line follows as a comment and CI is the gate.


Generated by Claude Code

The meeting-type field kept its own `hasModifier` copy of
`hasAnyModifier` and its own Enter predicate, the exact drift the
shared helper's doc comment warns about. It also spelled the
`data-settings-shortcut` selector and the label-input id prefix as
literals beside the helpers that build them, and rendered the row
keycaps twice so the two copies could diverge.

Reuse `hasAnyModifier`/`isPlainEnterKey`, add a
`settingsShortcutSelector` next to `settingsShortcutAttrs` so the
stamp and the query cannot drift, derive both the add-type selector
and the id prefix from those helpers, and render one row-keycap
fragment with the "On row:" lead-in conditional. No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwVQFhTkQ5Zy37ZJk47Vj
Three history-coverage fixes landed in calendar repair this week and
left the certification rule spelled twice: once as the pre-activation
revoke condition and once as the final `complete` argument. Hoist a
single `certified` boolean and use it for both, so the rule has one
place to read and one place to change. `historyCoverageVersion` is
`complete && skipped === 0`, so the stored result is identical.

The reflection page reads repeated the literal 25 in the query limit,
the merge slice, and the next-cursor test, where a partial edit would
silently stop paging. Name it `PAGE_SIZE`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwVQFhTkQ5Zy37ZJk47Vj
The weekly review picked its three quotes as `LIFE_QUOTES[2]`, `[13]`
and `[23]`, so inserting or reordering a quote in the Life catalog
would silently change what the email sends, and the existing test only
asserted the quote came from the catalog at all. Name the three in
`life-quotes.ts`, export them as `REFLECTION_EMAIL_QUOTES`, build the
catalog from the same constants, and tighten the test to that list
plus a check that the catalog still contains them. Same three quotes.

Also fold two `lines: [...(cond ? [a] : [b])]` spreads into the
conditional arrays they copy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwVQFhTkQ5Zy37ZJk47Vj
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

Verify evidence, as promised in the description.

bun run verify --strict (sandbox): VERDICT: FAIL

Selected packages: core, sync, web, backend
Checks run: test:sync:fast, test:web, type-check, lint, knip, test:e2e
Checks skipped: (none)

Baseline against origin/main:
NEW, fails only on this branch (1):
- test:a11y: [chromium-desktop] › e2e/accessibility/focus-visible.spec.ts › the 'i' shortcut moves focus to a visibly-focused sidebar day

Failed: test:core, test:backend:fast, test:a11y
VERDICT: FAIL

The verdict does not survive scrutiny and CI agrees:

  • The one NEW line is a sandbox flake under contention, not this diff. focus-visible.spec.ts exercises the i shortcut and the sidebar date picker; the only web files here are BookingMeetingTypesField.tsx and a pure extraction in useSettingsShortcuts.ts (settingsShortcutSelector(id) returns the same string the template literal built), neither of which can reach that picker. Rerun alone on this branch: 2 passed. Full e2e/accessibility on this branch: 73 passed. CI e2e-shard (1, e2e/accessibility e2e/allday): success.
  • test:core is the pre-existing configureHttpServer > does not reject a request that exceeds maxHeadersCount, which fails the same way on origin/main in this sandbox (confirmed by stashing the diff).
  • test:backend:fast is the Mongo-backed email set (computeEmailSendHeartbeat, the *.db.test.ts files): mongodb-memory-server cannot bind :: here, so mongod never starts. The same binding failure is why calendar-repair.service.db.test.ts and reflection-read.service.db.test.ts, which cover the sync commit, could not run locally.

CI on this head is green across the board: unit, all five e2e-shards, static, boot-bundle, delta, macos. Boot bundle +0.0 KB.


Generated by Claude Code

@tyler-dane
tyler-dane added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit a901a4e Nov 6, 2026
34 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-gkuydy branch November 6, 2026 11:41
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