Skip to content

fix(ui): load earlier history into underfilled transcripts - #125080

Merged
steipete merged 1 commit into
mainfrom
steipete/session-top-auto-loading-3d1997
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/session-top-auto-loading-3d1997

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #110771

What Problem This Solves

Fixes an issue where opening a paginated Control UI session could leave most of the transcript viewport empty when projection collapsed the first older page. Earlier history remained stranded behind the manual Show earlier action even though the visible pane still had room to display it.

Why This Change Was Made

The transcript now keeps observing its earlier-history sentinel after each successful page while the rendered pane is still shorter than its viewport. It stops as soon as the transcript becomes scrollable, history is exhausted, or a request fails, while preserving the existing scroll-to-top intent gate, single-flight loading, cursor progress checks, viewport anchoring, and manual retry path.

The obsolete one-page bootstrap counter and its lifecycle state were deleted rather than replaced with another limit.

User Impact

Opening a clipped session now fills the visible transcript automatically. Scrolling a longer session to the top continues to load earlier history automatically, without requiring repeated clicks on Show earlier.

Evidence

  • Pre-fix Chromium regression: expected pagination offsets [2, 6], but only [2] was requested; the second page never loaded.
  • Focused Chromium E2E: underfilled transcript loaded offsets 2 and 6 without click, wheel, keyboard, touch, or synthetic scroll, then made no third request after the transcript became scrollable.
  • Existing scroll-to-top/anchor E2E passed.
  • ui/src/pages/chat/chat-pane-history.test.ts: 25/25 passed.
  • AWS Crabbox changed gate: run_7e64a9f50e40 on cbx_8273c2236521, exit 0 (coreTests, ui).
  • Codex autoreview: clean, no accepted/actionable findings.
  • Production LOC: +1/-14 (net -13). Tests: +150/-47.

Initial underfilled viewport

Initial underfilled transcript viewport while earlier history loads

Continued automatic loading

Transcript continuing to load earlier history automatically

Final scrollable transcript

Final scrollable transcript after automatic history pagination

AI-assisted; the implementation and proof were reviewed against the owning transcript pagination and virtualization boundaries.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 05:32
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 17, 2026
@steipete steipete self-assigned this Aug 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 1:39 AM ET / 05:39 UTC.

ClawSweeper review

What this changes

The PR lets a short Control UI transcript automatically request further older-history pages until it becomes scrollable, history ends, or a request fails.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. Current main still stops automatic history loading after one underfilled page; this PR removes that obsolete observer-local limit while retaining pagination progress, failure, and scrollability guards. No blocking patch defect found.

Priority: P2
Reviewed head: 8e5fb3860cbf9aa4cf056de779611a79b0dec21a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The PR is a focused, net-negative owner-boundary fix with a credible browser regression scenario and no actionable review finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies focused Chromium E2E and screenshot evidence for the changed transcript flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies focused Chromium E2E and screenshot evidence for the changed transcript flow.
Evidence reviewed 6 items Current-main behavior: The bootstrap condition permits only one non-scrollable automatic page, then the observer blocks while the pane remains short; the current unit test explicitly expects that behavior.
Owner-boundary repair: The PR removes only the bootstrap counter and cap from the observer, preserving connection, single-flight, exhaustion, offset-progress, and failed-request handling.
Render lifecycle caller: Every committed chat-pane update re-synchronizes the sentinel, allowing a successful underfilled page to arm the next automatic request.
Findings None None.
Security None None.

How this fits together

The Control UI renders Gateway-paginated session history in a chat transcript. Its top-of-transcript sentinel determines whether another older page is requested, which affects whether an opened session has enough visible conversation without a manual action.

flowchart LR
  A[Gateway session history] --> B[Paginated history response]
  B --> C[Control UI transcript]
  C --> D[Earlier-history sentinel]
  D --> E{Transcript scrollable?}
  E -->|No| F[Fetch another older page]
  E -->|Yes or exhausted| G[Stop automatic loading]
  F --> B
Loading

Before merge

  • Complete next step (P2) - No repair job is needed because this active maintainer-owned PR already contains the focused owner-boundary fix and regression coverage.
Agent review details

Security

None.

PR surface

Source -13, Tests +103. Total +90 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 1 14 -13
Tests 3 150 47 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 151 61 +90

Review metrics

Metric Value Why it matters
Production versus test LOC production +1/-14; tests +150/-47 The repair deletes the obsolete one-page state and adds boundary-level browser coverage for the resulting automatic pagination behavior.

Stored data model

Persistent data-model change detected: vector/embedding metadata: ui/src/e2e/claude-sessions.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Make the transcript fill an initially short viewport through the existing sentinel while retaining the current pagination, failure, and exhaustion safeguards as the sole stopping conditions.

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

Yes. Current main increments the one-page bootstrap counter before loading, and the next render blocks further automatic loading if the pane is still unscrollable; the PR E2E’s second offset request is a direct regression detector.

Is this the best way to solve the issue?

Yes. The observer owns the erroneous one-page decision, so removing its cap is narrower than changing Gateway pagination; existing progress, failure, and scrollability guards remain in that same owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 49ff3e5b6940.

Labels

Label changes:

  • add P2: This is a bounded Control UI transcript-recovery bug with limited blast radius and no data-loss, security, or runtime-availability evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies focused Chromium E2E and screenshot evidence for the changed transcript flow.

Label justifications:

  • P2: This is a bounded Control UI transcript-recovery bug with limited blast radius and no data-loss, security, or runtime-availability evidence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies focused Chromium E2E and screenshot evidence for the changed transcript flow.

Evidence

What I checked:

Likely related people:

  • steipete: Feature history shows Peter Steinberger introduced native offset paging and automatic older-history loading, then maintained native history anchoring. (role: feature owner and recent area contributor; confidence: high; commits: 238c7973adea, 842f8f3ee92c, 7a7f6dfbd41e; files: ui/src/pages/chat/chat-history.ts, ui/src/pages/chat/chat-pane-history.ts)
  • Josh Lehman: Recent chat-pane history work includes the WebChat reply-context preservation change, making this a relevant secondary routing contact. (role: adjacent recent contributor; confidence: medium; commits: 585503896dd3; files: ui/src/pages/chat/chat-pane-history.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for 8e5fb3860cbf9aa4cf056de779611a79b0dec21a:

Root cause: the transcript sentinel had an observer-local one-page bootstrap cap. When projection collapsed that older page, the pane could remain underfilled with no scroll delta available to re-arm loading. This patch deletes the cap/counter and keeps the existing single-flight, progress, failure, exhaustion, intent, and anchor guards. Production LOC: +1/-14 (net -13); tests: +150/-47.

  • OPENCLAW_UI_E2E_ARTIFACT_DIR=.artifacts/control-ui-e2e/transcript-auto-pagination-lead node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/claude-sessions.e2e.test.ts -t "auto-pages an underfilled native transcript until it becomes scrollable" — passed (1 passed, 7 skipped); offsets 2 then 6 loaded without interaction, with no third request after the pane became scrollable.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/claude-sessions.e2e.test.ts -t "auto-loads older chat without moving the viewport" — passed (1 passed, 7 skipped); the scroll-top painted-row anchor was preserved.
  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-history.test.ts — 25/25 passed.
  • node scripts/check-changed.mjs -- <seven changed UI paths> — AWS Crabbox run run_7e64a9f50e40 on lease cbx_8273c2236521, exit 0 (coreTests, ui).
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/31998274059 — completed success.
  • Fresh Codex autoreview: clean, no accepted/actionable findings.
  • Independent source-blind Chromium behavior validation: all in-scope clauses passed; the three inspected screenshots are in the PR body.

ClawSweeper completed on this exact head with no patch findings and no literal Rank-up moves. Its sole P2 checklist item is ordinary maintainer review, satisfied by the repo-native review artifacts. The stored-data-model heuristic is skipped as inapplicable: it matched the existing chat.metadata E2E fixture method name; this PR changes no schema or persistence surface.

@steipete
steipete merged commit d6be4f3 into main Aug 17, 2026
193 of 194 checks passed
@steipete
steipete deleted the steipete/session-top-auto-loading-3d1997 branch August 17, 2026 05:45
@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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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