Repository navigation
Cancel review animations and timers when the Markdown preview closes - #24644
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📥 CommitsReviewing files that changed from the base of the PR and between 8cf97064e22782c5abff4a6d05ff1eb4267fe5f7 and 8fd47cab66375434286694f611965378ad0845db. 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe preview foundation now tracks review-action animation frames, timeouts, and a generation counter. Review-note actions check mount state and generation before updating attention or scrolling. Preview cleanup invalidates pending actions, clears tracked timeouts, and cancels tracked frames. Lifecycle tests cover unmounts, stale callbacks, concurrent pulses, replacement, reentrancy, and synchronous animation-frame behavior. The Claude child-work evidence-retention test now supplies a prompt registry to the drain call. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to The lifecycle changes have broad reported focused coverage, but the required exact-head platform/provider CI has not run. Wait for it to validate platform scheduling and visible review navigation before merging. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Preview review-note navigation cleanup.
- Track review frames: the click highlight/scroll
requestAnimationFrames now schedule throughrequestMarkdownPreviewEditorRevealFrameand register inpendingReviewActionFrameIdsRef, so teardown can cancel them. - Track all pulse timers: the 900 ms highlight-expiry
setTimeouts are recorded inpendingReviewActionTimeoutIdsRefin addition to the single latest ref; a newclearMarkdownPreviewReviewTimershelper clears the latest plus every pending id. - Generation guard:
reviewActionFrameGenerationRefis bumped onsetRootRef(null); every async step in the click path re-checksisCurrent()(mounted and same generation), so captured callbacks and late actions after unmount do nothing. - Teardown:
cleanupPreviewSurfaceTimersnow snapshots/resets both pending arrays, cancels the snapshotted review frames, and clears the pulse timers. - Tests: new 14-case
markdown-preview-review-frame-lifecycle.test.tsxcovering 64 mount/click/unmount cycles, StrictMode, rapid clicks, same-node replacement, reentrant disposal, and synchronous-frame shims.
I verified the new tests actually fail against stock (pre-PR) code — 9 of 14 fail, including the 128-pending-frames-after-64-unmounts assertion — so this pins a real leak rather than asserting a tautology. The new test passes on head, and pnpm run check:code-quality:changed and pnpm tc:web are clean. Rapid clicks still leave two live pulse timers (matching stock behavior), but the orphan is now tracked, so teardown clears it; keeping the pending array authoritative for cleanup is sound.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
2202da4 to
72cc429
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — delta since the prior pullfrog review (727e585 → 72cc429).
- Rebased onto current
main:72cc4293sits onmain53f9ea78; the review-frame/timer cleanup inuse-markdown-preview-review-actions.ts,use-markdown-preview-viewport.ts,use-markdown-preview-foundation.ts, andmarkdown-preview-review-timer-cleanup.tsis byte-identical to the previously approved revision. The extra content seen in these files vs the old base (largePreview,largeNavigationRef,scrollToSourceLine,useMarkdownPreviewDomSearch, frontmatter removal) is inheritedmainchurn, not PR-authored. - Test adapted to the new base:
mountSurfacegainedlargePreview/largeNavigationRefparameters and the review card now carriesdata-source-line/data-source-end-lineattributes. - New control for the large-preview path: a test asserts that virtual
sourceLinenavigation stays immediate (active comment set, then source line, no DOM query), and that a later annotated-block click's captured pulse callbacks stay inert aftersetRootRef(null).
I reran the suite on head (15/15 pass) and against stock (product files reverted to HEAD~1): 10 tests fail, including the new virtual-navigation control and the 128-pending-frames-after-64-unmounts assertion, so this delta remains real coverage rather than a tautology. The prior approval stands; nothing in the new commits changes the cleanup's correctness.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
8cf9706 to
8fd47ca
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — delta since the prior pullfrog review (72cc429 → 8fd47ca).
- Repaired the Claude retention test fixture:
claude-child-work-evidence-retention.test.tsnow passesprompts: new ClaudePromptRegistry()(imported from./claude-structured-prompt-replies) intodrainClaudeChildWork, satisfying the session parameter's requiredpromptsfield. Without it the test fails the node typecheck, since base1de8396already types the parameter asPick<ClaudeSession, 'childWork' | 'translator' | 'prompts'>.
The five Markdown review-frame/timer files are unchanged since the previously approved revision; the cleanup logic is identical. I reran markdown-preview-review-frame-lifecycle.test.tsx (15) and claude-child-work-evidence-retention.test.ts (3) on head — 18/18 pass — and confirmed the base signature requires prompts, so this is a necessary test-only fix with no production behavior change.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
8fd47ca to
53a5b08
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — delta since the prior pullfrog review (8fd47ca → 53a5b08), which also rebased the branch onto current main (60b1664).
- Repaired the chat collision fixture:
StructuredAgentSessionAttentionBridge.test.tsxnow reads the publisher's tab, asserts the current publisher stampsexecutionHostId: 'runtime:env-1', then strips that field to reconstruct the legacy (unstamped) tab the case is meant to exercise, before running the subscription and delivery assertions. - Renamed the case: "keeps a legacy paired chat subscribed…" now reflects that it targets the older-client tab shape, preserving coverage of the unstamped path that
resolveNotificationTabOwnerfalls through to worktree-based resolution for. - No product change: the four Markdown review-frame/timer files, the lifecycle test, and the Claude retention fixture are byte-identical to the previously approved revision (verified by blob hash), so the cleanup's correctness is unchanged.
I confirmed Tab.executionHostId is optional, so the stripped legacyFields still satisfies Tab, and ran the suite on head — 15/15 pass. This is a necessary test-only fixture repair with no production behavior change.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Final reviewed head Pullfrog reports no new issue on this exact head; the chat fixture has independent second-eye and root approval. The prior CodeRabbit review covers unchanged six-file bytes and generated no actionable code finding. Its pending-CI concern now has the full green run. The generic docstring suggestion is declined under AGENTS.md's concise non-obvious-comment rule. No review thread is unresolved. Final scoped risk is Low: live review navigation, scroll/highlight timing, search and source-line behavior are preserved; only a detached preview's waiting work is retired. Native rendered/platform journeys remain unclaimed, as documented in the body. No production host-routing, notification or Claude-session contract was changed by either fixture repair. |
Track review frames with the existing frame owner, remember all active pulse timers, and retire only the detached preview generation.
53a5b08 to
f958d48
Compare
|
Final resolved head This is the original five-file Markdown scope. Every scope blob exactly matches the approved prior green head, and both fixture repairs now in main are inherited unchanged. Independent second-eye and root verified all five source hashes and main baselines. The current Pullfrog check succeeds; prior no-new-issue reviews cover the same cleanup bytes. No review thread is unresolved. CodeRabbit's earlier pending-CI concern now has a full green run; its generic docstring suggestion remains declined under AGENTS.md's concise-comment rule. Final scoped risk remains Low: live navigation, search, scroll/highlight timing and source-line behavior are preserved. Only the detached preview's waiting callbacks are retired. Native rendered/platform journeys remain explicitly unclaimed. |

ELI5
Closing a Markdown preview cancels its waiting review animations and highlight timers.
What Changed
Review clicks could leave waiting frames behind after the preview closed. Those frames could start a highlight timer later; rapid clicks could also leave an older timer behind. Preview teardown now tracks and cancels every frame and timer belonging to the detached preview. A generation check makes late callbacks harmless.
Live clicks keep their two frames, smooth scroll, highlight, order and 900 ms expiry. Large-document search and immediate source-line navigation are preserved.
Why
The preview already owns its DOM lifetime, and the editor already tracks frames. Reusing those owners fixes abandoned work while keeping live navigation and rapid clicks unchanged. Coalescing clicks or changing highlight timing would change the experience.
Linked Issue
Internal maintainer-requested performance audit; no pre-existing issue, under the template's maintainer exception.
Visual Proof
N/A — live rendering and interactions are unchanged; only callbacks belonging to a closed preview are canceled.
Testing
The actual review hooks pass 15 lifecycle tests, including 64 close/reopen cycles, StrictMode, rapid live clicks, virtual navigation, same-node replacement, synchronous frames and reentrant cleanup. Ten cases fail against stock, with live compatibility controls retained. Earlier source-qualified owner and neighbor verification passed 162 tests; the five Markdown files are unchanged since that verification except for two required inert search mocks.
The same five Markdown source files passed complete CI on the prior qualified head53a5b080, including all five Node24 test shards, relay integration, typecheck, static analysis, normal/Windows packaging and test-selection evidence. Main8cd retains their exact baselines; upstream retention/chat fixture repairs and every other main file are preserved. Full CI passed for final resolved headf958d486: all five Node24 test shards, relay integration, typecheck, static analysis, normal/Windows packaging and final test-selection checks. CI run. All local tests used ORCA_BACKGROUND_LAUNCH=1; scoped lint and formatting passed.
Review
Independent reviewers and root approved the scoped cleanup and preservation of current-main behavior. Pullfrog reported no new issue on the prior seven-file head; its five Markdown files are unchanged. CodeRabbit reported no actionable code issue on the unchanged cleanup. Independent reviewers and root verified the preservation of both upstream fixtures. The generic docstring-coverage suggestion is declined under AGENTS.md, which calls for brief comments explaining non-obvious reasons. No actionable code finding or review thread was unresolved on the prior reviewed head. Current exact-head CI and Pullfrog checks passed, no review thread was unresolved at merge, and the final bot disposition is recorded.
Agent skill upstream boundary
Notes
No scheduling policy, polling, coalescing, persistence, file identity or remote protocol changed. Folder workspaces, local/SSH/WSL ownership and native mobile are unaffected. Hidden Electron scheduling and physical Windows/Linux scroll and selection journeys are unclaimed; focused tests establish owner cleanup and unchanged live timing. Final merge risk is Low for this scoped change.
Checklist