Repository navigation
improve(ui): Ask in side chat stages selection comments - #160747
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 9:47 PM ET / September 29, 2026, 01:47 UTC (Revision 8). ClawSweeper reviewWhat this changesSelecting transcript text for Side chat now opens the shared comment editor and sends the staged comment and passage as bounded context with one question. Merge readiness✅ Ready for maintainer review Keep open: the requested workflow is absent from current main, and this branch remains a distinct, well-supported contribution. No blocking defect was established in the reviewed head. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI turns selected transcript text into a Side chat question. The Gateway checks the target session, sends temporary context to the utility model, and retains the question and answer. flowchart LR
A[Selected transcript text] --> B[Shared comment editor]
B --> C[Side chat draft and comment]
C --> D[Bounded ask request]
D --> E[Gateway session checks]
E --> F[Utility model prompt]
F --> G[Answer and retained question]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +146, Tests +304, Docs +2, Other +4. Total +456 across 28 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Provide one shared selection editor for main chat and Side chat, with bounded request-only context, correctable size errors, and a visible quote-only fallback for passages that cannot fit. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this is a UX addition. Current-main source and the before screenshot establish the existing quote-only flow. Is this the best way to solve the issue? Yes. Reusing the existing selection editor and Side chat request avoids sending text through its image-only attachment path, while keeping the added context bounded and temporary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4ddd0e33973e. 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 (7 earlier review cycles)
|
|
Addressed all four P2 findings and the three Rank-up moves in the latest ClawSweeper review.
Validation: 15 browser scenarios, 65 UI/shared-editor tests, and 100 Gateway/protocol tests passed. The four added browser cases and blank-question unit test failed before the repair. Gateway coverage verifies the selected text and comment reach the current model prompt, do not enter retained exchanges, and do not leak into the next ask. Fresh Codex autoreview: no P0 findings in the complete candidate. The repair moves admission into Dependency/owner review: personally checked Codex After a real merge conflict with #160071, rebased and preserved its aggregate file-frame admission, including pending reads and replacement byte exclusion. Current head 13c42b9e7bec adds a focused integration test: overflowing replacement stays correctable; equal-size replacement succeeds without double-counting the original. Post-rebase: 124 UI/shared-editor unit cases and all 15 browser scenarios passed; fresh screenshots were inspected. UI production and test types, generated Swift protocol check, lint, and max-lines/environment ratchets (476/476) passed. The final required-options signature cleanup passed 24 focused controller/preview cases. Fresh integrated-candidate autoreview found no P0 findings. Hosted CI is rerunning on the updated head. Attached comparison: original PR on the left, repaired editor on the right. The video shows rejecting an oversized edit, correcting it, and submitting. Captures use the actual UI with a mock Gateway and synthetic text; no real provider response is claimed. oversized-edit.mp4ClawSweeper revisions 4 and 5 test-cost request addressed: the PR body now includes measured single-worker command wall, per-file test time, and linked exact-head CI seconds for all eight changed tests. All 175 local cases and their five owning CI jobs passed. The browser cost and need for real selection/editor/mobile/reload/request-wiring coverage are explained; CI metric limitations are explicit. No requested Rank-up move remains unaddressed. CI infrastructure follow-up — hosted fallback boundary capacity: recovery run 36502811818 completed all product tests, including iOS, but its plugin boundary job was marked cancelled after exceeding the 20-minute job limit. Its log records all 125 compiles and the negative canary passing; preparation took 269.823s and compilation 874.142s, with checkout/setup taking the job to 20m27s. The manual hosted route admits two compiler workers. The existing ordinary PR route assigns the 32-class runner for cold compilation headroom; the prior PR boundary job passed in 410s. Recovery retriggers ordinary PR CI through draft → ready on unchanged Recovery update: a delayed ordinary PR run, 36502871660, had attached to the same head. Its boundary job passed on Final landing gate: exact-head normal CI passedThe fresh normal PR CI run 36508838785 completed successfully on |
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
c890a59 to
13c42b9
Compare
|
Merged via squash.
|
) * improve(ui): stage selected-text comments in side chat Co-authored-by: Patrick-Erichsen <[email protected]> * chore(protocol): update Swift Side chat context model Co-authored-by: Patrick-Erichsen <[email protected]> * test(ui): await companion history after reconnect Co-authored-by: Patrick-Erichsen <[email protected]> * fix(ui): preserve correctable side-chat selection drafts * test(ui): cover selection edits at attachment frame limits --------- Co-authored-by: Patrick-Erichsen <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]>

What Problem This Solves
Selecting Ask in side chat skipped the comment editor and only inserted a quoted prefix, unlike adding a selection to the main chat.
User Impact
A selection now opens the same comment editor, then stages an editable comment in Side chat. The main draft stays untouched; the full passage and comment reach the Side chat model when the question is sent.
Why This Change Was Made
The selection editor and comment preview are shared between destinations. Side chat sends selected text as bounded, temporary question context rather than as a text-file attachment, which its Gateway deliberately does not accept. The existing image-only attachment policy and ephemeral Side chat history remain unchanged.
Evidence
Before — selection immediately fills the Side chat question box, with no comment input:
After — comment input on the selected passage, followed by a staged comment in Side chat:
13c42b9e7bec(172 successful jobs, 13 intentional skips); both required merge checks, including the combined Security Review status, passed.The context field is optional and capped at 16,000 characters. Its size intentionally supports an operator-selected passage and comment beyond the short quoted question; it is used only for that ask, XML-escaped, and omitted from subsequent asks and retained exchanges. No new config, environment, storage schema, or protocol version is introduced.
Measured test cost
Measured at
13c42b9e7bec. All eight changed files passed locally (175 tests), and all five owning CI jobs passed. This addresses the test-cost reporting request in ClawSweeper revisions 4 and 5.packages/gateway-protocol/src/index.test.tssrc/gateway/session-companion-ask.test.tsui/src/e2e/chat-selection-to-main.e2e.test.tsui/src/pages/chat/chat-pane-companion-lifecycle.test.tsui/src/pages/chat/chat-session-rail.test.tsui/src/pages/chat/components/chat-comment-controller.test.tsui/src/pages/chat/components/chat-comment-preview.test.tsui/src/pages/chat/components/chat-selection-popup.test.tsLocal command:
pnpm test <file> --maxWorkers=1 --reporter=default; the browser file usesnode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner <file> --maxWorkers=1 --reporter=default. Command wall includes startup/transformation. CI UI-unit values are Vitest tests-plus-hooks diagnostics; browser time is the file summary. Asterisked Node values sum every reported case (59 protocol / 17 Gateway), excluding imports, setup, and hooks because those jobs emit no file diagnostic. These are per-file measurements, not whole-job wall time.Seven local files meet the <5s test-time target. The browser suite takes 29.034s locally and 97.740s in CI. It proves actual DOM selection, visible editing and correction, desktop/mobile layouts, reload behavior, and UI-to-Gateway request wiring against the built app. The unit tests prove admission/serialization cheaply, but cannot prove those browser contracts. The four defect cases cost 5.350s locally / 25.195s in CI; the two Side chat desktop/mobile cases cost 2.314s / 7.907s. The remaining time belongs to existing main-chat and retained-comment coverage. This uses the existing dedicated UI E2E lane; no new serial configuration, worker pin, sleeps, or timeouts were introduced. The Gateway command’s 44.645s wall is mostly transformation (86% of Vitest duration); its tests take 3.161s.
Thanks @Patrick-Erichsen for the UX request.
Work sessions
View the OpenClaw team session