Repository navigation
refactor(vscode): drive the session preview with paint frames - #14352
Conversation
The preview polled on a 50 ms interval, recomputed the frame on every tick, and restarted each cycle by remounting the whole sample. Drive playback from requestAnimationFrame instead and derive the phase from the elapsed time modulo the cycle length, which removes the interval and the end-of-loop guard, keeps the loop in place, and stops on its own when the panel is not painting.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
The docs commit Previous Review Summaries (2 snapshots, latest commit f965e57)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f965e57)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
The follow-up commit Previous review (commit dd6e4f4)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (1 file)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
Accumulate painted time only and cap a single stall, so time spent hidden or occluded no longer advances the loop and the sample resumes where it stopped instead of jumping to an arbitrary phase. Commit state on the previous 50 ms cadence rather than once per paint frame, so requestAnimationFrame only schedules the work.
Cover the two display keys that had no documentation, code_edit_display and mcp_tool_display, and explain the work-style choice during onboarding, including that Review first also sets permission rules. Point to where both choices can be changed later: the Display tab for display options and the Auto-Approve tab for permissions.
Follow-up to #14346, which received a review note about
setIntervalin the session preview.What changed
requestAnimationFrameschedules playback instead of a 50 ms interval.requestAnimationFrameonly schedules the work.Docs
The Display settings page did not cover the work-style choice, the presets, or the preview panel, and two display keys had no documentation at all. This PR also documents:
code_edit_displayandmcp_tool_display, alongside the existing display keys.Why
The previous loop woke up 20 times per second whether or not anything changed, recomputed the frame on every tick, and restarted a cycle by remounting the whole sample.
User impact
No visible behavior change in the preview. The sample still streams, loops, follows new content unless the user scrolls away, and reacts to draft display settings. Users can now read what the presets and the onboarding choice actually do.
Evidence
Isolated VS Code runs:
bun run compile(typecheck, lint, bundle), the focused tests, andcheck-md-table-paddingpass.