Skip to content

fix(ui): keep selected slash argument when selecting text - #194087

Merged
obviyus merged 4 commits into
openclaw:mainfrom
ly85206559:codex/fix-slash-argument-formatted-20261106
Nov 6, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
ly85206559:codex/fix-slash-argument-formatted-20261106

Conversation

@ly85206559

@ly85206559 ly85206559 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Keyboard text selection in a slash-command argument draft refreshed the menu and reset the highlighted argument to the first row. Tab could therefore complete default instead of the operator's selected ultra.

The existing slash menu owner retains the selected value while the same argument draft remains active. Changed drafts/commands retire that selection; refreshed options preserve it by value or fall back when it disappears. Reuses the constructed command draft rather than allocating it twice. No new keyboard owner, model-selection policy, Gateway normalization or server-echo change.

Preserves ly85206559's original commits.

Evidence

Inspected Chromium/Linux WebKit before-and-after screenshots, actual RPC fields, controls and measurements.

Built Gateway serves built Control UI in secretless Node24.22.1 Docker. Main twice and exact head twice in each engine, eight successful scenes. ArrowUp highlights ultra; Shift+ArrowLeft causes a native text-selection event. Main resets to default; the candidate retains ultra. Tab completes the argument, and normal Enter submission emits actual sessions.patch with thinkingLevel:null on main versus "ultra" on the candidate; real Gateway replies succeed. Mouse selection, default Enter and Escape are unchanged. No model turn is made.

Linux WebKit uses the disclosed driver-only correction retaining MiniBrowser's native disabled PushAPI default; no product/page API or platform spoof.

Checks: 16 owner/component tests and 4 focused UI E2E cases pass. Both amended regressions fail on main. Coverage is consolidated into existing owner/viewport and E2E cases: tests net−1, allocation removed; production +19/−4 (23 gross).

Real served gzip growth: Chat +311 B, startup −7 B, combined +304 B, below600 B. Canonical hash-normalized growth is +87 B, with the comparator passing and no caps or allowances changed.

Merge Danger

Two-way door: reverting fully restores prior UI behavior; no migration or new persisted contract. Blast radius is selected slash-command argument fidelity in the chat composer. Existing model policy and Gateway validation remain authoritative.

@clawsweeper

clawsweeper Bot commented Nov 6, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserves the highlighted slash-command argument when native text selection refreshes an unchanged composer draft.

Example: Type /think, press Tab, highlight ultra with ArrowUp, select text with Shift+ArrowLeft, then press Tab.

  • Before: The highlight resets to default and completes /think default.
  • After: The highlight remains on ultra and completes /think ultra.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-level fix with inspected shipped-path proof, meaningful regressions, and no actionable findings; pending CI does not establish readiness to merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before-and-after screenshots and the collaborator's exact-head proof exercise native text selection through built Control UI served by a real isolated Gateway in Chromium and Linux WebKit; ultra remains highlighted and normal submission produces a successful thinkingLevel:"ultra" patch.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Selecting text can discard the argument highlighted with the keyboard and complete a different value.
Reason: Restores input fidelity using the existing presentation owner and preserves command policy, defaults, and submission behavior.

Merge readiness

✅ Ready for maintainer review

This PR fixes a distinct argument-selection bug still present on main; no actionable defects were found, and CI remains pending.

Priority: P2
Reviewed head: b905f501c6b2ff44cbd15656ef160d06553b227e

Before merge

None.

Findings

None.

Agent review details

How this fits together

Chat and New Session share a slash-menu presentation owner that receives draft and selection events and returns highlighted options and command completions.

flowchart LR
  A[Composer textarea] --> B[Native selection event]
  B --> C[Shared slash menu owner]
  D[Command argument options] --> C
  C --> E[Highlighted argument]
  E --> F[Tab completion]
  F --> G[Normal command submission]
Loading

Technical review

Best possible solution:

Retain argument selection by value within the existing shared menu owner while resetting it for changed drafts or unavailable values.

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

Supplied Chromium and WebKit runs reproduce the native-selection failure against a main owner blob independently verified identical to fetched main; no target code was executed during this review.

Is this the best way to solve the issue?

This is a small, complete repair of the selection invariant in its existing shared owner, with no parallel keyboard handler or provider-policy change.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 802ddc708476.

Provenance checked

  • Shared slash-menu state and argument transitions keeps the original intent (refactor(ui): own composer command menus in Solid stores #174321: Move presentation into shared Solid stores while preserving keyboard and argument-selection behavior and completing transitions before draft publication.)
  • Argument-menu owner separated from lazy option views keeps the original intent (e89e5ad: Defer rich suggestion rendering while retaining synchronous state, keyboard selection, accessibility, and activation.)
  • Retained suggestion-option focus test keeps the original intent (d9c1c25: Keep retained composer controls responsive to current focus policy; the consolidated fixture preserves those assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 788093d adds ui/src/pages/chat/components/chat-composer-slash-menu-state.ts:240 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 788093dbc81f; files: ui/src/pages/chat/components/chat-composer-slash-menu-state.ts)
  • Jesse Merhi: Raw commit efbcb57 adds ui/src/e2e/chat-thinking-arguments.e2e.test.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: efbcb57569ab; files: ui/src/e2e/chat-thinking-arguments.e2e.test.ts)

PR surface

Source +15, Tests -1. Total +14 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 20 5 +15
Tests 2 37 38 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 57 43 +14

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +20/−5; tests +37/−38 Production growth adds draft identity and value retention to the existing owner; regression coverage is consolidated without net test growth.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Native text selection can silently replace the highlighted slash argument, but the problem is limited to composer completion.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-06T11:18:18.876Z sha 9a204c9 :: needs changes before merge. :: [P2] Allocate the added regression lines without raising the shared baseline
  • reviewed 2026-11-06T11:55:47.554Z sha bd0037d :: needs maintainer review before merge. :: none

Reviewed November 6, 2026, 7:47 AM ET / 12:47 UTC (Revision 3).

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 6, 2026
@obviyus

obviyus commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Exact-head slash argument input-fidelity proof

Head b905f501c6b2ff44cbd15656ef160d06553b227e; runtime main 7a2001fa44690c17f621210f7196a70c06f8f45d. The main owner's blob is identical to the PR merge-base f7a46e85d26ad28de5eba194a386731ed28a518f (7213d275f6fed9932258856ccff0bc3cbf41d5b7). Preserves ly85206559's original commits.

Real shipped path: Secretless Docker, Node24.22.1, built Gateway serves built Control UI, real Chromium and Linux WebKit. Each ref/engine runs twice with fresh task-owned homes, profiles and browser contexts: 8 successful scenes. A session is created through public RPC. The normal OpenAI provider/model catalog exposes the known gpt-5.6-sol levels using a synthetic loopback configuration; no model turn is made, and every scene asserts no provider POST. Gateway traffic and replies are real, not mocked.

  1. Type /think, Tab into its argument menu, use ArrowUp to highlight non-default ultra.
  2. Shift+ArrowLeft selects the trailing space (native select event, range6–7). A read-only observer is installed before the key; two rendering frames allow the actual selection handler to settle.
  3. Tab completes the highlighted argument. The ordinary Enter submission then emits sessions.patch; both outgoing requests and successful actual Gateway replies are retained.
Engine Main twice after native text selection Exact head twice Mouse selection control Default Enter control Escape control
Chromium Highlight resets to default; Tab completes /think default; RPC thinkingLevel:null Highlight remains ultra; Tab completes /think ultra; RPC thinkingLevel:"ultra" "ultra" on both refs null on both refs Closes, retains /think , no RPC
Linux WebKit Same failure in both runs Same recovery in both runs "ultra" on both refs null on both refs Same unchanged behavior

Observed outgoing RPC fields (request IDs omitted):

{"method":"sessions.patch","params":{"key":"agent:main:slash-proof","thinkingLevel":null}}
{"method":"sessions.patch","params":{"key":"agent:main:slash-proof","thinkingLevel":"ultra"}}

null is the existing wire representation of the default menu choice, not a changed server echo. This changes UI input fidelity only; no model-selection or thinking-level policy changes.

Linux WebKit uses the approved driver-only Page.overrideSetting PushAPIEnabled=false correction, preserving MiniBrowser's native disabled default. No Gateway/page API or platform spoof. Initial fixture-only corrections (unsupported explicit thinkingLevelMap.ultra, default's null wire representation, and awaiting observer installation) are retained separately; no product workaround was added for them.

Checks: 16 owner/component tests and 4 focused UI E2E cases pass. Both retained regressions fail on main: the owner case gets on instead of selected off; the desktop E2E completes /think default instead of /think ultra. The +61 allocation is removed. Existing owner/viewport and E2E cases now carry the regressions, with fixture duplication and a self-comparison removed: tests +37/−38, net−1. Production +19/−4 (23 gross); the extra maintainer line reuses one constructed draft instead of allocating it twice. Formatter passes.

Real served gzip: official paired reports against the merge-base: startup90590→90583 B (−7 B), Chat1295157→1295468 B (+311 B), combined +304 B, below600 B. Current hash-normalized budget growth is +87 B (startup0, Chat+87); the canonical comparator passes with no caps or allowances changed. The proof-only measurement observer merely captures the official base/head JSON reports before the private comparison archive is retired; it changes no source or build inputs.

Evidence retained under proofs/194087/: runtime-matrix.json binds all eight exact build/selection/RPC observations; each scene retains trace.zip, raw Gateway frames and before/selected/after/sent/control screenshots. Official size reports: served-base.json, served-head.json, size-summary.json. Drivers: slash-proof.mjs, webkit-linux-defaults.cjs; checks: focused-tests.log, focused-e2e.log, main-regression.log, main-e2e-regression.log.

Chromium main: native text selection resets highlighted argument to default

Chromium exact head: ultra remains selected after native text selection

Linux WebKit main: highlighted argument resets to default

Linux WebKit exact head: selected ultra survives text selection

@obviyus

obviyus commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 6, 2026
@obviyus
obviyus merged commit fad4501 into openclaw:main Nov 6, 2026
96 of 98 checks passed
@obviyus

obviyus commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Landed in fad4501. Thanks @ly85206559. Slash-command arguments stay highlighted while you select text with the keyboard.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…94087)

fix(ui): keep the highlighted slash-command argument during keyboard text selection

In the chat composer's slash-command argument menu, selecting text with the keyboard reset the highlighted argument to the first entry. Pressing Tab then completed the default instead of the argument the user had highlighted (for example `/think ultra` sent no thinking level). The highlighted argument is now kept. Mouse selection, Enter on the default and Escape are unchanged.

Evidence: built Gateway and built Control UI in Chromium and Linux WebKit, twice per ref and engine. Main completed `default` and sent `thinkingLevel: null`; with this change `ultra` stays highlighted and is sent. Gateway replies succeed, and the controls are unchanged. Size: +304 B combined on real served gzip. Screenshots: openclaw#194087 (comment).

Thanks @ly85206559.

Co-authored-by: Ayaan Zaidi <[email protected]>
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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

2 participants