Repository navigation
refactor(ui): deslop chat page third pass - #158683
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
c37f776 to
a3ad575
Compare
|
Codex review: blocked before merge. Reviewed September 26, 2026, 3:22 AM ET / 07:22 UTC (Revision 3). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
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.
a3ad575 to
cdc057b
Compare
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.
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
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/componentsandui/src/libwere 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.tskeeps the sameJSON.stringify/JSON.parsesanitization boundary and the same strictrecordSchema; 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
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..chat/.chat-thread-innerstructure, 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.pnpm exec playwright install ffmpeg, the focusedbrowser-talk-ordering.e2e.test.tsrerun 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 unchangedsrc/tasks/task-registry-state.tshad 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.frameContentis an optional array, andopts.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.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
Single-file test-runner wall time on the Testbox (seconds; each invoked through the last command above):
chat-composer-recovery.test.tschat-content-column.browser.test.tschat-outbox-recovery.test.tschat-pane-browser-annotation-lifecycle.test.tschat-pane-stop.test.tschat-tool-cards.test.tschat-tool-cards.widget-prompts.test.tschat-view.plugin-identity.test.tsdevice-placement.test.tsThe 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 leasetbx_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