Repository navigation
fix(app): persist the reading anchor chosen through Find in the retained history tail - #4780
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
…nto e2e/find-reading-anchor
…e2e/find-reading-anchor
…Find opens or closes The find bar's clearance toggled padding-top on the scroll container. A padding change on the scroller is a scroll-anchoring suppression trigger, so the transcript shifted 48px under the reader with no scroll event and the persisted reading anchor stayed 48px stale. Render the clearance inside the content column instead; the browser anchors it and the controller re-saves the anchor.
|
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 (15258 ms), confidentiality-review (25155 ms), desktop-den-sync-review (26363 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 (b3bd4205d52da5c5afc98927606255f95b9c276b). 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: |
5a5ac9d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b9241b76.openwork.pages.dev |
| Branch Preview URL: | https://e2e-find-reading-anchor.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 (5a5ac9d3449a1129b850d5d712ce0d7efcefb431). 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 — |
…tended transcript load (#4792) * fix(app): close the restart prompt and command palette synchronously 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. * fix(session): keep a focus reveal as the reading position instead of snapping back to the tail * fix(app): keep the reading position and its saved anchor stable when Find opens or closes The find bar's clearance toggled padding-top on the scroll container. A padding change on the scroller is a scroll-anchoring suppression trigger, so the transcript shifted 48px under the reader with no scroll event and the persisted reading anchor stayed 48px stale. Render the clearance inside the content column instead; the browser anchors it and the controller re-saves the anchor. * test(evals): expect the whole transcript after a cold reload in the long-history journey `de965e2b1` (#4695) deliberately fetches the session snapshot without a `limit`, so a cold open renders every message instead of the newest 140. The step written by #4614 still expected the bounded 97-row tail after `user.reload()` and failed once #4780 let the lane reach it. Re-express the claim as `toEqual(world.history)`, keep the reading-anchor restore and the tool-link checks, and keep the engine's `?limit=140` page as the negative witness: it still lacks the oldest turn that the reopened surface must show. --------- Signed-off-by: Guillaume Loret <[email protected]>
Root cause
Triage cluster 7/K follow-on (
reports/e2e-red-2026-09-09/triage.md, "Dismiss-then-notSeeraces" → #4724 → #4742 → this):streamed-markdown-answertest 3 (v1 keeps long tool-rich history…) failed at the stepchoose a reading message inside the retained history tail(#4687's Find → persisted reading anchor claim) withTimed out waiting for persisted visible reading anchor after 10000ms; last value: null— the first time the lane ever reached it (#4742's "Noticed, not touched" item 1).The persisted anchor was there and in
manualmode; what never matched was the ≤ 2 px offset check.SessionSurfacegave the find bar its clearance by togglingpt-16 ↔ pt-4on the scroll container itself. A padding change on the scroller is a CSS scroll-anchoring suppression trigger, so when Find closes the whole transcript shifts up 48 px under the reader,scrollTopdoes not move and noscrollevent fires — the controller never gets a chance to refresh the anchor, which stays 48 px stale. Verified in the app's own Chromium (Electron 43 / Chrome 150) with a minimal scroller: padding-top 16→64→16 leavesscrollTopunchanged and fires zero scroll events (the first visible row's offset jumps −23 → −15 → −23), while the same 48 px change inside the content is anchored (scrollTop3000 → 3048, one scroll event).This is a product defect, not a wrong claim (
pt-16predates the anchor persistence work: #2477 vs #4687): opening or closing ⌘F visibly jumps the transcript by 48 px, and a later restore (session switch / reload) lands the reading row 48 px away from where the person left it.What changed
apps/app/src/react-app/domains/session/surface/session-surface.tsx(one hunk): the scroller keeps a fixedpt-4; while Find owns the surface a 48 pxaria-hiddenspacer is rendered as the first child of the content column instead. Native scroll anchoring keeps the reading row in place (manual mode), the resulting scroll event lets the controller re-save a truthful anchor, and in sticky-bottom mode the contentResizeObserverre-bottoms exactly as the padding did before. No spec change, no waits.Stacked on #4724 (
origin/e2e/dismiss-dialog-visibility) and #4742 (origin/e2e/history-browse-pageup), merged in with merge commits (no rebase); their files are untouched here. Without them test 3 dies earlier (palettenotSee, thenbrowseHistory) and never reaches this step. Once both land, this PR reduces tob3bd4205d.Proof (Daytona, sha
b3bd4205d52da5c5afc98927606255f95b9c276b,OPENWORK_EVAL_REFpinned — sandbox logHEAD is now at b3bd4205)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, owned by fix(app): keep a brand-new session sendable while its first snapshot loads #4757, unchanged.a streaming answer renders as markdown…— Cluster 1/B (fix(app): keep a brand-new session sendable while its first snapshot loads #4757); this run additionally hit a Daytona502during Den provisioning (no assertion reached).v1 keeps long tool-rich history…— this PR's claim passes. Step trace at this sha (test-run.json, run2026-09-10T04-36-10-463Z):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 latestnew tool output becomes accessible without losing old targets while text growspassive streamed output does not jump away from the history being readsettled history and the advancing answer never disappear or duplicatechoose a reading message inside the retained history tail(1008 ms; the persisted anchor matched the rendered row within 2 px on the second poll) — red on fix(app): PageUp history browsing settles above the latest turn #4742's head.switching conversations preserves the reading position, full cached history and scoped targets— never reached before; the restored anchor matched on the first poll.cold reload keeps the bounded history tail ordered and old and new tool links usable— next never-reached step, see below.CONT-01 restores the exact cumulative prefix…Two further diagnostic runs of test 3 only (vitest
-t, same sha, temporary uncommitted instrumentation afteruser.reload(), not proof) reproduced steps 1–7 green both times.Verdict for this PR's claim: Passed (observable passing assertion for the Find → persisted anchor step and for the session-switch restore that depends on it). File-level verdict for
streamed-markdown-answerremains Incomplete because of the three failures above. All sandboxes from the three 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;git diff --check origin/dev...HEADclean.Warden: bare
pnpm warden:checkat HEADb3bd4205d/ origin/dev7d5097d42(same refs after), exit 0; skills diff-security-review, confidentiality-review, desktop-den-sync-review all completed over the 4 committed source files (includes #4724/#4742 hunks because of the merges) — No findings. Log.warden/logs/89fb6f18-2026-09-10T05-11-20-691Z.jsonl.Noticed, not touched
cold reload keeps the bounded history tail ordered…— stale claim. With instrumentation, afteruser.reload()the surface came back with all 152 messages, the saved anchor restored andexpectReadingPosition()passed; the step then failed onexpect(await orderedHistory()).toEqual(retainedHistory)—expected ['Settled history 001.', …(149)] to deeply equal ['Settled history 054.', …(96)].de965e2b1(fix(app): load the whole transcript when opening a session #4695, "load the whole transcript when opening a session") landed after fix(chat): show sent attachments immediately and preserve reading position #4687 wrote this claim and deliberately fetches the snapshot with nolimit(session-surface.tsx:1283), so the renderer no longer shows a bounded tail after a cold reload. The claim needs re-expressing (likelytoEqual(world.history), plus revisitingretainedHistory.length < world.history.length, which now only describes the raw API) — a product decision I did not make here.readingGeometryreturnednullfor the full 60 s (surface or row absent). Instrumentation on a later run showed the renderer still on "Starting OpenWork — If startup does not finish, reload to try again" immediately afteruser.reload(), withdocument.body === nullat t≈0; it recovered within 3 s there. Run 1 may be that startup screen persisting; worth a look by whoever owns item 1.jumpToLatestsmoothJumpwindow; redundantprobe.eventuallywaits in the palette specs) still stand.