Skip to content

refactor(ui): deslop chat pages - #161173

Merged
steipete merged 2 commits into
mainfrom
deslop/l165-ui-chat
Sep 29, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l165-ui-chat

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The requested chat-only sweep removes remaining duplicated plumbing and unused presentation state after the recent UI cleanup passes.

User Impact

No intended user-visible change. Rendering, translation keys and strings, Gateway request/response shapes, streaming order, storage keys, accessibility, and keyboard shortcuts remain unchanged. No migration or configuration change is required.

Why This Change Was Made

The complete 442-file production sweep removed 407 net production lines (+329/-736 across 41 production files). The post-merge type-cycle repair described below adds five lines back, leaving 402 net production lines removed. Campaign classification: BELOW-THRESHOLD-PR-READY. All production files over 200 lines are recorded in the coverage log below, sorted by original size. The recent merged chat changes since September 18 and the latest UI pages pass were examined first; existing cleanup was preserved.

  • Share guarded slash-command patch settlement and the existing chat error setter; retire executor cases already owned by the dispatcher.
  • Pass the canonical pending composer snapshot through command recovery instead of remapping the same fields twice.
  • Let the composer view derive its display-only values and consume the menu owner's existing projection directly.
  • Remove unread input-history diagnostics and value-length plumbing while retaining key admission, draft recall, and caret behavior.
  • Remove unused workspace dock/collapse state and its toggle path; sidebar layout continues to own Files visibility. Header fixtures now model that actual owner.
  • Reuse media URL, authorization-header, and waveform-budget helpers instead of parallel implementations.
  • Compute immutable Google Live model facts once, centralize current-socket failure handling, and reuse the browser-safe abortable retry timer. Remove unused browser consult configuration forwarding; the Gateway remains its owner.
  • Remove the unreachable pending-tool-call limit: the same session-id bound already dominates it. The retained lifetime-limit test now exercises actual WebSocket messages instead of constructing impossible private state.
  • Reuse persistence signature/default projections and snapshot logging/timer cleanup; retain compare-and-set, incognito, attachment custody, and notification order.
  • Consolidate sharing ownership checks and route draft parsing, clone the plain split-layout state directly, and remove the unreachable split close-command branch. Discussion opening uses the existing activation/fitting owners.
  • Register the existing prefetch controller directly at its page owner and remove small local forwarding/cast redundancies.

Evidence

Pinned head: 8e244c00b8d9fcc0f6df2ee759fb898679186d9e; initial base: 1470a9bb092f29cfb9d184e41f9aee3362aecf08.

Blacksmith Testbox proof used verified source capsules and frozen dependencies. Full proof ran on lease tbx_01m3nv9wxb7njet1ct31ktm5s5 (run); final static checks used tbx_01m3pc16hqht7t1md791g4jd73 (run).

  • Full UI suite: 1,553 files; 23,986 tests passed, four skipped, 342.04 s (node scripts/run-vitest.mjs run --config ui/vitest.config.ts src).
  • pnpm ui:build: passed, 10.47 s; final export/controller follow-up build passed again in 12.92 s.
  • Four import-boundary files (fs-safe, Control UI, plugin/core, test-helper/extension): passed, 11.62 s.
  • All 15 initially changed test files passed individually with pnpm test <file> --maxWorkers=1; the required native-bridge fixture migration also passed all four tests, 4.08 s.
  • check-changed: passed, 636.01 s; eight selected test-type graphs, UI types, formatting, ratchets, i18n, all three dead-export scans, and lint.
  • 31/31 synthetic before/after screenshot pairs are byte-identical against the pinned base, with no masking or pixel tolerance. Same Chromium, origin, viewport, date, locale and fixtures on both sides. All pairs inspected and delivered in the originating chat; embedded below.
  • Prefetch/page lifecycle delta: two files passed in 6.83 s. The settings suite passed after making the unused exports private.
  • Independent managed Codex review: full candidate and final ownership delta scoped-clean through P2. git diff --check: passed.

The initial changed-check run correctly required shrinking the assertion baseline after removing a redundant assertion; the exact one-entry shrink is included. The next type run found one stale valueLength field in the native-bridge test fixture; that caller now uses the reduced input contract, with its assertions unchanged. The only adjacent production edit removes two now-unused export modifiers in the settings owner; settings normalization and persisted keys/values remain unchanged. No other page or library implementation changed.

The first screenshot run captured 26 identical pairs but three fixtures targeted the wrong presentation contracts: ordinary failed sends remain in the outbox, desktop Talk uses a different button label, and cross-origin SVG uses a compact attachment card. Corrected fixtures exercise /steer draft restoration, desktop Talk, and the intended SVG card; all five resulting pairs match. These were proof-fixture corrections, not product defects. The first managed-review attempt failed authentication without producing a verdict; the configured authenticated review route completed cleanly. Final gates also caught the unused setting exports and a side-effect-only constructor call. The exports are private and the page now explicitly registers its controller; the selected Testbox gates pass. No CI runs were dispatched or rerun.

Final hosted CI and post-merge repair

Auto-squash merged this head as 3a9edfe4350f258fe0d8c677e93d61857935c63a at 2026-09-29 12:02:02 UTC, before the exact-head hosted run completed. CI run 36565461697 finished with 103 successful jobs, 19 skipped jobs, and two failed jobs: check-additional-runtime-topology-architecture and its aggregate openclaw/ci-gate. All three UI test shards, all nine UI E2E shards, both real-Gateway UI E2E shards, the boundary checks, and build artifacts passed. No jobs were cancelled.

The architecture failure was introduced here, not inherited: reusing ChatAttachmentControlsProps in chat-attachment-reads.ts created a type-only cycle back through ChatAttachmentReadLifecycle. check-changed and the four boundary tests passed but did not catch this Madge contract. The coordinator repaired it directly on main in 77cbd9513ea8, restoring the local read-options shape and one-way dependency. The repair commit records zero Madge and runtime cycles, passing UI types and file lint, 29 passing attachment tests, and a clean P2 review. Both the merge and repair are verified ancestors of current main, and the repaired source was inspected. No duplicate fix PR was opened by this lane; the original CI run remains failed.

All 31 uploaded image pairs were verified rendering in the PR body and linked comment. This browser verification completed after the automatic merge; it is not claimed as pre-merge verification. All lane Testbox leases are stopped or completed, including the final lease tbx_01m3pc16hqht7t1md791g4jd73. No CI runs were dispatched or rerun.

Fixes Found Along the Way

No separate product defect or flaky-test fix is claimed. The Google Live test previously manufactured an unreachable overflow state; its real lifetime-limit coverage is retained at the WebSocket boundary.

Required production-file coverage log (all 194 files over 200 lines)

Chat sweep coverage — lane l165

Base: 1470a9bb092f29cfb9d184e41f9aee3362aecf08. All 442 production-file entries were read. The 194 files over 200 lines are sorted by their original size below. Recent merged chat commit/name-only diffs since September 18 and the 55 chat files in the latest UI pages sweep were reviewed before editing. Untouched files over 150 lines were examined first. No other page or ui/src/lib files changed. One native-bridge test caller drops the retired input field; two unused setting export modifiers are removed at their adjacent owner. All remaining production changes are inside chat.

Initial lines Production file Disposition
1039 ui/src/pages/chat/composer-persistence.ts READ — reuse existing snapshot argument defaults and one current-content signature projection. Preserve draft high-water fences, write/readback/notify order, captured owner checks, incognito retirement, durable recovery, and route-switch CAS.
783 ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts READ — Virtualizer owns row/scroll commits; anchoring gates correspond to observed races.
770 ui/src/pages/chat/composer-dictation.ts READ — Retain distinct press/hold, capture, and late-final owners; DOMException-only error mapping differs deliberately from broader Talk cancellation.
759 ui/src/pages/chat/chat-pane-history.ts READ — Native staged history and catalog cursors have different admission/order contracts; preserve both.
751 ui/src/pages/chat/components/chat-position-rail.ts READ — Rail windowing, focus and reader tracking use distinct state; no safe state collapse.
746 ui/src/pages/chat/components/chat-message-media.ts READ — Reused attachment href owner for cross-origin SVG classification.
738 ui/src/pages/chat/talk/gateway-relay.ts READ — Retain provider-relay cancellation/mark acknowledgement sequencing and pending tool result barriers; client-owned providers have different lifetimes.
732 ui/src/pages/chat/talk/session.ts READ — Removed dead forwarding of consultThinkingLevel/consultFastMode into transport context; Gateway owns consult configuration.
732 ui/src/pages/chat/components/chat-message-group.ts READ — Attribution/footer/action ownership differs by source and run grouping; shared render paths already central.
730 ui/src/pages/chat/components/chat-detail-panel.ts READ — File editor read/save/reload preserve operation generation, draft and editor identity.
728 ui/src/pages/chat/chat-state-refresh.ts READ — Catalog/store publication, scoped facts reads, and stale-owner fences each protect different asynchronous ownership; no safe policy merge.
725 ui/src/pages/chat/components/chat-composer.ts READ — Moved render-only projections to view; passed canonical menu projection intact instead of renaming/repacking it.
724 ui/src/pages/chat/run-lifecycle.ts READ — Active custody, exact terminal tombstones, abort replay, and session-row reconciliation have distinct contracts; retained.
724 ui/src/pages/chat/chat-send-delivery.ts READ — Durable versus memory admission, picker tail, native recovery, and ACK retirement remain separate observable phases.
724 ui/src/pages/chat/chat-command-executor.ts READ — Consolidated guarded patch success/failure settlement across model, thinking, verbose, and fast commands; removed unreachable dispatcher-owned new/reset/stop/clear cases and result actions.
715 ui/src/pages/chat/components/chat-transcript-projection.ts READ — Projection is already the single row dependency and recap owner; leaf options differ deliberately.
714 ui/src/pages/chat/components/chat-message-bubble.ts READ — Ordered assistant media and standalone tool results have distinct presentation contracts.
714 ui/src/pages/chat/chat-state-events.ts READ — Session events, terminal recovery, and foreground streaming are deliberately sequenced differently; retained.
710 ui/src/pages/chat/components/chat-composer-controls.ts READ — Distinct Talk, dictation, Stop and Send controls preserve pointer capture, keyboard hints and mobile action ordering.
710 ui/src/pages/chat/chat-pane-render.ts READ — Projection assembles distinct capability/attention/session owners; no sound bulk removal.
709 ui/src/pages/chat/talk/webrtc.ts READ — Retain GA item identity, response completion, and negotiated SDP/camera boundaries; merging with Google would obscure different wire contracts.
705 ui/src/pages/chat/components/chat-question-card.ts READ — One panel already owns draft updates, keyboard navigation, async submission fencing and blocking/nonblocking presentation.
705 ui/src/pages/chat/chat-pane-board.ts READ — Saved dashboard intent, provider leases, and async publication guards serve distinct lifecycle boundaries.
699 ui/src/pages/chat/components/chat-message-attachments.ts READ — Local permission metadata and managed artifact ticket resolvers enforce different contracts.
699 ui/src/pages/chat/chat-pane-lifecycle.ts READ — Event subscriptions and handoff ordering are owner-specific; retained creation/disposal ordering.
697 ui/src/pages/chat/components/chat-message-images.ts READ — Mounted decoded pixels, canonical slot handoff and gallery authorization have separate lifetimes.
696 ui/src/pages/chat/talk/google-live.ts READ — Compute immutable model facts once; deleted five repeated normalization/policy helpers; consolidate current-socket failure validation in failConnection.
687 ui/src/pages/chat/chat-outbox-owner.ts READ — Canonical gateway owner already merges durable/live/pane sources with version fencing; no duplicate owner to retire.
686 ui/src/pages/chat/components/chat-thread-interactions.ts READ — Search, selection and context portals preserve separate focus return and callback lifetimes.
685 ui/src/pages/chat/chat-page.ts READ — Instantiate SessionPrefetchController directly; lead removes installer wrapper.
677 ui/src/pages/chat/components/chat-composer-queue.ts READ — Queue ordering, hidden barriers, editing, focus and drag lifecycles are distinct observable contracts.
676 ui/src/pages/chat/components/chat-async-question.ts READ — History completion boundaries, durable dismissal and admission fences belong to one existing projection owner.
676 ui/src/pages/chat/chat-send-submit.ts READ — Removed both manual command-recovery snapshot adapters; ordinary and detached commands now pass PendingComposerSnapshot directly.
674 ui/src/pages/chat/components/chat-model-controls.ts READ — Current/default/runtime-pinned choices and auth projections have different provenance and cannot be collapsed safely.
672 ui/src/pages/chat/tool-stream.ts READ — Invocation sequence, review eviction, result precedence, and live rendering facts each have a concrete contract; retained.
666 ui/src/pages/chat/chat-outbox-drain.ts READ — FIFO, fresh active sends, explicit reset confirmation, and uncertain command barriers cannot share one undifferentiated drain path.
665 ui/src/pages/chat/route-loader.ts READ — Main/global/literal/short/catalog paths retain distinct canonicalization and cache authority.
665 ui/src/pages/chat/components/session-diff-panel.ts READ — Diff gap expansion revalidates snapshots; file/scoped menus already share render helpers.
664 ui/src/pages/chat/chat-pane-sharing.ts READ — Suggestion mutations differ in optimistic draft handling and ordering; typing timers own phased expiry.
664 ui/src/pages/chat/chat-composer-capability-host.ts READ — Retain config fingerprint, effective-tool cache and captured mutation scopes; each protects a different source of truth.
663 ui/src/pages/chat/components/chat-audio-player.ts READ — Use waveform budget owner directly; removed redundant decode wrapper.
662 ui/src/pages/chat/session-prefetch.ts READ — Expose the existing controller directly; remove constructor forwarding wrapper and migrate page/fixture callers.
661 ui/src/pages/chat/components/chat-composer-slash-menu.ts READ — Prior pass already shared menu rendering; command, argument and freeform paths retain distinct dispatch/focus contracts.
658 ui/src/pages/chat/components/chat-sidebar-region.runtime.ts READ — Hosted tab adapter preserves iframe roots and native focused-panel ownership.
657 ui/src/pages/chat/chat-pane-session-menu.ts READ — Shared session operations already canonical; header-specific owner fencing remains necessary.
655 ui/src/pages/chat/components/chat-composer-plus-menu.ts READ — Prior pass already shared menu rows and library adapter; capabilities retain independent authority and mutation rules.
655 ui/src/pages/chat/chat-pane-context.ts READ — Gateway transitions and roster publication have distinct retirement and hydration responsibilities.
652 ui/src/pages/chat/chat-view.ts READ — Retain transcript/composer/plugin assembly and selection ownership; props adapters add behavior and cannot be deleted.
652 ui/src/pages/chat/chat-pane-header.ts READ — Header workspace input now derives its type from createChatPaneRails, the live owner of collapse/toggle state; rendered controls unchanged.
651 ui/src/pages/chat/components/widget-card.ts READ — Canvas prompt ports, host frame keys and export activation each retain a named lifetime; no duplicate owner.
640 ui/src/pages/chat/history-merge.ts READ — Already one reducer publication owner; initial and delivered custody are distinct provenance states.
639 ui/src/pages/chat/chat-state-page.ts READ — Factory and handlers own presentation-specific side effects; #159549 already removed prior duplication.
633 ui/src/pages/chat/components/chat-composer-view.ts READ — Owns render-only projections directly; context no longer repeats selected session, permission/context templates or menu fields.
632 ui/src/pages/chat/chat-thread-build.ts READ — Canvas, stream, custody, and working-indicator placement share bounds but need distinct causality and retention rules.
627 ui/src/pages/chat/chat-state-controller.ts READ — Read lifecycle, render lifecycle, privacy review, and scroll invalidation have independent owners; retained.
624 ui/src/pages/chat/chat-pane-base.ts READ — Reactive state and async lifecycle fields are live across the class chain.
616 ui/src/pages/chat/talk/shared.ts READ — Removed unused consult configuration fields from local response/context types; keep existing bounded consult wait/error semantics.
604 ui/src/pages/chat/chat-thread-items.ts READ — Helpers own different identities/timestamps and boundary policies; superficially similar insertion routines differ on user ceilings.
599 ui/src/pages/chat/chat-session.ts READ — #159549 unified setting patch dispatch; model recovery has separate ownership semantics.
593 ui/src/pages/chat/components/chat-session-workspace.ts READ — Removed dead collapse toggle and writes overridden by sidebar rails.
584 ui/src/pages/chat/stream-causal-boundary.ts READ — Persisted steer, commentary, and cumulative tails preserve different byte/sequence constraints; retained.
581 ui/src/pages/chat/chat-pane-session.ts READ — Catalog transcript conversion and cursor exhaustion differ from native history contract.
577 ui/src/pages/chat/chat-pane-retained-presentation.ts READ — Queued edits, composer custody, reset confirmation and progress retention have separate lifecycles.
575 ui/src/pages/chat/components/chat-tool-cards.ts READ — Tool display differs from accessibility full paths and plugin surfaces; shared content owner already reused.
571 ui/src/pages/chat/chat-pane-active-resources.ts READ — Desktop/browser discovery share reconciliation but intentionally use different live evidence.
566 ui/src/pages/chat/components/chat-sidebar-content.ts READ — MIME-specific preview branches retain their different media and security contracts.
564 ui/src/pages/chat/stream-reconciliation.ts READ — Terminal replacement, materialization, and history replacement enforce different causal ownership; retained.
549 ui/src/pages/chat/components/chat-model-picker.ts READ — Prior pass already simplified picker; provider ordering, unavailable reset targets and search keyboard behavior retain separate rules.
544 ui/src/pages/chat/chat-tool-activity-coalesce.ts READ — Invocation normalization and precedence already converge into a single registry; remaining cache/interleaving work is required.
540 ui/src/pages/chat/chat-thread-grouping.ts READ — Message grouping, completed-work disclosure, and activity rollups have distinct boundaries; retained.
533 ui/src/pages/chat/components/chat-attachments.ts READ — File intake, large paste, browser annotations and in-flight read slots have different admission and removal contracts.
532 ui/src/pages/chat/chat-pane-task-suggestions.ts READ — Accept/dismiss settle differently; callbacks retain request and display authority separately.
527 ui/src/pages/chat/chat-commands.ts READ — Removed duplicate error-state setter and reused canonical setChatError; dispatcher remains sole owner of new/reset/stop/clear actions.
521 ui/src/pages/chat/components/chat-tool-content.ts READ — Command, diff and generic output preserve different auditable inputs; shared blocks already factored.
517 ui/src/pages/chat/chat-send-queue-state.ts READ — Queued admission and retry classification retain transport uncertainty and live authority; existing shared helpers are already used.
510 ui/src/pages/chat/chat-gateway.ts READ — Aborted/error/final paths share publication owner while preserving different visible partial/diagnostic semantics.
505 ui/src/pages/chat/components/chat-message-text.ts READ — Streaming fragment promotion and media-slot ownership preserve reader DOM and cannot collapse.
502 ui/src/pages/chat/components/chat-pane-header.ts READ — Prior pass already unified action descriptors; parent identity and workspace menus remain distinct.
496 ui/src/pages/chat/chat-pane-session-controls.ts READ — Prior pass owns settings consolidation; permission observation and abort authority remain distinct.
495 ui/src/pages/chat/chat-thread.ts READ — Stable item identity, live fast path, and disclosure cache require explicit comparisons and invalidation; prior pass kept intact.
487 ui/src/pages/chat/components/chat-composer-dom.ts READ — Geometry observers preserve native editing, scroll intent and scrollbar bounds; replacing them with queue sizing changes behavior.
485 ui/src/pages/chat/chat-session-companion.ts READ — Thread revisions, reset receipts, and attachment custody preserve concurrent edit/answer ordering.
481 ui/src/pages/chat/chat-goals.ts READ — Retain durable operation receipts and expired-operation reconciliation; simplification would alter recovery or authority.
470 ui/src/pages/chat/chat-realtime.ts READ — Camera enable/switch and voice replacement have different failure/consent lifecycles; no safe mechanical merge.
469 ui/src/pages/chat/components/chat-ci-details.ts READ — Gateway owns CI data; visible polling and expansion lifecycle serve different scopes.
469 ui/src/pages/chat/components/browser-tab-card.ts READ — Thumbnail revision and page-preview connection scopes intentionally invalidate independently.
468 ui/src/pages/chat/session-snapshot-store.ts READ — reuse the database owner's identical debug logger, consolidate debounce timer cleanup, and remove an impossible JSON serialization fallback around schema-validated scalar metadata. Preserve metadata schemas, retention limits, generation/revision fences, weak hydration ownership, and transaction order.
463 ui/src/pages/chat/chat-avatar.ts READ — Retain per-agent and per-sender lease/cache ownership and current-result fences; prior pass already removed redundant projections.
461 ui/src/pages/chat/components/chat-composer-mention-menu.ts READ — Directory snapshots, refresh deduplication and selected-token lifetimes are already one owner.
456 ui/src/pages/chat/components/chat-header-session-menu.ts READ — Previous pass centralized management actions; remaining branches are distinct compact views.
455 ui/src/pages/chat/chat-history-hydration.ts READ — Delta and full snapshots differ in retained history, run adoption, and stream pruning; retained.
444 ui/src/pages/chat/chat-history-request.ts READ — Shared read consumers, staged prefetch, and foreground requests have deliberately different generation contracts.
440 ui/src/pages/chat/components/chat-message-attachment-availability.ts READ — Reuse media header owner; retain checked ticket renewal, expiry and auth recovery lifecycles.
439 ui/src/pages/chat/components/chat-transcript-offset-observer.ts READ — Native input, layout correction and programmatic scrolling require distinct provenance.
437 ui/src/pages/chat/chat-pane-session-observation.ts READ — Parent and selected observations have different ownership and invalidation effects.
426 ui/src/pages/chat/chat-pane-sharing-actions.ts READ — Consolidated repeated post-await sharing ownership checks in ownsSessionSharing.
424 ui/src/pages/chat/talk/conversation.ts READ — Retain separate verbatim assistant and heuristic user text merging, immutable entry projection, bounds and provider order handling.
424 ui/src/pages/chat/chat-pending-inputs.ts READ — Display browsing and live custody must remain independent; page, receipt, and queue reconciliation are not duplicates.
421 ui/src/pages/chat/stream-segment-pruning.ts READ — Shared accumulated-prefix pruning already serves retirement paths; remaining commentary handoff keeps exact occurrence ownership.
417 ui/src/pages/chat/tool-stream-status.ts READ — Compaction, fallback, and approval states have different completion timers and replay contracts.
416 ui/src/pages/chat/components/chat-composer-context.ts READ — Prior pass already reduced cost parsing; latest-run cost and historical provider lookups intentionally stop at different boundaries.
415 ui/src/pages/chat/session-message-cache.ts READ — derive cache host/target types from the canonical snapshot-key function. Keep immutable weight caching, duplicate event claims, raw sequence boundaries, pagination, and eviction ownership.
413 ui/src/pages/chat/components/chat-camera-capture.ts READ — Generation-fenced camera permission, encoding, review and close lifecycles preserve captured destinations.
412 ui/src/pages/chat/components/chat-transcript-message-index.ts READ — Live text patches reuse immutable structural indexes; rebuilding or flattening loses cache contracts.
411 ui/src/pages/chat/chat-send-composer.ts READ — Command recovery now retains and restores canonical PendingComposerSnapshot, deleting its separately renamed draft shape and reverse adapter.
406 ui/src/pages/chat/components/chat-session-sharing.ts READ — Owner row and mutable member rows differ; public share and visibility keep separate authorization.
394 ui/src/pages/chat/chat-history-stream.ts READ — In-flight adoption compares exact run projection generations; terminal and active snapshot cases are intentionally distinct.
386 ui/src/pages/chat/chat-pane-embedded-panels.ts READ — #159549's descriptor owner already consolidates panels; retained transport-specific props.
382 ui/src/pages/chat/talk/input.ts READ — Retain browser-specific DOMException/error treatment and separate camera/input cleanup precedence; discovery already unified.
377 ui/src/pages/chat/chat-pane-attachment-handoff.ts READ — Live cross-region composer custody differs from persisted pane handoff; do not merge.
375 ui/src/pages/chat/talk/transcript-owner.ts READ — Replace private abortable timer implementation with existing browser-safe @openclaw/retry sleepWithAbort while preserving attempt schedule and owner AbortError text.
371 ui/src/pages/chat/components/chat-session-workspace-rail.ts READ — Prior pass already shares file row renderer; session paths and browser paths have distinct origins.
369 ui/src/pages/chat/components/chat-pull-requests.ts READ — Publication recovery and branch facts differ from PR receipts; shared rows already reused.
368 ui/src/pages/chat/chat-page-retained-sessions.ts READ — Stable Lit slots, queued-edit retention, preview retirement and route authority all necessary.
367 ui/src/pages/chat/scroll.ts READ — Retain reader takeover, smooth-follow and history anchor ownership; branches cover independent scroll sources.
367 ui/src/pages/chat/components/chat-effort-picker.ts READ — Prior pass already simplified effort rows; slider previews and asynchronous commits have separate lifetimes.
362 ui/src/pages/chat/components/chat-sidebar-file-view.ts READ — Prior pass factored shared actions and search buttons; editor/preview controls differ.
360 ui/src/pages/chat/components/chat-task-suggestions.ts READ — Acceptance and repository recovery are separate states; bidi helper has no equivalent UI owner.
353 ui/src/pages/chat/chat-history-state.ts READ — Common history ownership and error setters are canonical; reused setChatError from command dispatch.
350 ui/src/pages/chat/chat-outbox-receipts.ts READ — Positive custody, consumption, and lifecycle evidence authorize different actions; retained.
343 ui/src/pages/chat/components/chat-selection-popup.ts READ — Toolbar and editor share popup positioning/lifetime; selection capture and editing retain distinct focus behavior.
341 ui/src/pages/chat/components/chat-session-rail.ts READ — Prior pass moved composer ownership; remaining digest and companion thread rendering are distinct.
337 ui/src/pages/chat/chat-page-pane-render.ts READ — Pending creation and chat pane have different element/lifecycle contracts; no forwarding-only layer.
331 ui/src/pages/chat/chat-pane-session-creation.ts READ — Recover/create/reset require different write access, lifecycle and attachment handoff.
331 ui/src/pages/chat/chat-pane-placement.ts READ — Composer and menu controls are distinct views of shared placement facts.
329 ui/src/pages/chat/components/session-diff-menus.ts READ — Scope, sync, file and view menus express distinct actions and existing shared menu lifecycle.
327 ui/src/pages/chat/chat-provider-review-controller.ts READ — Retain acknowledgment, continuation and roster refresh states; distinct terminal recovery and authority contracts.
325 ui/src/pages/chat/chat-history-subscription.ts READ — Replacement acquire/release, detached cleanup, and release-recovery each preserve owned handles; retained.
324 ui/src/pages/chat/chat-send-support.ts READ — Delivery consumption and retained display bytes are separate responsibilities already composed through canonical owners.
319 ui/src/pages/chat/durable-composer-persistence.ts READ — no further sound consolidation. #159549 already simplified restore projection; remaining baseline/current checks and independent attachment hydration protect CAS and teardown.
317 ui/src/pages/chat/components/chat-github-publication.ts READ — Selection, accepted request and confirmation controls retain explicit different authority states.
316 ui/src/pages/chat/chat-history-actions.ts READ — Reset, rewind, and branch switch differ in destruction, composer restoration, and uncertainty; retained.
315 ui/src/pages/chat/components/chat-comment-controller.ts READ — One controller already owns mutations and editor authority across transcript replacements.
315 ui/src/pages/chat/chat-progress.ts READ — Retain queued-send, compaction and watched-run projections; their timing/provenance inputs differ.
315 ui/src/pages/chat/chat-pane-layout-render.ts READ — Layout workspace input now derives its type from createChatPaneRails, eliminating reliance on removed dead base workspace collapse/toggle fields; runtime rendering unchanged.
308 ui/src/pages/chat/talk/webrtc-support.ts READ — Retain bounded SDP reader, stale-offer fencing, response identity admission, and typed provider-event adapters.
306 ui/src/pages/chat/components/chat-composer-skill-menu.ts READ — Prior pass already uses canonical composer menu; skill refresh generations differ from slash invocation retention.
303 ui/src/pages/chat/components/chat-attachment-file-icon.ts READ — One data table owns family/accent/asset selection; presentation mappings are distinct and consumed.
298 ui/src/pages/chat/chat-pane-placement.runtime.ts READ — Move/recover/reclaim share intent but different expected state and error reconciliation; preserve.
297 ui/src/pages/chat/components/chat-model-picker-options.ts READ — Model and target options carry different selection/runtime/auth and accessibility contracts.
295 ui/src/pages/chat/chat-view-notices.ts READ — Retain distinct notice presentation and source/display error copies; shared card extraction would mostly move markup.
293 ui/src/pages/chat/sidebar-layout.ts READ — Layout operations already use structuredClone; no competing render owner.
290 ui/src/pages/chat/talk/audio.ts READ — Retain PCM conversion, smoothing and playback bounds; media-core base64 estimate treats whitespace differently so substitution would change behavior.
290 ui/src/pages/chat/components/session-discussion-panel.ts READ — Source-generation guard protects automatic opening; embed theme and origin checks remain necessary.
289 ui/src/pages/chat/components/chat-model-account-control.ts READ — Inventory generation, account paging and selection ownership are already unified.
285 ui/src/pages/chat/components/chat-session-workspace-state.ts READ — Removed dead dock/collapsed store and unreachable nonglobal agent fallback.
285 ui/src/pages/chat/components/chat-model-picker-search.ts READ — One DOM projection owns ranking, visibility, keyboard IDs and highlight restoration.
284 ui/src/pages/chat/chat-send-actions.ts READ — Explicit retry identity and reorder segment barriers preserve immutable Goal/transport ownership.
281 ui/src/pages/chat/chat-pane-sidebar-layout.ts READ — Lazy registration and stale-chunk error ownership are meaningful; callbacks own panel-specific cleanup.
280 ui/src/pages/chat/components/chat-message-stream.ts READ — Stream and work group presentations preserve separate live/footer and prepared-activity semantics.
278 ui/src/pages/chat/components/chat-transcript-geometry.ts READ — Row measurement, initial offset and rail gutter have separate browser geometry responsibilities.
277 ui/src/pages/chat/components/chat-clawhub-card.ts READ — Catalog and local-plugin image scopes are already owned by shared PluginIconController.
276 ui/src/pages/chat/chat-agent-run-grouping.ts READ — Retain causal frame segmentation and explicit final-answer ownership; recent fixes cover non-interchangeable boundaries.
275 ui/src/pages/chat/components/chat-attachment-reads.ts READ — Attempted controls-type reuse introduced a type-only import cycle; post-merge repair restores a local read-options contract to keep dependencies one-way. No further safe simplification retained here.
272 ui/src/pages/chat/components/chat-html-preview-element.ts READ — Sandbox generation and document binding preserve revocation and retry ownership.
272 ui/src/pages/chat/chat-history.ts READ — In-flight coalescing and reconnect transfer carry versioned intent; no redundant flow remains.
269 ui/src/pages/chat/components/chat-message-image-loading.ts READ — Reused media authentication header and resource-base-path owners.
267 ui/src/pages/chat/components/chat-transcript-feed.ts READ — Feed intentionally renders flattened, redacted task content distinct from interactive transcript.
266 ui/src/pages/chat/components/chat-composer-emoji.ts READ — Token anchor, undoable insertion, dismissal intent and repeated Enter handling each protect distinct editing behavior.
265 ui/src/pages/chat/chat-pane-shared.ts READ — Handoffs and keyboard routing serve live callers; catalog string extraction lacks equivalent canonical multi-key helper.
263 ui/src/pages/chat/components/chat-text-attachment.ts READ — Text, Markdown and HTML readers preserve ticket continuity and different rendering policy.
262 ui/src/pages/chat/components/chat-media-source.ts READ — Single owner for renewed media tickets, preparation and playback restoration.
261 ui/src/pages/chat/split-layout.ts READ — Replaced hand-written clone with structuredClone; removed unreachable close-command helper branch (page lifecycle owner closes panes).
257 ui/src/pages/chat/components/chat-video-player.ts READ — Existing media controller owns source state; viewport and first-frame state are independent.
255 ui/src/pages/chat/chat-pane-side-panels.ts READ — Companion focus and rail visibility own separate effects; observer wrapper also serves app/bootstrap outside lane.
251 ui/src/pages/chat/outbox-payloads.ts READ — no further sound consolidation. Send and handoff have deliberately different Blob allocation/copy contracts; admission is rechecked after each awaited ownership transfer.
251 ui/src/pages/chat/chat-queue.ts READ — no deletion. Thin adapters still resolve canonical scope, encode nullable outcomes, or retire shared payload ownership; exported queue functions have production callers.
250 ui/src/pages/chat/components/chat-message-media-markdown.ts READ — Media slot relocation and streaming node continuity preserve reader controls.
247 ui/src/pages/chat/components/chat-welcome.ts READ — Welcome selection intentionally differs from sidebar pin sorting and channel-origin inclusion.
247 ui/src/pages/chat/components/chat-composer-goal.ts READ — Goal timer and action rendering already share owners; ref and all-pane cleanup are both needed.
240 ui/src/pages/chat/components/chat-message-confirmation.ts READ — Portaled rewind confirmation preserves viewport placement, focus and persisted preference.
239 ui/src/pages/chat/components/chat-picker-overlay.ts READ — Document listener refcounts, nested dismissal and pointer-restored focus are one shared lifecycle.
238 ui/src/pages/chat/chat-history-snapshot.ts READ — Snapshot identity, pagination retention, and cursor clearing are separate cache operations.
236 ui/src/pages/chat/chat-outbox-recovery.ts READ — Recovery requires explicit scoped confirmation and unchanged durable destination; rendered structure retained.
236 ui/src/pages/chat/chat-composer-memory-fallback.ts READ — no change. Merging unresolved scopes must retain sequence ordering, committed/latest revision distinction, and shared attachment custody; proposed shortcuts would alter those decisions.
234 ui/src/pages/chat/components/chat-composer-types.ts READ — Public internal composer contract is shared by chat/new-session callers; state types already compose slash and skill owners.
233 ui/src/pages/chat/components/chat-svg-attachment.ts READ — Bounded SVG fetch and retained Blob URL implement different preview/lightbox lifetime.
231 ui/src/pages/chat/chat-send-timing.ts READ — Each timing source has different clocks and admission; telemetry shape retained.
230 ui/src/pages/chat/chat-pane-session-panel-toggle.ts READ — Terminal queue differs from lazy panel delivery; current owner checks protect deferred events.
229 ui/src/pages/chat/input-history.ts READ — Remove unread diagnostic fields and value-length echo; preserve handled/default/caret results and all recall gates.
226 ui/src/pages/chat/chat-page-navigation.ts READ — Actual close command goes through closeSplitPane; split/focus helper remains live.
225 ui/src/pages/chat/talk/google-live-tools.ts READ — Remove unreachable pending-call capacity guard already dominated by the same-sized lifetime identity set.
224 ui/src/pages/chat/components/chat-session-workspace-preview.ts READ — Concurrent alias reads preserve draft/editor identity with explicit read ordering.
220 ui/src/pages/chat/components/file-editor-view.ts READ — CodeMirror adapter preserves exact source bytes, logical lines and edit/wrap compartments.
216 ui/src/pages/chat/chat-tool-icon-controller.ts READ — Untouched-first: canonical PluginIconController already owns URL lifecycle, while chat owns effective-tool inventory and stale session fences.
215 ui/src/pages/chat/components/chat-message-timestamp.ts READ — Relative footer and detailed tooltip formats intentionally differ; metadata aggregation is unique.
213 ui/src/pages/chat/components/chat-attachment-card.ts READ — Compact wrapper owns clickable-card behavior; header centralizes download/open metadata with distinct link/button semantics.
213 ui/src/pages/chat/chat-thread-inputs.ts READ — Pending/canonical/local inputs already converge in one ordering owner; current predecessor/ceiling rules retained.
210 ui/src/pages/chat/chat-settings-patches.ts READ — Retain per-session patch tail and shared predecessor receipts; global/default alias admission has distinct contracts.
207 ui/src/pages/chat/attachment-payload-store.ts READ — no change. #159549 already removed the discard forwarding helper; remaining Blob/data-URL/preview/poster operations have distinct ownership and restoration contracts.
205 ui/src/pages/chat/components/chat-permission-picker.ts READ — Shortcut and click inputs share selection owner; mode gating and i18n unchanged.
204 ui/src/pages/chat/components/chat-voice-activity.ts READ — Meter element owns signal subscription and history; talk status semantics differ from dictation callouts.
202 ui/src/pages/chat/components/chat-pane-placement.ts READ — Action rows already use descriptors; worker startup and reconciliation states retain distinct copy.
201 ui/src/pages/chat/components/chat-transcript-session.ts READ — Per-session overscan and delayed row measurements have independent cancellation lifetimes.
Changed-test wall times on Testbox (one worker)
File Wall seconds
ui/src/pages/chat/chat-pane-attachment-handoff.test.ts 5.529
ui/src/pages/chat/chat-pane-panel-toolbar.test.ts 5.428
ui/src/pages/chat/chat-pane-parent-session.test.ts 3.301
ui/src/pages/chat/chat-pane-session-access.test.ts 2.965
ui/src/pages/chat/chat-pane-session-menu.test.ts 3.755
ui/src/pages/chat/chat-pane-terminal.test.ts 2.910
ui/src/pages/chat/chat-send.test.ts 3.509
ui/src/pages/chat/chat-state.test.ts 3.572
ui/src/pages/chat/chat-view.test.ts 5.253
ui/src/pages/chat/components/chat-audio-waveform.test.ts 1.742
ui/src/pages/chat/components/chat-header-session-menu.test.ts 5.323
ui/src/pages/chat/components/chat-pane-header.test.ts 3.642
ui/src/pages/chat/components/chat-session-workspace-rail.test.ts 2.812
ui/src/pages/chat/split-layout.test.ts 1.418
ui/src/pages/chat/talk/google-live.test.ts 1.988
ui/src/app/native-bridge.test.ts 4.082

Exact-head hosted UI test-step wall times: shard 1/3 342 s, shard 2/3 302 s, shard 3/3 248 s; all passed. These are shared shard costs, not individual file timings.

First 16 inspected, pixel-identical before/after pairs

chat-capability-menu: before left, after right

chat-command-failure: before left, after right

chat-command-success: before left, after right

chat-composer: before left, after right

chat-composer-effort: before left, after right

chat-discussion: before left, after right

chat-empty-composer: before left, after right

chat-image-attachment: before left, after right

chat-input-history: before left, after right

chat-mention-menu: before left, after right

chat-model-picker: before left, after right

chat-pasted-text: before left, after right

chat-permissions: before left, after right

chat-route-draft: before left, after right

chat-sharing-menu: before left, after right

chat-split-view: before left, after right

Additional screenshot pairs: #161173 (comment)

Reuse chat command, composer, sidebar, media, and persistence owners; remove unread diagnostics and dead forwarding state. Preserve rendered output, RPC and storage contracts, streaming order, accessibility, and keyboard behavior.
@clawsweeper

clawsweeper Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

Copy link
Copy Markdown
Contributor Author

The remaining 15 inspected, byte-identical before/after pairs for this chat refactor. Baseline is on the left; candidate is on the right. Synthetic fixtures only.

chat-skills-menu: before left, after right

chat-slash-menu: before left, after right

chat-side-chat: before left, after right

chat-workspace-files: before left, after right

chat-file-preview: before left, after right

chat-camera-user: before left, after right

chat-camera-environment: before left, after right

chat-audio-waveform: before left, after right

chat-local-image: before left, after right

chat-managed-thumbnail: before left, after right

chat-restored-attachment-draft: before left, after right

chat-talk-connecting: before left, after right

chat-talk-listening: before left, after right

chat-talk-transcripts: before left, after right

chat-remote-svg: before left, after right

@steipete
steipete marked this pull request as ready for review September 29, 2026 12:01
@steipete
steipete merged commit 3a9edfe into main Sep 29, 2026
71 of 74 checks passed
@steipete
steipete deleted the deslop/l165-ui-chat branch September 29, 2026 12:02
steipete added a commit that referenced this pull request Sep 29, 2026
chat-attachment-controls.types.ts imports ChatAttachmentReadLifecycle from
chat-attachment-reads.ts, and #161173 made chat-attachment-reads.ts import
ChatAttachmentControlsProps back, so `pnpm check:madge-import-cycles`
(check:architecture) fails on main for every PR. The reads module only
needs readSignal, attachmentLimits and uploadConfig; declare that
parameter type locally so the dependency runs one way. Type-only change.

Proof: madge 0 cycles (was 1), runtime import cycles 0, pnpm tsgo:ui,
CI oxlint on the file, chat-attachments + chat-attachment-inputs tests
(29 passed), autoreview P2 clean.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
Reuse the existing chat command, composer, sidebar, media, voice, and persistence owners. Remove unread input-history diagnostics, unused workspace presentation state, and forwarding code while preserving rendered output, RPC and storage contracts, streaming order, accessibility, and keyboard behavior.

The sweep removes 407 net production lines. Validate with the full UI suite, UI build, import-boundary tests, changed checks, independent review, and 31 byte-identical synthetic screenshot pairs. Preserve the complete reading coverage and test evidence in the PR.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
chat-attachment-controls.types.ts imports ChatAttachmentReadLifecycle from
chat-attachment-reads.ts, and openclaw#161173 made chat-attachment-reads.ts import
ChatAttachmentControlsProps back, so `pnpm check:madge-import-cycles`
(check:architecture) fails on main for every PR. The reads module only
needs readSignal, attachmentLimits and uploadConfig; declare that
parameter type locally so the dependency runs one way. Type-only change.

Proof: madge 0 cycles (was 1), runtime import cycles 0, pnpm tsgo:ui,
CI oxlint on the file, chat-attachments + chat-attachment-inputs tests
(29 passed), autoreview P2 clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant