Skip to content

fix(ui): prevent native history from jumping during prepend - #123103

Merged
steipete merged 1 commit into
mainfrom
steipete/virtual-row-anchor-test-flake-92a6ef
Aug 13, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/virtual-row-anchor-test-flake-92a6ef

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users scrolling to older native session history could see the visible transcript jump by one estimated row while the older page was prepended. The unrelated CI failure in run 31681003925, job 94386567989 captured the top row moving from 24px to -96px even though it remained mounted.

Why This Change Was Made

TanStack Virtual 3.17.6 wrote the resize-compensation scroll position before the matching row transforms were notified, allowing one inconsistent paint. This updates @tanstack/virtual-core to 3.17.7 and @tanstack/lit-virtual to 3.13.36, which contain the upstream same-paint compensation fix from TanStack/virtual#1239.

The existing regression now samples every mutation batch after a real rendering opportunity instead of advancing fake requestAnimationFrame callbacks. It preserves the strict viewport-position assertion, adds no retries or timeout increases, and can emit sanitized before/after screenshots when proof capture is enabled.

AI-assisted: yes; the final diff was independently autoreviewed.

User Impact

Older native history now loads with its spinner while the current transcript stays visually anchored. When the page completes, the spinner disappears without a one-row flash or duplicate request after history is exhausted.

Evidence

Before: the deterministic real-paint probe failed on Blacksmith Testbox at iteration 10 with five post-paint samples holding the original anchor at -96px instead of 24px. The original unrelated CI failure showed the same 120px displacement.

Before: older native history is loading while recent native message 41 anchors the viewport

After: the same top message remains in the same position after the older page is prepended and the spinner is removed.

After: older native history is prepended with recent native message 41 still anchored

Validation on Blacksmith Testbox tbx_01kzx5pg8dfdey86n2ynqvf0yh:

  • focused native-history anchor scenario: 50/50 passed
  • ui/src/e2e/claude-sessions.e2e.test.ts: 7/7 passed on the final diff
  • targeted format check, test typecheck, oxlint, and dependency pin guard: passed
  • source-blind behavior validation: 6/6 contract clauses passed
  • Codex autoreview (--mode uncommitted): no accepted/actionable findings

Production LOC: +0/-0. Test code: +101/-42. Package manifest and lockfile version substitutions are net-neutral.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete steipete self-assigned this Aug 13, 2026
@steipete
steipete marked this pull request as ready for review August 13, 2026 09:31
@steipete
steipete requested a review from a team as a code owner August 13, 2026 09:31
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 13, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • pnpm-lock.yaml
  • ui/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: cc0424427fe8554190ed7c9953929356e3cdacbe
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification is complete on head cc0424427fe8554190ed7c9953929356e3cdacbe.

Root cause: TanStack Virtual 3.17.6 could paint the compensating scroll position before the matching row transforms. The patch consumes the upstream 3.17.7 same-paint fix and keeps the e2e assertion tied to real painted mutation batches instead of fake-clock animation frames.

Proof:

  • Before fix: the real-paint stress run failed at iteration 10 with five samples holding the anchor at -96px instead of 24px.
  • After fix: the same scenario passed 50/50 on Blacksmith Testbox tbx_01kzx5pg8dfdey86n2ynqvf0yh (run).
  • Final focused file: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/claude-sessions.e2e.test.ts — 7/7 passed on the final diff.
  • Targeted format check, test typecheck, oxlint, and dependency pin guard passed.
  • Source-blind behavior validation passed 6/6 contract clauses.
  • Independent autoreview reported no accepted/actionable findings.
  • Exact-head CI run 31687012927, attempt 2: green, including all four Control UI e2e shards and openclaw/ci-gate.

The first CI attempt had two unrelated timing flakes (package-docs-map concurrency and a background-task 11s/12s text comparison); both passed on the single failed-job rerun. No proof gaps remain for this scoped UI fix.

@steipete
steipete merged commit 7a7f6df into main Aug 13, 2026
214 of 217 checks passed
@steipete
steipete deleted the steipete/virtual-row-anchor-test-flake-92a6ef branch August 13, 2026 09:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 dependencies-changed PR changes dependency-related files maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant