Skip to content

fix(ui): preserve thinking completion when selecting argument text - #196507

Merged
steipete merged 1 commit into
mainfrom
fix/ci-427691-thinking-tab
Nov 10, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/ci-427691-thinking-tab

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Tab completing /think again instead of the selected thinking level after the user selects its trailing space. This broke all three viewport cases in scheduled CI run 42769178432.

User Impact

Users can keep a thinking level highlighted while selecting text in the argument area, then complete it with Tab and submit it. Leading commands typed before pasted text keep their existing completion behavior.

Why This Change Was Made

The slash-menu owner now distinguishes a caret inside the command token from a selection extending into its arguments. The latter retains the argument picker and its selection. The existing composer regression also checks selection followed by a pending catalog refresh; no new state or timing workaround is introduced.

Evidence

  • Reproduced the exact desktop E2E failure on current main, and the extended composer regression fails on the same base.
  • Focused composer and command suites: 44 tests passed, 2.75s wall time (local). CI duration pending.
  • All four thinking-completion browser cases passed, including mobile, tablet, and desktop. Both leading-command browser cases passed using macOS-equivalent Home/End key chords, with unchanged product code and assertions; the temporary test edit was reverted.
  • UI production and chat-test typechecks (tsrs), focused type-aware lint, formatting, and test-line budget passed.
  • Independent Codex autoreview of the complete local patch against 261b24e6bc8e3012687f5b27623b0e26f3defff6: scoped-clean through P2.
  • The first post-fix full-Chromium run crashed; browser validation uses the installed matching Chromium headless shell. The unmodified sibling test uses Linux Control+Home/End keys, which append text on macOS; its local failures were diagnosed from the captured draft. Linux PR CI remains the proof for those original key chords.
  • Test-line allocation covers seven added regression lines and 293 lines of inherited debt on the pinned base; the shared baseline is unchanged.

Related regression: 8aa3ef4425c (leading slash commands before pasted text).

@clawsweeper

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

@steipete
steipete marked this pull request as ready for review November 10, 2026 07:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T07:36:25.756141Z c16b535 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves the highlighted slash-command argument when text selection extends beyond the command token.

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

  • Before: The selection switches to command completion and leaves /think instead of completing the highlighted level.
  • After: The argument picker retains ultra and Tab produces /think ultra.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful regression coverage; available validation is reported harness evidence rather than inspectable live-product proof.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored exemption applies; the body reports post-fix browser completion across three viewports and sibling leading-command checks, while inspectable source provides composer and mocked-Gateway browser coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Selecting argument text discards the highlighted thinking level, so Tab completes the command again.
Reason: This restores established keyboard behavior with a narrow repair, and the supplied host facts identify the PR as maintainer-authored.

Regression provenance

Regression provenance — suspected predecessor, not a causality claim: source commit e89e5adfe69b by Peter Steinberger; no PR verified.

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current completion regression in the existing owner, preserves leading-command behavior, and introduces no actionable correctness or security finding.

Priority: P2
Reviewed head: c16b5358087e3099b8dc44f98cf2cb29b16e0896

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported browser runs use a mocked Gateway, and this PR supplies no independently inspectable shipped-entry-point recording or runtime trace.
Agent review details

How this fits together

The Control UI composer passes draft text and textarea selection to its slash-menu owner, which chooses command or argument suggestions and commits the selected completion.

flowchart LR
  A[Textarea draft and selection] --> B[Composer selection handler]
  B --> C[Slash menu owner]
  D[Command catalog and argument options] --> C
  C --> E[Command or argument picker]
  E --> F[Completed composer draft]
Loading

Technical review

Best possible solution:

Retain this focused selection-boundary repair in the existing slash-menu owner and its extended composer regression.

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

The parser, selection handler, and current-main branch condition establish the failure for selection range 6–7 in /think ; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch restores the existing argument-selection invariant with one local condition, preserves caret-only leading-command completion, and adds no unnecessary machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Leading-command versus argument-menu precedence keeps the original intent (8aa3ef4: Keep leading slash commands discoverable before pasted prose without consuming that prose; the new selection distinction preserves this intent.)
  • Argument selection retention keeps the original intent (fad4501: Retain the highlighted argument by value while the same draft remains active, including native text selection.)
  • Existing composer regression keeps the original intent (475a6d9: Consolidate proof at the owning boundary; this PR extends the existing catalog-refresh case instead of adding another fixture or suite.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e89e5ad adds ui/src/pages/chat/components/chat-composer-slash-menu-state.ts:139 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e89e5adfe69b; files: ui/src/pages/chat/components/chat-composer-slash-menu-state.ts)
  • Ben.Li: Raw commit fad4501 adds ui/src/pages/chat/components/chat-composer-slash-menu-state.ts:144 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fad45014d2d4; files: ui/src/pages/chat/components/chat-composer-slash-menu-state.ts)

PR surface

Source +4, Tests +7, Other +1. Total +12 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 2 +4
Tests 1 9 2 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 16 4 +12

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.

Labels

Label changes:

  • add P2: A reproducible source path breaks keyboard argument completion, with limited impact and ordinary editing alternatives.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A reproducible source path breaks keyboard argument completion, with limited impact and ordinary editing alternatives.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed November 10, 2026, 2:50 AM ET / 07:50 UTC.

@steipete
steipete merged commit 026e99d into main Nov 10, 2026
156 of 160 checks passed
@steipete
steipete deleted the fix/ci-427691-thinking-tab branch November 10, 2026 09:22
@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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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.

1 participant