Skip to content

fix(ui): preserve reader position through transcript resize clamps - #196187

Open
roboclaw-bot wants to merge 1 commit into
mainfrom
loops/l467-ui-transcript-end-follow
Open

roboclaw-bot wants to merge 1 commit into
mainfrom
loops/l467-ui-transcript-end-follow

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes the transcript returning to its old end after a reader moves just before a viewport resize clamps their position.

User Impact

Reader position survives the viewport growing and shrinking. An untouched end continues following normally, and active scroll commands keep their existing lifecycle.

Why This Change Was Made

The offset observer already receives the position immediately before each layout correction. If that position differs from its last observed offset and no host command is pending, it now releases the completed virtualizer target before recording the correction. Otherwise the native clamp can conceal the reader departure and the retained end target pulls the viewport back later.

Classification: timing-dependent product defect. The retained dynamic target was added by #196036 (21c0b48bfd71), which precedes the previous passing scheduled head bd0557f4fac0 by ten commits. The API comparison of bd0557f4fac0..6edcaa28edb7 establishes no causal introducer in that interval; predecessor-paint change #196001 does not establish causation. No matching repair was found on main after the failing head or in overlapping updated PRs.

The five-line production fix keeps the existing offset owner. The existing browser clamp matrix now refreshes the completed Latest target before the settled reader departs and commits viewport geometry before inspecting the clamp. All position and idle assertions remain. Observer cleanup uses the existing test-finish hook. The offset-observer unit test is unchanged from main.

Test growth is exactly zero versus origin/main: 22 browser-test lines added, 22 removed. No new test case, fixture, state, timer, dependency, configuration, baseline, allowance, or production test hook is added. The standalone fixture from the previous revision has been removed.

Evidence

  • Original scheduled failure, head 6edcaa28edb7: chat-transcript-end-follow.browser.test.ts:657, settled/end/8 px/before-clamp case, expected 860, received 960. Job log fetched once.
  • Fresh independent Codex autoreview of the revised candidate against 5370a9d79c925f5e5c28a0b62fc8de7c40e27192, with the complete browser test, source owner/callers, layout owner, native fixture and exact virtual-core 3.19.2 source: scoped-clean P0–P2. Review found the real-boundary regression capable of exposing the original defect; runtime red/green remains unverified. The lead separately verified unit-test byte identity and 22/22 browser-test line counts against main.
  • git diff --check: passed.
  • The named non-browser offset-observer test was attempted again under timeout and the shared local-run lock; it stopped before execution because this worktree has no dependencies. Earlier touched-file lint had the same setup blocker. Focused-test wall time and CI seconds are unavailable; typecheck, formatting, full browser reproduction and screenshots remain unverified.
  • Prior-head CI 42672413673, f0c4344156ac, failed before testing: the gate reports preflight and security-fast as abandoned, and UI/build/planning lanes as skipped. No test job ran; the underlying abandonment reason is unavailable in the gate log. This is not evidence for the replacement head.
  • Replacement head: ab843c069c09a61ac2023eb447ee67a973a78934, force-pushed with a lease against the recorded prior head after the test-budget repair. That push supplies the CI trigger; results are pending. No manual dispatch, rerun or warmup was issued.
  • PR CI owns browser and broad proof. No browser, container, broad suite, staging, packaging, workflow dispatch, rerun, or remote warmup was run on the production Gateway host. No retries, timeout increases, skips, assertion weakening or baseline increases.

Work sessions

Linked for team reference; these sessions aren’t public.

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

Release a completed virtualizer target when a layout receipt consumes reader movement before its native scroll event. Preserve untouched following and active commands.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the loops/l467-ui-transcript-end-follow branch from f0c4344 to ab843c0 Compare November 9, 2026 18:29
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR cancels a completed transcript scroll target when a layout correction reveals previously unobserved reader movement.

Example: After Latest completes, the reader moves up 8 pixels immediately before the viewport grows from 400 to 500 pixels tall.

  • Before: Restoring the viewport pulls the transcript to offset 960 instead of preserving the clamped reader position at 860.
  • After: The completed target is canceled so viewport restoration and subsequent row growth preserve offset 860.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused repair is source-supported and has no definite finding, but after-fix runtime validation remains thin.
Proof confidence 🦪 silver shellfish (2/6) This maintainer-authored PR is outside the contributor proof gate; its changed offset-observer behavior remains runtime-unverified, and inspected images demonstrate earlier painting and late-growth fixes rather than resize-clamp recovery.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A reader who scrolls just before a viewport resize can be pulled back to the old transcript end.
Reason: Preserving deliberate reader position restores an existing contract, and maintainer-authored direction is already established.

Regression provenance

Regression provenance — verified: source commit 21c0b48bfd71 by Peter Steinberger; canonical PR #196036 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a confirmed transcript-position defect with a focused repair and no definite introduced bug.

Priority: P2
Reviewed head: ab843c069c09a61ac2023eb447ee67a973a78934

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The revised clamp matrix has no recorded base-red/head-green run, and no supplied capture shows reader-position preservation through resize and later growth on this head.
Agent review details

How this fits together

The transcript offset observer reconciles native scrolling, layout corrections, and host commands, then updates the virtualizer and reader-follow policy.

flowchart TD
  A[Reader movement] --> C[Transcript offset observer]
  B[Viewport layout correction] --> C
  C --> D[Transcript session host]
  D --> E[Virtualizer target]
  E --> F[Native transcript position]
Loading

Technical review

Best possible solution:

Use the existing offset observer to release completed targets on reader departure while preserving untouched following and pending commands.

Do we have a high-confidence way to reproduce the issue?

The scheduled Chromium assertion confirms the 860-to-960 failure, and current-main target retention plus correction handling explain the path; this read-only review executed no target code.

Is this the best way to solve the issue?

The patch is the smallest source-supported repair: it uses the existing movement receipt and cancellation owner without adding state, timers, or a competing scroll policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ce7788f5a24e.

Provenance checked

  • Native movement consumed by layout receipts keeps the original intent (335e80d: Attribute native reader movement separately from programmatic layout corrections for transcript interaction handling.)
  • Completed dynamic end target keeps the original intent (21c0b48: Keep Latest following late row measurements while allowing fresh reader takeover.)
  • Resize-clamp browser regressions keeps the original intent (1fbf9a4: Prevent delayed end-command settlement from reclaiming a reader after a temporary viewport clamp.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 36cb3fd adds ui/src/pages/chat/components/chat-transcript-offset-observer.ts:148 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 36cb3fd95275; files: ui/src/pages/chat/components/chat-transcript-offset-observer.ts)
  • Vyctor H. Brzezowski: Raw commit 335e80d adds ui/src/pages/chat/components/chat-transcript-offset-observer.ts:71 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 335e80dc8fc1; files: ui/src/pages/chat/components/chat-transcript-offset-observer.ts)

PR surface

Source +5, Tests 0. Total +5 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 22 22 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 22 +5

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +5/-0; browser tests +22/-22 The repair reuses existing state and strengthens the existing clamp matrix without net test growth or new scaffolding.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Viewport resizing can move a reader away from their chosen transcript position, causing recoverable reading friction.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Verify the revised browser matrix fails on the base and passes on this head, including untouched following and pending commands.
  • Capture the repaired resize flow through the shipped UI with synthetic content and redacted screenshots or recording.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 9, 2026, 1:46 PM ET / 18:46 UTC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant