Repository navigation
fix(app): PageUp history browsing settles above the latest turn - #4742
Conversation
…on dismiss Base UI keeps a dialog popup mounted (and partially opaque) until its exit animation or transition finishes, so the restart prompt and the command palette stayed visible for 100-200 ms after Keep working / Escape. Hide the popup with display:none as soon as it is closed; Base UI then unmounts it on the next frame.
…snapping back to the tail
…nto e2e/history-browse-pageup
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (11141 ms), confidentiality-review (26149 ms), desktop-den-sync-review (13508 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (e1183df89444072f6438cddc91a5fa9c802d11ef). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Deploying openwork with
|
| Latest commit: |
3a20e25
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1a2448a5.openwork.pages.dev |
| Branch Preview URL: | https://e2e-history-browse-pageup.openwork.pages.dev |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (3a20e25f323d8ebc6ff10d9b5d5d88b611a19265). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Resync against
|
|
Dev control for the test 2 red — |
Root cause
Triage cluster 7/K follow-on (
reports/e2e-red-2026-09-09/triage.md, "Dismiss-then-notSeeraces"; PR #4724 fixed the dismiss race and reported this next failure):streamed-markdown-answertest 3 (v1 keeps long tool-rich history…) fails inbrowseHistory— added by #4683, reworked by #4687, never executed on the lane before — withkeyboard browsing settles above the latest turn … expected 561 to be greater than or equal to 657.The numbers pin it: the transcript viewport is ≈600 px tall, so
PageUpscrolls 0.875 × 600 ≈ 525 px; at scroll-bottom the last user row sits at top ≈ 36 (the 20 shell-tool messages are below it); 36 + 525 = 561.PageUpwas therefore pressed from the bottom, not from row 74 — thescrollIntoViewperformed byuser.click(text=Settled history 075.)had already been undone.Why (
scroll-controller.ts): ascrollIntoViewis not a wheel/key/pointer gesture, sohandleScrollignored it and the store stayed instickyBottom. The click'spointerupthen ranreconcile(), which instickyBottommode with the view not at the bottom callsscrollToBottom(). During streaming theResizeObserverreconcile does the same on the next chunk. This is a product defect, not only a harness artefact: user bubbles aretabIndex=0, so Tab/Shift+Tab-focusing an older message scrolls it into view the same way, and the next click or streamed chunk yanks the reader back to the tail.What changed
apps/app/src/react-app/domains/session/surface/scroll-controller.ts: inhandleScroll's non-gesture branch, a scroll that leaves the view away from the bottom while the store is instickyBottom(history ready, not restoring, no smooth jump in flight) now becomes the manual reading position (setManualScrollwith the visible anchor) and cancels the pending re-bottom frame. The existingmanual-mode anchor refresh is unchanged; live-tail clamping (still exactly at bottom) is unaffected. No spec was changed and no waits were added.apps/app/tests/session-scroll.test.tsx: one focused regression in the existing file (focus reveal → click → resize keeps the position; clamping stays sticky). Red onorigin/dev, green here — a unit check, not proof.Stacked on #4724 (
origin/e2e/dismiss-dialog-visibility, merged in via merge commit rather than rebase): without it test 3 dies earlier at the palettenotSeeand never reachesbrowseHistory(verified: run ate1397c664, dev-only base, failed atexpectTargetsline 188). Once #4724 lands this PR reduces toe1397c664.Proof (Daytona, sha
e1183df89444072f6438cddc91a5fa9c802d11ef,OPENWORK_EVAL_REFpinned — sandbox logHEAD is now at e1183df8)pnpm evals:e2e streamed-markdown-answer --daytonaPlacement line:
{"command":"evals:e2e","lane":"e2e","daytona":true,"placement":"daytona","engine":"legacy","surface":"legacy","case":null,"vision":"defer","files":["streamed-markdown-answer"],"passed":1,"failed":3,"skipped":0,"skips":[],"consented":["OPENWORK_EVAL_E2E_TESTS"],"verdict":"failed"}→ passed 1 / failed 3 / skipped 0.
sending clears the composer…— triage Cluster 1/B (draftTextis"\n"), out of scope, unchanged.a streaming answer renders as markdown…— Cluster 1/B (fresh-session send never starts:Streamed answer headingnever appears), out of scope, unchanged.v1 keeps long tool-rich history…— this PR's claims pass. Step trace at this sha:the live cache retains history older than the native 140-message snapshotsending from older history reveals the exact latest user row above the composer without Jump to latest(contains the firstbrowseHistory: click row 74 →PageUp→keyboard browsing settles above the latest turnsatisfied, then the submitted row is revealed)new tool output becomes accessible without losing old targets while text growspassive streamed output does not jump away from the history being read(secondbrowseHistory, mid-stream, then anchor movement ≤ 2 px over the whole stream)settled history and the advancing answer never disappear or duplicatechoose a reading message inside the retained history tail—Timed out waiting for persisted visible reading anchor after 10000ms; last value: null. This is fix(chat): show sent attachments immediately and preserve reading position #4687's Find → persisted reading-anchor claim, reached for the first time on the lane. By code path this change is inert there: the store is already inmanualmode from the precedingPageUpgesture, and the new branch only acts instickyBottom. Not touched here (see below).CONT-01 restores the exact cumulative prefix…Verdict for this PR's claim (
browseHistorysettles above the latest turn, idle and mid-stream): Passed — both occurrences have observable passing assertions in the trace. Spec-level verdict for the file remains Incomplete because of the three unrelated failures above. All six sandboxes from both runs were deleted by the testkit (verified withdaytona sandbox list).Also:
pnpm --filter @openwork/app typecheckexit 0;bun test --isolate ./tests/session-scroll.test.tsx15 pass / 0 fail;./tests/live-step-scroll.test.ts10 pass / 0 fail;git diff --checkclean.Warden: bare
pnpm warden:checkat HEADe1183df89/ origin/dev4e634905e(same refs after), exit 0, skills diff-security-review, confidentiality-review, desktop-den-sync-review all completed over the 4 committed files (includes #4724's two files because of the merge) — No findings. Run61bd4837-2026-09-10T03-18-33-914Z.Noticed, not touched
Find in conversation→Settled history 130.→Close find, the persisted scroll state ismanualwith an anchor, butreadingGeometry(anchor.messageId)never matches within 10 s (anchormessageIdchanged once between the first two polls, then stayed stable). Candidates: thept-16 → pt-4padding change on close shifting content without a compensating scroll event, or an offset drift > 2 px between the saved anchor and the rendered row. Needs one instrumented run (saved anchor vs. visible rows) — the steps after it (switching conversations preserves the reading position…,cold reload…) have never run either.jumpToLatest,smoothJumpstaystrueuntil the next gesture/auto-bottom, so a focus reveal in that narrow window still won't become the reading position. Minor; left alone for the smallest diff.command-palette-search/command-palette-pin-renamestill carryprobe.eventually(… footer disappears)waits that fix(app): close the restart prompt and command palette synchronously on dismiss #4724 makes unnecessary.