Repository navigation
fix(web): a thread opening is not painted before it is positioned - #1122
Open
yaacovcorcos wants to merge 3 commits into
Open
yaacovcorcos wants to merge 3 commits into
yaacovcorcos wants to merge 3 commits into
Conversation
A browser fires scroll events on the next frame, after scrollTop has moved. When the parent landed at its end within one frame, the wait saw the end before any scroll was recorded and the test failed with no shortfalls (twice on PR #1121's Web 10). The recorded-scroll check now sits inside the wait; a scroll that lands short still fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yaacovcorcos
enabled auto-merge
November 25, 2026 07:29
yaacovcorcos
disabled auto-merge
November 25, 2026 07:31
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
…itioned The restore scrolls a thread opening at its end a frame or more after the new rows commit (a microtask, then Legend's measured end), so the first painted frame showed the new thread at the previous thread's offset, usually its top, before it jumped to the end. Opening a working parent from its subagent painted the parent's turns 0-4 first. The timeline is now transparent while such an opening is positioned (laid out, readable and focusable, like a fork landing), shown when the restore reports it positioned or after 1 s at most. Saved reading positions, citations, follow resumes and first-prompt placement are unchanged. The working-parent test now checks every committed change and scroll until the parent is positioned: once the parent's rows are shown, the timeline is transparent or at its end. Without the fix it fails with the parent shown 5,644 px from its end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sitioned Review of 989fd6b found the end-only gate could change its mind mid-restore (a saved row arriving), showed cached rows at the wrong offset while history loaded, let a blind click act on transparent content, and carried an expired fallback to the next visit of the same thread. The gate now covers every opening that has rows, from the moment they mount until the thread reports positioned, whatever path the restore takes. Its fallback expiry is reset with the other positioning state on each opening. It is a cover over the timeline (bg-background, above the minimap) rather than opacity on the scroller's ancestors: switching an ancestor's opacity mid-restore undid a reader's scroll in the existing 'leaves a scroll without reader input' test (2 of 3 runs with the reveal forced early, 0 of 6 with the cover). The cover also takes presses, and Playwright clicks wait for it. New tests (readerScrolling.browser.test.tsx) cover an opening whose cached rows show while its history loads, and a fallback reveal followed by a later visit. Both fail without the fix. The working-parent test bounds its wait, registers cleanup first, and checks a visible sample at the end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes a flaky web test and the app flaw it was covering: opening a thread showed it at the previous thread's scroll position for a frame or more before it moved into place.
The flaky test
MessagesTimeline› "opens a working parent thread at its end without landing short" failed twice in a row on #1121 (docs only) withexpected 0 to be greater than 0.Cause (reproduced in review). The restore's end scroll moves
scrollTopat once, but the browser fires the scroll event on the next frame. When the parent reached its end within one frame,waitForpassed before any scroll event had been recorded. Fix: the "a scroll was recorded" check moves inside thewaitFor; any recorded scroll that lands short still fails.The product fix
The list isn't keyed per thread, and the restore positions an opening a frame or more after its rows commit (the end scroll, a saved row, history paging in). So the first painted frame showed the new thread at the old offset, usually its top: opening a parent from its subagent showed turns 0–4, then jumped to 27–29.
MessagesTimeline.tsx: from the moment an opening's rows mount until it reports positioned, a cover (bg-background, above the minimap) sits over the timeline. Whatever path the restore takes, it covers that opening only. It is shown after 1 s at most if the restore never reports, and that expiry is reset with each opening.Tests
readerScrolling.browser.test.tsx(Scient-owned):Checks run
Review: Codex GPT-6.2 Sol, two rounds so far (
reviews/ci-speed-20261124/review-pr1122.md,review-pr1122-round2.md).Platforms: shared web timeline code, the same on macOS, Windows and Linux. Verified only in Chromium on macOS.
🤖 Generated with Claude Code