Repository navigation
refactor(web): share the now-cue pulse subscription and flatten go-to-today - #4476
Merged
Merged
Conversation
…-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
enabled auto-merge
October 15, 2026 10:21
Contributor
|
Boot bundle: 507.7 KB gzip (+0.0 KB vs main) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andDayLabelseach 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.useNowCuePulsehook owns both subscriptions and mints the key, with the remount rationale documented once. Call sites drop from four lines to one.scrollToNowOrPulsehad a nestedstrictAtNow/teachPulsebranch that scrolled in two places and returned early; it is now two reads (taken before the scroll, as they must be) and two statements.motion-reduce:transition-nonefrom the four spots where it rode along with animation-only classes. Thec-now-cue-*utilities already carrymotion-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 realtransition-*.getScrollToNowDeltaandSCROLL_TO_NOW_PULSE_NEAR_MINUTES, which onlygrid.utiluses.No behavior change; the existing now-cue tests cover the pulse, the near-pulse, and the repeat-press generation bump.
Verify
type-check,lint, andknippass. Thetest:webfailure is the sandbox RSS guard, not a test:web shard 3/6 exceeded 5000 MB RSS. Evidence it is environmental:origin/mainworktree (git stash -u), stopping at the same file,SelectView.test.tsx.🤖 Generated with Claude Code
https://claude.ai/code/session_01WpxnkYFrv7Y6BGCCQL55vM
Generated by Claude Code