Skip to content

refactor(web): share the now-cue pulse subscription and flatten go-to-today - #4476

Merged
tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-07nhop
Oct 15, 2026
Merged

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

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Technical-debt sweep over the last 7 days of merged work. No issue; found by reviewing #4475 / #4468.

What and why

The go-to-today teach pulse (#4475, #4468) left the same four lines copy-pasted into every element that pulses. TimedGrid, SelectView, and DayLabels each subscribed to the now-cue store twice (selectNowCueActive + selectNowCuePulseGeneration) and then hand-rolled the remount key that makes a CSS animation replay on a repeated press, each with its own spelling (pulseGeneration, `day-num-${pulseGeneration}`, emphasizeDayLabel ? pulseGeneration : undefined). The trick is subtle enough to deserve one explanation, not three re-derivations.

  • New useNowCuePulse hook owns both subscriptions and mints the key, with the remount rationale documented once. Call sites drop from four lines to one.
  • scrollToNowOrPulse had a nested strictAtNow / teachPulse branch that scrolled in two places and returned early; it is now two reads (taken before the scroll, as they must be) and two statements.
  • Dropped motion-reduce:transition-none from the four spots where it rode along with animation-only classes. The c-now-cue-* utilities already carry motion-reduce:animate-none, and none of these elements declare a transition, so the class was dead. Every other use in the app is correctly paired with a real transition-*.
  • Unexported getScrollToNowDelta and SCROLL_TO_NOW_PULSE_NEAR_MINUTES, which only grid.util uses.

No behavior change; the existing now-cue tests cover the pulse, the near-pulse, and the repeat-press generation bump.

Verify

VERDICT: FAIL
Selected packages: web
Checks run: type-check, lint, knip
Checks skipped: test:a11y, test:e2e (Playwright Chromium missing)
Failed: test:web

type-check, lint, and knip pass. The test:web failure is the sandbox RSS guard, not a test: web shard 3/6 exceeded 5000 MB RSS. Evidence it is environmental:

  • It reproduces identically on a clean origin/main worktree (git stash -u), stopping at the same file, SelectView.test.tsx.
  • It is cumulative process memory, not one test: raising the cap to 12 GB trips at 12 GB too, while splitting shard 3's 86 files into two halves passes both (255 + 480 tests, 0 fail).
  • Every web test passes once the memory ceiling is out of the way: shards 1, 2, 4, 5, 6 ran clean (654 / 757 / 675 / 717 / 663 pass, 0 fail) plus shard 3 in halves.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM


Generated by Claude Code

…-today

Four components each subscribed to the now-cue store twice and rebuilt the
same remount key by hand, so the trick that makes a CSS animation replay was
re-explained at every call site. Fold both subscriptions into useNowCuePulse
and let it mint the key.

Also flatten scrollToNowOrPulse's nested already-at-now branch into two reads
and two statements, drop the dead motion-reduce:transition-none that rode
along with animation-only classes (the pulse utilities already carry
motion-reduce:animate-none, and none of these elements transition), and
unexport the two grid helpers that only grid.util uses.

No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Oct 15, 2026 — with Claude
@tyler-dane
tyler-dane enabled auto-merge October 15, 2026 10:21
@github-actions

Copy link
Copy Markdown
Contributor

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

@tyler-dane
tyler-dane added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit e3147cf Oct 15, 2026
30 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-07nhop branch October 15, 2026 10:32
tyler-dane pushed a commit that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants