Skip to content

refactor(ui): split chat composer - #113338

Merged
steipete merged 3 commits into
mainfrom
codex/split-chat-composer
Jul 24, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/split-chat-composer

Conversation

@steipete

@steipete steipete commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The chat composer had grown to 3,001 lines behind a grandfathered max-lines suppression, which made its state, interaction, and rendering ownership difficult to review safely. This is the maintainer-requested split of that file.

Why This Change Was Made

The existing implementation is extracted along its established responsibility seams: types/state, DOM sizing, goals, slash commands, queue/status, context usage, run controls, orchestration, and Lit markup. The public facade and single runtime path remain unchanged, every resulting module is under 650 lines, the max-lines suppression/baseline entry is removed, and the raw-copy i18n inventory is refreshed for the moved literals.

This is strictly behavior-neutral: rendering and interactions are byte-for-byte equivalent at the product boundary, with zero intended visual change. There are no before/after screenshots because any visual delta would be a failed split rather than evidence of success.

AI-assisted with maintainer-directed Codex execution. I reviewed the complete moved code and understand the resulting ownership boundaries.

User Impact

No user-visible behavior changes. Maintainers get smaller, focused modules without changing composer layout, text, keyboard handling, state transitions, voice/dictation behavior, queue controls, or context/status presentation.

Evidence

ClawSweeper rank-up moves

  • Current-main refresh: applied before prepare; the final patch is re-reviewed after each refresh.
  • Manual screenshot/recording proof: intentionally skipped by explicit maintainer direction for this zero-visual-delta refactor. The acceptance contract is unchanged DOM/interaction behavior backed by focused and full Control UI suites; a visual delta would be a defect, not a result to document. Peter explicitly ordered and authorized this refactor and its landing.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 24, 2026
@steipete
steipete marked this pull request as ready for review July 24, 2026 14:09
@steipete
steipete force-pushed the codex/split-chat-composer branch from 8d3daf4 to 41a79d7 Compare July 24, 2026 14:09
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 24, 2026, 10:14 AM ET / 14:14 UTC.

ClawSweeper review

What this changes

The PR breaks the web chat composer into focused state, rendering, controls, context, queue, status, slash-menu, and DOM helper modules while retaining the existing facade and removing its max-lines baseline exemption.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open for explicit maintainer handling: it carries the protected maintainer label, and the supplied evidence is automated/mock-only rather than a demonstrated after-fix Control UI interaction. The read-only terminal sandbox failed before repository commands could run, so this is a conservative routing verdict rather than a full source-level approval.

Likely related people: steipete is the proposer and stated reviewer of the refactor, but current-main ownership could not be independently traced in this review.

Priority: P3
Reviewed head: 41a79d75a2efdd475294969b370f92b1eaeaedef
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The refactor has focused automated validation, but real behavior proof is missing and the current merge result was not independently reviewed.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body supplies tests, changed-path checks, and autoreview, but no after-fix real Control UI interaction proof; add a redacted recording, screenshot sequence, terminal/live output, or runtime logs that exercise the composer, then update the PR body for a fresh review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body supplies tests, changed-path checks, and autoreview, but no after-fix real Control UI interaction proof; add a redacted recording, screenshot sequence, terminal/live output, or runtime logs that exercise the composer, then update the PR body for a fresh review.
Evidence reviewed 3 items Protected review routing: The PR has the maintainer label, which the repository review policy treats as requiring explicit maintainer handling rather than automated cleanup or closure.
Submitted validation evidence: The PR body reports focused composer/chat-view tests, a changed-path check on Testbox, and an autoreview, but does not include after-fix live UI output, a recording, screenshots, or runtime logs demonstrating the unchanged composer interaction path.
Patch scope: The supplied PR file list shows a composer facade reduced to orchestration plus new focused modules for state, DOM behavior, controls, context, queue, status, slash menu, and markup; no dependency, workflow, package, or credential files are listed.
Findings None None.
Security None None.

How this fits together

The Control UI chat composer combines the user's draft, session state, and gateway-run state into send controls, slash commands, queued messages, context information, and visible run status. This PR reorganizes that presentation and interaction layer while leaving the gateway and chat protocol paths unchanged.

flowchart LR
  Draft[User draft and actions] --> Composer[Chat composer facade]
  Session[Session and run state] --> Composer
  Gateway[Gateway browser client] --> Composer
  Composer --> Controls[Send and run controls]
  Composer --> Content[Context, queue, and slash menu]
  Controls --> ChatUI[Rendered Control UI chat]
  Content --> ChatUI
Loading

Decision needed

Question Recommendation
Should maintainers accept this large behavior-neutral Control UI refactor after reviewing the current merge result and a focused live composer interaction proof? Review and land after proof: Confirm the current merge result preserves composer interactions and accept the focused modular split if the live Control UI check is clean.

Why: The protected maintainer label requires explicit human handling, and the review environment could not complete the required current-main source and history inspection.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body supplies tests, changed-path checks, and autoreview, but no after-fix real Control UI interaction proof; add a redacted recording, screenshot sequence, terminal/live output, or runtime logs that exercise the composer, then update the PR body for a fresh review.
  • Resolve merge risk (P1) - The branch is behind current main, so the behavior-neutral claim should be refreshed against the current merge result before landing.
  • Resolve merge risk (P1) - The supplied evidence is automated only; it does not directly demonstrate an after-fix composer interaction in a real Control UI session.
  • Complete next step (P2) - Protected-label handling and missing real behavior proof require a maintainer review rather than automated repair or closure.
Agent review details

Security

None.

PR surface

Source +208, Other -1. Total +207 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 12 2655 2447 +208
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 13 2655 2448 +207

Review metrics

None.

Proof path suggestion

A short web UI chat interaction would directly verify the claimed behavior-neutral composer split across the user-visible controls and menus. Mantis is proof-only, so it must not be asked to change code or mutate GitHub state.
Use ClawSweeper's repair, apply, or automerge lanes for code changes, branch updates, labels, comments, PR repair, closes, or merges.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Review the exact merge result, then preserve the single composer facade while confirming one real Control UI flow covers typing, sending, slash-menu navigation, and run controls without a visual or interaction regression.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Review the exact merge result, then preserve the single composer facade while confirming one real Control UI flow covers typing, sending, slash-menu navigation, and run controls without a visual or interaction regression.

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

Not applicable: this PR is a behavior-neutral refactor, not a report of broken existing behavior. Its correctness instead depends on verifying unchanged Control UI interactions.

Is this the best way to solve the issue?

Unclear: the proposed seam-based split is plausible and removes the max-lines exception, but a complete comparison of callers, lifecycle cleanup, tests, and the current merge result was not possible after the read-only terminal sandbox blocked repository inspection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 07e3855b4656.

Labels

Label changes:

  • add P3: This is presented as a behavior-neutral maintainability refactor with no reported user-facing incident.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies tests, changed-path checks, and autoreview, but no after-fix real Control UI interaction proof; add a redacted recording, screenshot sequence, terminal/live output, or runtime logs that exercise the composer, then update the PR body for a fresh review.

Label justifications:

  • P3: This is presented as a behavior-neutral maintainability refactor with no reported user-facing incident.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies tests, changed-path checks, and autoreview, but no after-fix real Control UI interaction proof; add a redacted recording, screenshot sequence, terminal/live output, or runtime logs that exercise the composer, then update the PR body for a fresh review.

Evidence

What I checked:

  • Protected review routing: The PR has the maintainer label, which the repository review policy treats as requiring explicit maintainer handling rather than automated cleanup or closure. (41a79d75a2ef)
  • Submitted validation evidence: The PR body reports focused composer/chat-view tests, a changed-path check on Testbox, and an autoreview, but does not include after-fix live UI output, a recording, screenshots, or runtime logs demonstrating the unchanged composer interaction path. (41a79d75a2ef)
  • Patch scope: The supplied PR file list shows a composer facade reduced to orchestration plus new focused modules for state, DOM behavior, controls, context, queue, status, slash menu, and markup; no dependency, workflow, package, or credential files are listed. (ui/src/pages/chat/components/chat-composer.ts:1, 41a79d75a2ef)

Likely related people:

  • steipete: The PR body identifies maintainer-directed execution and states that steipete reviewed the moved code and resulting ownership boundaries; current-main feature history could not be independently inspected because the read-only terminal sandbox failed before commands ran. (role: proposed refactor author and stated code reviewer; confidence: low; commits: 41a79d75a2ef; files: ui/src/pages/chat/components/chat-composer.ts, ui/src/pages/chat/components/chat-composer-view.ts, ui/src/pages/chat/components/chat-composer-state.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted real Control UI evidence covering typing, sending, slash-menu interaction, and run controls.
  • Refresh the branch against current main and have the final merge result reviewed.

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
steipete force-pushed the codex/split-chat-composer branch 2 times, most recently from 1354d03 to b584dce Compare July 24, 2026 14:47
@steipete
steipete force-pushed the codex/split-chat-composer branch from b584dce to d2ac5b5 Compare July 24, 2026 15:00
@steipete
steipete merged commit 049a178 into main Jul 24, 2026
91 checks passed
@steipete
steipete deleted the codex/split-chat-composer branch July 24, 2026 15:11
@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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant