Skip to content

fix(ui): highlight new-chat mentions and attach possessives - #196078

Draft
roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/dawn-crayfish-4
Draft

roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/dawn-crayfish-4

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: selected people remain plain text in the New Chat creation box, and typing a possessive after selection leaves the picker’s inserted space before the apostrophe.

User Impact

User impact: selected people are visibly highlighted while composing, and straight or curly apostrophes attach directly without losing the recipient. Native editing, clipboard text, caret behavior, and undo remain intact. No permission, recipient-format, or configuration changes.

Why This Change Was Made

Keep the native textarea as the only editor. An aria-hidden, noninteractive projection decorates existing selected mention spans with the sent-message color tokens. The existing input owner replaces the picker separator through a native editing transaction, matching emoji completion instead of resetting undo history.

Scope is New Chat creation, not the command palette or the separate rich-editor proposal in #192242.

Evidence

  • Original Chromium reproduction failed: selecting Bob and typing 's notes produced @Bob 's notes without inline highlighting.
  • Browser suite: 7/7 passed, 24.35 seconds wall time including the production Vite build. Covers desktop/phone layouts, straight/curly apostrophes, undo/redo across the conversion itself, long-draft scrolling, recipient removal, and sessions.create recipient spans.
  • Additional real-app desktop/390px alignment regression passed (16.23 seconds including build). Both native and mirror padding are 6px in the actual New Chat UI. The independent review’s standalone-CSS mobile mismatch was not reproducible at this production boundary; the regression retains that invariant.
  • Focused composer/mention suites: 82/82 passed; 2.65 seconds Vitest time, 3.70 seconds wrapper wall time.
  • UI typecheck, targeted TypeScript/CSS lint, formatting, controller guard, and git diff --check passed.
  • Local Codex autoreview, P0–P2, against base be043617c71c52afc1bd13833009e9312862b0eb: final production candidate clean after fixing and re-reviewing its native-undo finding. Fresh independent source review completed; its mobile finding was investigated as above. Hosted ClawSweeper review is running for this exact head; the local ClawSweeper checkout could not be qualified under this session’s file-access scope.
  • Inspected before/after screenshots were delivered in the originating conversation and are embedded below.

Before

New Chat before: plain selected mention and a space before the possessive

After

New Chat after: highlighted selected mention and an attached possessive

Scope and proof limits

Production grows by 137 lines for decoration/native edit handling, without another editor, rendering controller, view effect, or identity parser. Regression growth is 62 lines with its own exact allocation. Browser proof runs the production UI with synthetic Gateway fixtures, not the live Team Gateway. Safari and Firefox were not exercised locally. GitHub CI is pending.

Reported by @vincentkoc. cc @vyctorbrzezowski.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 3 commits November 9, 2026 15:40
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 69c6caa8-5d6f-4bf7-af37-ae8a5eaf7908
@clawsweeper

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

@roboclaw-bot
roboclaw-bot marked this pull request as draft November 9, 2026 15:58
@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 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR highlights selected people in New Chat and attaches typed apostrophes directly to their names.

Example: Select Bob in New Chat, then type 's notes.

  • Before: The draft contains @bob 's notes and the selected name remains plain text.
  • After: The draft contains @bob's notes and highlights @bob while retaining its recipient annotation.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and visually demonstrated, with one source-backed browser alignment defect blocking merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The inspected before/after screenshots show the changed highlight projection in the production New Chat UI; supplied Chromium results cover apostrophe conversion, native undo/redo, scrolling, removal, and session-creation spans with synthetic Gateway fixtures, without claiming live notification delivery.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Selected people look like ordinary draft text, and typing a possessive leaves an unwanted separator before the apostrophe.
Reason: The maintainer-authored direction addresses a concrete composition problem without changing permissions, configuration, or recipient contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR provides a useful, scoped improvement, but the new mirror can wrap differently from the native editor in Firefox with classic scrollbars.

Priority: P2
Reviewed head: 0b92ae17c919117dc1f1327368f74b29205e3a3b

Before merge

  • Match the mirror width to Firefox’s native scrollbar gutter (P2) - In Firefox on a system with classic scrollbars, select Bob and enter enough wrapped prose to overflow the New Chat textarea. The existing overflow owner sets overflowY to scroll, and base.css gives Firefox a thin scrollbar, reducing the native text width. This mirror instead fills the entire combobox with overflow hidden; the padding trade below applies only to ::-webkit-scrollbar engines. Consequently, the mirror wraps later than the native editor, so visible text no longer tracks the caret, selection, or scroll position once the textarea text is transparent. Reserve the same actual gutter in the projection and add a Firefox classic-scrollbar wrapping regression.

Findings

  • [P2] Match the mirror width to Firefox’s native scrollbar gutter — ui/src/styles/chat/composer-surface.css:413-419
Agent review details

How this fits together

The Control UI composer receives draft text and selected recipient spans, projects their appearance beside a native textarea, and submits text and annotations through the existing session-creation owner.

flowchart LR
  A[People picker] --> B[Draft and recipient spans]
  B --> C[Native textarea]
  B --> D[Mention highlight projection]
  C --> E[Existing input owner]
  E --> B
  B --> F[Session creation]
Loading

Technical review

Best possible solution:

Keep the native editor and existing recipient owner, while making the decoration use the textarea’s actual text width when a classic scrollbar appears.

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

Current-main source confirms the missing decoration and conversion; the supplied Chromium reproduction reports the original failure, while the Firefox gutter regression follows from the native overflow owner and new mirror CSS without a reviewer-run browser reproduction.

Is this the best way to solve the issue?

The native-textarea approach is appropriately scoped and preserves recipient ownership, but its projection must match the native scrollport across supported scrollbar implementations.

Full review comments:

  • [P2] Match the mirror width to Firefox’s native scrollbar gutter — ui/src/styles/chat/composer-surface.css:413-419
    In Firefox on a system with classic scrollbars, select Bob and enter enough wrapped prose to overflow the New Chat textarea. The existing overflow owner sets overflowY to scroll, and base.css gives Firefox a thin scrollbar, reducing the native text width. This mirror instead fills the entire combobox with overflow hidden; the padding trade below applies only to ::-webkit-scrollbar engines. Consequently, the mirror wraps later than the native editor, so visible text no longer tracks the caret, selection, or scroll position once the textarea text is transparent. Reserve the same actual gutter in the projection and add a Firefox classic-scrollbar wrapping regression.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Selected-recipient ownership and controls keeps the original intent (516fbb2: Explicit picker selections bind authorized profiles to visible text spans; plain names do not create recipients.)
  • Native New Session editor keeps the original intent (74c7b3d: The Solid migration preserved draft, focus, selection, attachment, and submission ownership.)
  • Native editing transactions keeps the original intent (46c107b: Emoji completion uses browser editing transactions to preserve native undo rather than replacing the textarea value.)
  • Composer sizing and scrollbar geometry keeps the original intent (d51f360: Native typing avoids synchronous geometry reads while retaining measured fallback sizing and existing transcript ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • Firefox with classic scrollbars: select Bob, overflow the editor with wrapped prose, and verify mirror/native line breaks and selection geometry before and after scrolling.
  • Recheck the existing Chromium New Chat mention scenario, including desktop/mobile padding, straight and curly apostrophes, undo/redo, removal, and sessions.create spans.
  • pnpm tsgo:ui
  • pnpm lint:ui:styles
  • git diff --check

What I checked:

  • Introduced change: The pinned introduction adds a decoration-only component, native apostrophe replacement, composer bindings, shared styling, and browser regression coverage. (ui/src/pages/new-session/composer.tsx:628, 0b92ae17c919)
  • Scrollbar mismatch: The mirror fills the combobox and hides overflow without reserving a scrollbar gutter. The native overflow owner forces a vertical scrollbar when needed; Firefox receives scrollbar-width: thin, while padding compensation is restricted to engines supporting ::-webkit-scrollbar. (ui/src/styles/chat/composer-surface.css:414, 0b92ae17c919)
  • Inspected visual evidence: Inspected both prepared screenshots linked in the PR body; the after image visibly highlights Bob inside the actual New Chat composer. The body reports Chromium native editing, undo/redo, scrolling, and submitted-recipient checks with synthetic Gateway fixtures. (0b92ae17c919)
  • Current main still has the reported path: Fetched main retains the native textarea and existing mention-input snapshot without the new highlight projection or apostrophe conversion. (ui/src/pages/new-session/composer.tsx:517, 433a0c358503)
  • Existing mention contract: The merged human-mentions implementation binds explicitly selected profiles to UTF-16 spans and preserves the separate Will notify and Remove mention controls; this PR retains those owners and controls. (ui/src/lib/chat/human-mentions.ts:65, 516fbb224bf8)
  • Related implementations: improve: render chat composer mentions inline #192242 remains a draft proposing atomic rich-editor chips across Chat and New Session. feat(ui): highlight selected mentions in the native composer #152774 proposed native range highlighting but closed unmerged; neither establishes an existing shipped solution.

Likely related people:

  • Peter Steinberger: Raw commit 516fbb2 adds ui/src/pages/new-session/composer.ts:456 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 516fbb224bf8; files: ui/src/pages/new-session/composer.ts)

PR surface

Source +137, Tests +62, Other +2. Total +201 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 142 5 +137
Tests 1 63 1 +62
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 207 6 +201

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 regression growth Production +142/-5; tests +63/-1 The growth implements decoration and native editing within existing owners and extends an existing browser scenario without another editor or test-only production seam.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves selected-recipient clarity and possessive typing, with a limited browser-specific editing regression to repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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.

Reviewed November 9, 2026, 11:15 AM ET / 16:15 UTC.

This branch has not been deployed

No deployments
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant