fix(marko-virtual): keep latest pinned through prepend race - #1273
fix(marko-virtual): keep latest pinned through prepend race#1273ousamabenyounes wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe chat example now uses bounded animation-frame retries to keep the viewport pinned during late history prepends. The skipped race test is replaced with four active parameterized tests that verify the bottom position and ChangesChat latest-position handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This change keeps the chat viewport pinned to the latest messages when history prepends complete after Latest is selected, with active race coverage confirming the expected bottom position and status. It is ready to merge. Sequence Diagram(s)sequenceDiagram
participant LatestButton
participant PinRetry
participant Messages
participant HistoryLoader
LatestButton->>PinRetry: reset counters and call scrollToEnd()
HistoryLoader->>Messages: prepend history rows
PinRetry->>Messages: retry scrollToEnd() on animation frames
Messages-->>PinRetry: report settled end position
PinRetry-->>LatestButton: restore At latest state
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🎯 Changes
Fixes #1267.
✅ Checklist
📦 Release Impact
None. Example/e2e-only change.
Test verification (RED → GREEN)
CI=1 pnpm --dir packages/marko-virtual/e2e/app exec playwright test e2e/chat-pretext.spec.ts --grep "Latest returns"failed 4/4 before the fix withdistanceFromEnd = 870.issue_1267_final_revert_red.log.issue_1267_final_green_after_revert.log.CI=1 pnpm --dir packages/marko-virtual/e2e/app exec playwright test e2e/chat-pretext.spec.tspassed 12/12.Full local suite
RUN_CI_LOG_DIR=.../baseline-ci ./run-ci.shpassed on789f5c2c.RUN_CI_LOG_DIR=.../final-ci-after-review ./run-ci.shpassed; Nx reported all configured targets passing for 69 projects, including 85 Marko e2e tests.Summary by CodeRabbit
Bug Fixes
Tests