Skip to content

fix(ui): preserve conversation scroll position across panel toggles - #190252

Merged
steipete merged 1 commit into
mainfrom
fix/ui-hidden-transcript-measurement-41293098118
Nov 1, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/ui-hidden-transcript-measurement-41293098118

Conversation

@steipete

@steipete steipete commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the Dashboard side conversation jumping upward after hiding and reopening Panels.

User Impact

The reader keeps their scroll position while switching panels. No settings, layout, or workflow changes are required.

Why This Change Was Made

The virtualizer defers ResizeObserver delivery to an animation frame. A zero-size row observation captured while the conversation is hidden can therefore arrive after it reopens. Checking the viewport's current height mistakenly accepts that obsolete measurement and erases cached row geometry.

Recognize the observation's zero-width box and retain the cached measurement. Visible zero-height rows with nonzero width still resize normally. The existing row-observer regression covers both cases; its 12 added lines have a dedicated allocation. Production changes by one net line, with no new state or timing mechanism.

Evidence

  • Scheduled run 41293098118, job 124808390495: ui/src/e2e/session-dashboard-active-panel.e2e.test.ts → Control UI dashboard side-panel selection > uses Panels for the main Dashboard conversation without replacing its content reported expected 1444, received 402.
  • Reproduced the same failure on main. The focused observer regression fails on the base (cached 160 becomes 0), passes with the fix, and verifies visible zero-height rows remain accepted.
  • All three unchanged dashboard e2e cases pass against a fresh production bundle; row-reference and geometry suites pass (20 tests). The changed row-reference file passes with one worker in 3.17 seconds wall time; CI timing pending.
  • UI typecheck, scoped lint, formatting, and whitespace checks pass. Independent autoreview: P0–P2 scoped-clean on the complete code/test change; the allocation added afterward is metadata for exactly 12 added test lines. Local ClawSweeper is not built; hosted review requested after publication.

Ignore zero-width ResizeObserver row receipts captured while a retained panel was hidden, even when deferred delivery runs after reveal. Preserve legitimate visible zero-height rows and cover both at the virtualizer boundary.
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

steipete commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Nov 1, 2026
@steipete
steipete marked this pull request as ready for review November 1, 2026 10:51
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T10:53:21.630733Z 288dea9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve cached transcript row heights when a deferred zero-size observation arrives after a hidden panel reopens.

Example: A row previously measured at 160 px receives a deferred 0-by-0 observation after its viewport reopens at 300 px tall.

  • Before: The cached row height becomes 0, moving the conversation's reading position.
  • After: The cached height remains 160 px; a visible 800-by-0 observation still correctly sets it to 0.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-supported, but supplied test claims do not satisfy the required observable browser proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The Dashboard side conversation jumps upward after the reader hides and reopens Panels.
Reason: This restores an existing scroll-preservation contract through a narrow maintainer-authored repair with no new option or behavior policy.

Merge readiness

✅ Ready for maintainer review

This PR fixes a concrete scroll-position defect still present on current main, using the existing measurement owner; no introduced code defect was found.

Priority: P2
Reviewed head: 288dea976326f3c936fba969847f335ab4d5ec39

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Attach inspected before/after browser captures and scroll-offset output for hiding and reopening the Dashboard conversation on the fixed production build.
Agent review details

How this fits together

Control UI transcript geometry translates browser row measurements into virtualizer sizes that determine rendered row offsets and scroll compensation.

flowchart LR
  A[Panels toggle] --> B[Retained conversation]
  B --> C[ResizeObserver receipt]
  C --> D[Transcript measurement owner]
  D --> E[Virtualizer size cache]
  E --> F[Conversation scroll position]
Loading

Technical review

Best possible solution:

Keep this focused repair in the existing transcript measurement owner, preserving cached hidden-row geometry and legitimate visible zero-height measurements.

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

Source inspection confirms that current main accepts the stale zero-size receipt after reveal; the PR also reports a matching browser failure, but this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete fix for the shown failure: use the observation's own width at the existing measurement boundary and retain the established cache fallback.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests +12, Other +2. Total +15 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 4 3 +1
Tests 1 13 1 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 19 4 +15

Review metrics

Metric Value Why it matters
Production versus test growth Production +1 net line; tests +12 net lines The growth adds one receipt-time condition and two distinct regression assertions within existing owners and fixtures.

Labels

Label changes:

  • add P2: Panel toggles move the reader's position without evidence of lost messages, drafts, or an unusable core workflow.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Panel toggles move the reader's position without evidence of lost messages, drafts, or an unusable core workflow.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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.

  • Attach sanitized browser evidence showing the same reading position before hiding Panels and after reopening them.

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 1, 2026, 5:55 AM ET / 10:55 UTC.

@steipete
steipete enabled auto-merge (squash) November 1, 2026 10:58
@steipete
steipete merged commit b67eb3e into main Nov 1, 2026
146 of 148 checks passed
@steipete
steipete deleted the fix/ui-hidden-transcript-measurement-41293098118 branch November 1, 2026 11:00
@steipete

steipete commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…nclaw#190252)

Ignore zero-width ResizeObserver row receipts captured while a retained panel was hidden, even when deferred delivery runs after reveal. Preserve legitimate visible zero-height rows and cover both at the virtualizer boundary.
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 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. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant