Render dashboard chat history incrementally#88685
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 3, 2026, 3:07 AM ET / 07:07 UTC. Summary PR surface: Source +255, Tests +342. Total +597 across 8 files. Reproducibility: no. live reproduction was run here. Source inspection supports the reported path: current Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the view-layer incremental render-window approach after a redacted browser or live Control UI proof demonstrates large-history session switching, top-scroll expansion, anchor preservation, and no visible Talk/composer control regression. Do we have a high-confidence way to reproduce the issue? No live reproduction was run here. Source inspection supports the reported path: current Is this the best way to solve the issue? Yes, this looks like an acceptable narrow fix shape: the smaller window stays opt-in from AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 7ccbffcb1bd5. Label changesLabel justifications:
Evidence reviewedPR surface: Source +255, Tests +342. Total +597 across 8 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
This feels like a good pragmatic step before pulling in virtualization. Keeping the default 100-message behavior in One follow-up I’d love to see covered, either here or in a later patch, is anchor preservation when the window expands repeatedly on top-scroll. The tests already cover the limit progression well; a regression around “user scrolls to top, window grows, but the previously visible top item does not jump unexpectedly” would make me even more comfortable with the UX on very heavy sessions. |
9163738 to
401cb3b
Compare
Constraint: Keep openclaw#88685 focused on dashboard session switching responsiveness and accepted review feedback. Rejected: Replacing chat controls with a broader component rewrite | too broad for this remediation PR. Confidence: high Scope-risk: moderate Directive: Keep lazy history expansion tied to explicit scroll/search paths and preserve existing composer/Talk controls. Tested: git diff --check origin/main...HEAD; focused chat/app Talk Vitest; build-chat-items Vitest; UI tsgo; codex review --base origin/main. Not-tested: Full UI suite and browser visual recording not run.
054f5bb to
0e65213
Compare
Constraint: OpenClaw dashboard issue openclaw#87345 reports 8-10s switches from full chat history rendering. Rejected: Adding a new virtualization dependency | too broad for a targeted stability PR. Confidence: high Scope-risk: moderate Directive: Keep chat history window expansion tied to explicit user scroll-up or search, not automatic full rebuild. Tested: node node_modules/oxfmt/bin/oxfmt --write --threads=1 ui/src/ui/chat/build-chat-items.ts ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.ts; git diff --check; CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 OPENCLAW_VITEST_NO_OUTPUT_HEARTBEAT_MS=10000 node scripts/run-vitest.mjs --run --maxWorkers 1 ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.test.ts Not-tested: pnpm tsgo:test:ui and node scripts/check-changed.mjs both blocked during pnpm install; sandbox hit npm ENOTFOUND and escalated retry hit Darwin optional package timeout error 23.
Constraint: codex review found hidden history could be unreachable when the initial render window did not overflow the chat thread. Rejected: Making the hidden-count notice a bespoke button | would require changing generic grouped message rendering for a small reachability fix. Confidence: high Scope-risk: narrow Directive: Preserve the scroll-up expansion path, but keep a post-render fill path for non-overflowing windows. Tested: node node_modules/oxfmt/bin/oxfmt --write --threads=1 ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.ts; git diff --check; CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 OPENCLAW_VITEST_NO_OUTPUT_HEARTBEAT_MS=10000 node scripts/run-vitest.mjs --run --maxWorkers 1 ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.test.ts Not-tested: pnpm tsgo:test:ui and node scripts/check-changed.mjs both blocked during pnpm install; sandbox hit npm ENOTFOUND and escalated retry hit Darwin optional package timeout error 23.
Constraint: Maintainer feedback requested repeated top-scroll anchor coverage for the dashboard render window path. Confidence: medium Scope-risk: narrow Directive: Keep render-window expansion anchored to the previously visible top item when adding older messages above the viewport. Tested: git diff --check; node scripts/run-vitest.mjs --run --maxWorkers 1 ui/src/ui/views/chat.test.ts -t "chat history render window". Not-tested: Full ui/src/ui/views/chat.test.ts still has unrelated existing composer/Talk assertion failures in this worktree.
Constraint: Keep openclaw#88685 focused on dashboard session switching responsiveness and accepted review feedback. Rejected: Replacing chat controls with a broader component rewrite | too broad for this remediation PR. Confidence: high Scope-risk: moderate Directive: Keep lazy history expansion tied to explicit scroll/search paths and preserve existing composer/Talk controls. Tested: git diff --check origin/main...HEAD; focused chat/app Talk Vitest; build-chat-items Vitest; UI tsgo; codex review --base origin/main. Not-tested: Full UI suite and browser visual recording not run.
The history-window refactor dropped the explicit showSecondary: false at the composer renderChatRunControls call, so it fell back to the default true and reintroduced the New session and Export buttons in the composer toolbar. Restore the explicit suppression and add a regression test that asserts neither control renders in the composer.
The history-window refactor also flattened the Talk options button: it lost its aria-expanded reflection of the open panel state, its visible control label, and the descriptive Talk settings title/aria-label. Restore the accessible expanded-state semantics and label, and add a regression test asserting aria-expanded tracks realtimeTalkOptionsOpen.
62bfd29 to
2b2705c
Compare
|
Land-ready proof for head What changed during maintainer closeout:
Proof run:
Visual mocked Control UI proof covered a 105-message session windowing from 30 visible messages to 90 after upward expansion, with latest and earlier messages both reachable. |
Fixes #87345
User-facing bug
Switching dashboard chat sessions could synchronously rebuild the full 100-message UI history window, causing 8-10s switches on long or heavy transcripts.
Exact repro
chat.historyreturns the current 100-message tail.Fix summary
historyRenderLimittobuildChatItems, preserving existing default 100-message behavior.renderChatso newly loaded large histories initially render 30 messages.onScrollToBottompath.showSecondary: falseat the composerrenderChatRunControlscall so the history-window refactor does not reintroduce the New session and Export buttons in the composer toolbar, with a regression test asserting neither control renders there.aria-expandedstate, visible control label, and descriptive title/aria-label that the refactor had flattened, with a regression test assertingaria-expandedtracksrealtimeTalkOptionsOpen.Targeted tests
buildChatItemscoverage proves the render limit preserves the newest window.Real behavior proof
Behavior addressed: Switching to a large dashboard chat history no longer forces an immediate 100-message render; the UI starts with a latest-message window and expands incrementally.
Real environment tested: Local OpenClaw checkout on branch
fix/dashboard-session-switching, commit415e0eaaf4, based onorigin/main.Exact steps or command run after this patch:
git diff --check origin/main...HEADOPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts./node_modules/.bin/oxlint ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.tsEvidence after fix:
ui/src/ui/views/chat.test.tssuite passed after restoring the suppressed composer controls and the Talk settings button semantics, and adding both regression tests. Copied terminal output:showSecondary: falsereproduces1 failed | 90 passed;aria-expandedreproduces1 failed | 91 passed;92 passed.oxlinton the two touched files passed with exit code 0.git diff --check origin/main...HEADpassed.Observed result after fix: Newly loaded large histories render the newest 30 messages first, expand in 30-message batches from top-scroll/top state, preserve the previously visible top anchor across repeated expansion, avoid bottom auto-scroll expansion, and still render full loaded history for non-empty search.
What was not tested: Full UI suite,
pnpm check, and browser screenshot/video were not run. This PR changes render-window behavior and is covered with focused jsdom view/controller tests plus UI tsgo; no visual recording was captured.Not tested / known gaps
pnpm checkwere not run.AI-assisted disclosure
Prepared with AI assistance in Codex. I reviewed the diff, ran targeted tests, and resolved codex review findings before opening.