fix(web): keep queued transcript snaps reader-safe - #328
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughTranscript refreshes now preserve the captured transcript element before snapping to the end. Shared helpers define frame-safe snapping and scroll-direction detection, with tests covering their behavior. ChangesTranscript scroll behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change makes transcript scrolling safer around queued frame updates and initial direction detection, with focused regression coverage. No actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Refresh
participant SnapHelper
participant TranscriptElement
Refresh->>SnapHelper: request transcript snap
SnapHelper->>TranscriptElement: capture element and scrollTop
SnapHelper->>TranscriptElement: validate element and queued target after frame
SnapHelper->>TranscriptElement: set scrollTop to scrollHeight
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
Greptile SummaryThe PR makes queued transcript snaps conditional on both DOM-element identity and unchanged scroll position, preventing delayed refresh frames from overriding reader movement or affecting a replacement transcript.
|
| Filename | Overview |
|---|---|
| apps/web/src/lib/transcript-scroll.ts | Adds element-identity and scroll-position validation for queued snaps and avoids classifying movement without an initialized baseline. |
| apps/web/src/lib/transcript-scroll.test.ts | Adds deterministic regression coverage for reader movement, replacement transcript elements, and initial movement detection. |
| apps/web/src/pages/Shell.tsx | Captures queued transcript ownership before scheduling and initializes movement baselines when manual interaction begins. |
Reviews (2): Last reviewed commit: "fix(web): bind queued snap to transcript" | Re-trigger Greptile
Playwright screenshotsOpen screenshot gallery · Dashboard · CI run Updated for commit |
Follow-up to #324 for review comments that arrived after merge.
Verification:
vitest run --root . apps/web/src(21 files, 123 tests)tsc --noEmit -p apps/web/tsconfig.jsonbiome checkon the three changed filesSummary by CodeRabbit