Skip to content

refactor(ui): deslop chat page third pass - #158683

Merged
steipete merged 1 commit into
mainfrom
deslop/l69-ui-chat-third-pass
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l69-ui-chat-third-pass

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat and new-session still carried repeated rendering, composer, and lifecycle plumbing after the earlier cleanup passes.

User Impact

The refactor preserves appearance, copy, keyboard/accessibility behavior, routes, Gateway payloads, streaming order, and persisted preferences. It also fixes two small error paths described below. No configuration or migration changes.

Why This Change Was Made

  • Use the existing composer persistence owner directly, remove obsolete chat view callbacks, and consolidate submitted-composer clearing without changing attachment custody.
  • Share chat error publication, connection/current-session predicates, and repeated transcript projections while retaining distinct request, session, and generation checks.
  • Replace repeated menu/action rendering with typed data tables that retain labels, classes, attributes, order, and handlers.
  • Reuse existing attachment, IndexedDB completion, and capability-label helpers; remove forwarding exports, one-use adapters, and dead Talk hooks.
  • Simplify new-session host wiring, route defaults, cloud choices, and terminal navigation without changing target selection or request shapes.

Measured production reduction: 1,108 net lines (1,211 added, 2,319 removed across 114 production files). The sweep read the complete chat and new-session production subtrees, largest files first. Shared ui/src/components and ui/src/lib were reused without edits. The assertion-safety ratchet only shrinks removed assertions.

Compatibility review

No configuration/default, storage-key, database-version, schema, serialized-field, retention, permission, or migration contract changes. session-snapshot-store.ts keeps the same JSON.stringify/JSON.parse sanitization boundary and the same strict recordSchema; record creation calls the existing parser with no optional session-key filter. The shared IndexedDB completion helper observes the same completion/error/abort lifecycle. Existing stored snapshots and drafts require no migration.

Existing tests cover sanitized cross-owner snapshot sharing, delta-cursor round trips, Incognito upgrade purging while preserving ordinary history, legacy failed-send restoration, and shipped main/global/opaque alias migration. These passed in the reported UI selections. The compatibility checklist in the earlier automated review was triggered by the serialized-state filename and a truncated PR file list; the complete diff contains no new storage format or config surface.

Fixes found along the way

  • An old outbox recovery module-load failure could publish an error after its element's identity or connection was retired. The error path now uses the same generation/lifetime check as successful completion. The regression fails on the original code and passes on the candidate.
  • Capability names matching object prototype properties, such as constructor, could crash new-session device facts during translation lookup. The menu now consumes the existing safe capability-label owner. The device-projection regression fails on the original code and passes on the candidate.
  • The content-column browser fixture depended on CSS left behind by other files in the non-isolated browser shard. It now imports the owning stylesheet and mirrors the production .chat/.chat-thread-inner structure, including the saved thread width. No assertions, cases, or tolerances were removed. The original fails four desktop cases on the clean base; the corrected fixture passes on that same base, 20 standalone repetitions, and three complete browser-shard repetitions.

Evidence

READY-TO-LAND. Required exact-head CI is green; independent review has no accepted actionable findings. Whole-core lint has the documented unrelated pinned-base exception below, already repaired on main.

All computation ran on Linux Blacksmith Testbox through the repository Crabbox wrapper after pnpm install --frozen-lockfile. Initial verification lease: tbx_01m3dyzdd8ajfrh2nq8s0rs7eq (run); the provider wrapper command exit codes own delegated proof, not the lease lifecycle job's eventual cancellation.

  • pnpm build: passed on the final head in 423 seconds.
  • UI Vitest selection for chat and new-session: 435 files, 8,428 passed, 3 pre-existing WebKit cases skipped (129 seconds on the final head).
  • UI isolated selection: 23 files, 564 passed (21 seconds on the final head).
  • UI browser selection: 32 files, 324 passed (18 seconds on the final head); also repeated three times after the fixture repair.
  • UI E2E: the earlier full selection passed 82 files / 516 tests. The final rerun passed 81 files / 515 tests; the one remaining file stopped before page creation because this fresh lease lacked Playwright FFmpeg for its video fixture. After pnpm exec playwright install ffmpeg, the focused browser-talk-ordering.e2e.test.ts rerun passed (1 test; 14.66 seconds). All 516 selected tests therefore have passing final-head evidence.
  • node scripts/check-changed.mjs --base 66b812f26e725cd709e08860d2cb46ba496cd308: every typecheck, guard, format, i18n and dead-export stage passed. Whole-core lint failed only because unchanged src/tasks/task-registry-state.ts had 702 counted lines against 700 on this pinned base. That unrelated defect is already fixed on main by merged refactor: keep inbox and task state within lint limits #158684 (97d7de501fe, 698 lines); no duplicate fix was added. The required hosted CI gate passes (its lint report treats this pre-existing line-cap debt as advisory). Earlier old-base failures were cleared by their existing main fixes refactor(test): separate interrupted replay fixtures #158538 and fix(gateway): keep event lineage current across session lifetimes #158581. Scoped UI lint passes with zero warnings or errors.
  • Independent Codex review completed; no accepted actionable findings remain. Its sole final warning was rejected after checking the complete renderer: frameContent is an optional array, and opts.frameContent ?? repeat(...) never enters the ordinary action-row renderer when a frame is present; removing the nested frame guard preserves behavior. Earlier review passes were clean.
  • Before/after chat and new-session screenshots below come from an isolated real development Gateway with synthetic profile/session/transcript data. All four captures were inspected and delivered in the originating chat. The fixture intentionally has no model credentials or GitHub publication state; new-session's catalog label varies slightly during hydration.

The final build emits 369,712 B of startup JavaScript gzip, below the 371,332 B ceiling. Startup CSS remains above its existing advisory target (50,164 B versus 46,080 B), below its 51,200 B hard ceiling. No budget baseline was increased. The earlier isolated base/candidate comparison measured only +22 B startup JavaScript gzip, within the existing 64 B variance allowance, with identical CSS.

Commands and measured changed-test cost
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/pages/chat ui/src/pages/new-session ui/src/components/session-placement-move-dialog.test.ts ui/src/app/chat-attachment-handoff.test.ts ui/src/app/native-bridge.test.ts ui/src/pages/config/config-page.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts ui/src/pages/chat ui/src/pages/new-session
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-browser.config.ts ui/src/pages/chat ui/src/pages/new-session
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts ui/src/e2e/chat-flow. ui/src/e2e/new-session-page. ui/src/e2e/browser-talk- ui/src/e2e/browser-dictation-status. ui/src/e2e/chat-session-companion- ui/src/e2e/chat-header-session- ui/src/e2e/mobile-chat-session-menu. ui/src/e2e/chat-rail-columns.
pnpm test <file> --maxWorkers=1

Single-file test-runner wall time on the Testbox (seconds; each invoked through the last command above):

File Single-file runner wall (s) Hosted CI test duration (s)
chat-composer-recovery.test.ts 4.52 0.766
chat-content-column.browser.test.ts 4.66 4.822
chat-outbox-recovery.test.ts 2.17 0.641
chat-pane-browser-annotation-lifecycle.test.ts 2.65 0.508
chat-pane-stop.test.ts 2.72 0.433
chat-tool-cards.test.ts 2.53 1.140
chat-tool-cards.widget-prompts.test.ts 2.09 0.164
chat-view.plugin-identity.test.ts 2.41 0.085
device-placement.test.ts 1.63 0.019

The only new file adds one lifecycle regression using explicit deferred gates. The capability regression adds one row to an existing table. No real sleeps, retries, weaker assertions, worker pinning in configuration, or new serial suites were added. Hosted timing is the per-file Vitest diagnostic test duration from the successful exact-head CI run, excluding import, setup, and queue time; it is intentionally separate from single-file runner wall time.

Hosted CI is green for final head cdc057bb9fc267efd31017fd557fd1fe19bb3aa6; remote proof completed on lease tbx_01m3e5y6za8h139qhdyctjc3ab (run). Hosted CI on the preceding head exposed an unrelated Gateway assertion-chain violation and cancelled the remaining jobs; this head incorporates its existing main fix, 66b812f26e7. Both rebases preserve the exact refactor patch. All four embedded PR images were also loaded and rendered successfully in an isolated Chromium browser. All task-owned leases are stopped or expired. The working tree is clean, and this PR is left open for landing.

Inspected before/after captures

Chat before

Chat after

New session before

New session after

@clawsweeper

clawsweeper Bot commented Sep 26, 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.

@steipete
steipete marked this pull request as ready for review September 26, 2026 05:56
@steipete
steipete force-pushed the deslop/l69-ui-chat-third-pass branch from c37f776 to a3ad575 Compare September 26, 2026 06:03
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 3:22 AM ET / 07:22 UTC (Revision 3).

ClawSweeper review

What this changes

The branch consolidates chat and new-session rendering and state code, guards stale outbox recovery errors, and safely labels device capabilities.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main still lacks the two focused error-path repairs, and the broader Control UI cleanup remains distinct. The earlier storage-compatibility warning is not supported by the inspected record-format diff; this review found no actionable blocker.

Priority: P2
Reviewed head: cdc057bb9fc267efd31017fd557fd1fe19bb3aa6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct visual proof, focused regression coverage, and green exact-head CI support a normal good PR rating.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The changed chat and new-session renderers were exercised through an isolated development Gateway with synthetic sessions; inspected before/after screenshots show presentation parity. Focused tests cover the two error paths, which the screenshots do not show. The snapshot schema, fields, and serialization boundary are unchanged, so no stored-data migration is implicated.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The changed chat and new-session renderers were exercised through an isolated development Gateway with synthetic sessions; inspected before/after screenshots show presentation parity. Focused tests cover the two error paths, which the screenshots do not show. The snapshot schema, fields, and serialization boundary are unchanged, so no stored-data migration is implicated.
Evidence reviewed 9 items Repository identity: The checkout origin identifies the target repository.
Current-main outbox behavior: The asynchronous recovery catch publishes a storage error without checking whether the element or request generation has been retired.
Introduced outbox guard: The proposed catch checks generation and connection before publishing the error; the new test covers a delayed module-load failure after owner retirement.
Findings None None.
Security None None.

How this fits together

The Gateway supplies session facts, chat history, and replies to the browser Control UI. The chat and new-session pages turn those inputs and user actions into rendered conversations, Gateway requests, and locally retained drafts.

flowchart LR
A[User input] --> B[Chat and new-session pages]
C[Gateway session facts] --> B
B --> D{Current connection and session}
D --> E[Composer and transcript state]
E --> F[Gateway requests]
E --> G[Rendered chat and local drafts]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: ui/src/pages/chat/session-snapshot-store.ts, unknown-data-model-change: ui/src/pages/chat/session-snapshot-store.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the consolidated UI owners through the normal exact-head gates while preserving current-session checks and the existing browser storage format.

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

Yes for the two narrow failures: current-main source exposes stale outbox error publication and an inherited-property capability lookup. This read-only review did not execute the proposed regressions.

Is this the best way to solve the issue?

Yes. The patch reuses existing persistence, IndexedDB transaction, and capability-label owners without adding configuration or changing a stored format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 833face0415a.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This bounded Control UI cleanup includes two limited error-path repairs without evidence of an urgent user regression.
  • 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. Sufficient (screenshot): The changed chat and new-session renderers were exercised through an isolated development Gateway with synthetic sessions; inspected before/after screenshots show presentation parity. Focused tests cover the two error paths, which the screenshots do not show. The snapshot schema, fields, and serialization boundary are unchanged, so no stored-data migration is implicated.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed chat and new-session renderers were exercised through an isolated development Gateway with synthetic sessions; inspected before/after screenshots show presentation parity. Focused tests cover the two error paths, which the screenshots do not show. The snapshot schema, fields, and serialization boundary are unchanged, so no stored-data migration is implicated.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The changed chat and new-session renderers were exercised through an isolated development Gateway with synthetic sessions; inspected before/after screenshots show presentation parity. Focused tests cover the two error paths, which the screenshots do not show. The snapshot schema, fields, and serialization boundary are unchanged, so no stored-data migration is implicated.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-26T06:10:01.332Z sha a3ad575717a4a69ae0ac276ad03055b3b3a60bd5 :: blocked before merge. :: none
  • reviewed 2026-09-26T06:33:08.634Z sha cdc057b :: blocked before merge. :: none

Reuse composer persistence and lifecycle owners, consolidate rendering and transcript projections, and remove forwarding layers across chat and new-session. Preserve visual, accessibility, RPC, streaming, and persisted-preference contracts.

Also prevent stale outbox recovery errors after owner retirement, safely ignore inherited capability names, and make the content-column browser fixture independent of other tests. Both product regressions fail on the original source; the layout fixture passes 20 standalone runs and three complete browser shards on Testbox.
@steipete
steipete force-pushed the deslop/l69-ui-chat-third-pass branch from a3ad575 to cdc057b Compare September 26, 2026 06:19
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 26, 2026
@steipete
steipete enabled auto-merge (squash) September 26, 2026 07:33
@steipete
steipete merged commit 3dede6a into main Sep 26, 2026
150 checks passed
@steipete
steipete deleted the deslop/l69-ui-chat-third-pass branch September 26, 2026 07:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
Reuse composer persistence and lifecycle owners, consolidate rendering and transcript projections, and remove forwarding layers across chat and new-session. Preserve visual, accessibility, RPC, streaming, and persisted-preference contracts.

Also prevent stale outbox recovery errors after owner retirement, safely ignore inherited capability names, and make the content-column browser fixture independent of other tests. Both product regressions fail on the original source; the layout fixture passes 20 standalone runs and three complete browser shards on Testbox.
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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