Skip to content

improve(ui): let session links accept typing while the page loads - #188153

Merged
roboclaw-bot merged 4 commits into
mainfrom
roboclaw/boot-composer-typing
Oct 30, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
roboclaw/boot-composer-typing

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Opening a session link showed a "Loading…" placeholder where the composer belongs until the Gateway connected and the session route resolved, so anything typed in that window was lost.

User Impact

User impact: a session link's composer accepts typing from first paint — click or tap into it right away instead of waiting behind "Loading…". Focus stays with the operator, as in the chat composer, so nothing is auto-focused. What you type survives every loading frame and lands in the session's composer with its caret, and pressing Enter early sends the message once, after the session has opened through the normal checks. Text never reaches a session the link didn't open: a missing or inaccessible session, or navigating elsewhere first, means nothing is sent.

Requested by @vyctorbrzezowski.

Work sessions

Why This Change Was Made

  • The static boot frame (ui/index.html) now holds a real textarea in its composer slot. A small inline script owns its keys before any bundle loads: Enter only records intent (Shift+Enter, IME commits, touch Return and the saved send shortcut follow the chat composer). The loading text moves above the composer and hides once there is a draft.
  • app/boot-composer.ts keeps that one element across the Solid connecting splash and the in-shell route skeleton, restoring focus after each move. It retires on any pushed or history navigation, so a draft can't follow the operator to another session.
  • The route's chat pane adopts the draft only after the route loader has resolved the session — after connect, the session lookup and its access checks. A saved draft for that session stays first and is never auto-sent.
  • An early Enter becomes a queued submit in the chat composer. It is sent through the same submitDraft admission the send button uses, once the composer's own loading hold (route verification, outbox scope) clears; any edit withdraws it. The same rule now covers pressing Enter in the real composer during those holds, which previously inserted a newline.
  • The boot composer paints the chat composer's surface color and mirrors its geometry, including autogrow and the narrow and mobile editing forms, so the handoff doesn't move the frame or the text. A composer that mounts already focused on mobile no longer animates up from a compact form nobody saw.

Accepted edge cases: on touch devices Return inserts a newline (as in the chat composer), so an early send waits for the send button. Placeholder copy in the static frame is English, like the existing "Loading…".

Evidence

Before — the composer slot is a "Loading…" placeholder, and typing goes nowhere:

Before: Loading placeholder over the composer slot while the session loads

Before: after loading, nothing typed earlier was kept

After — the composer accepts typing while the session loads, and the session opens with that draft in place:

After: typing into the composer while the session loads, on the chat composer's surface

After: the session's composer holds the early draft

  • New ui/src/e2e/chat-boot-composer.e2e.test.ts (mocked Gateway, real bundle): the boot composer is not auto-focused; typing during connect and route hold, then Enter, sends exactly one chat.send only after sessions.resolve; an unsent multi-line draft keeps its text, focus and caret; a 90-frame recorder proves every animation frame through the handoff shows one composer at one size with the whole draft (desktop and iPhone emulation); a missing session never sends and the draft doesn't follow navigation.
  • Updated chat-snapshot-route e2e: Enter while route authority is pending is held, then sent once after it settles.
  • Unit: boot-composer.test.ts, queued-submit cases in chat-composer-actions.test.ts, and skeleton accessibility checks.
  • Geometry sweep at 1280/820/400 px and iPhone 390 px, light and dark, typing continuously across frame swaps: no lost characters, no page errors, zero non-input CLS, and boot and chat composer frames identical at handoff (single and multi-line).
  • 27 related Control UI e2e suites pass locally (splash pixel parity, loading geometry, cold/warm boot, outbox, reconnect, drafts, mobile). boot-module-boundaries placement-recovery cases fail identically on unmodified main.
  • Performance (scripts/bench-control-ui-cold-load.ts, built bundles, 21 interleaved base/candidate pairs, untraced): first contentful paint 44–48 → 40–44 ms, static shell unchanged, CLS unchanged. Shell and composer readiness are bimodal on this host in both builds (chat ready with the shell ≈260 ms, or shell ≈160 ms then chat ≈300 ms); the mode split was 8/21 vs 11/21 and within-mode times match. Startup JS gzip is unchanged (−5 B); the HTML document grows by ~1.1 KB gzip (inline styles and script) and chat boot JS by under 1 KB gzip.
  • PR CI's first run caught that auto-focusing the boot composer moved focus away from model pickers, question docks and route-readiness flows (6 UI e2e files); the third commit leaves focus to the operator and those files pass locally. chat-widget-retention (live widget handoff) fails identically on unmodified 87facf07 locally.
  • Local autoreview (Codex gpt-6.1-sol, max priority P2, branch 87facf07..HEAD): first pass found one P2 (keep the caret through the handoff), fixed in the second commit and covered by the e2e caret check. The re-review raised one P2 about an IME composition open at the exact moment of handoff; declined: a CDP IME probe across both the connect and route handoffs shows the composing text is committed into the session composer and typing continues (hello にほ → hello にほん), so only the candidate window restarts — rare and recoverable, and documented in boot-composer.ts.

roboclaw-bot and others added 2 commits October 30, 2026 06:56
Opening a session link painted a "Loading…" placeholder where the composer
belongs until the Gateway connected and the route resolved, so early typing
was lost. The boot frame now ships a real composer that carries focus, text
and an early Enter through every loading frame. The route's chat pane adopts
it once the session resolves, and an Enter made before the composer can send
waits for the composer's own admission, then sends once.

Co-authored-by: vyctorbrzezowski <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 30, 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 enabled auto-merge (squash) October 30, 2026 07:11
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Adds an editable loading composer that preserves early text, focus, caret, and pending submission into the session composer.

Example: Open a session link and type “Can you also add the migration notes?” while it loads.

  • Before: The loading placeholder cannot accept or retain the text.
  • After: The loading composer accepts the text and transfers it into the opened session.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The visible improvement is demonstrated, but two concrete production defects and a stale CI assertion need repair.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected screenshots demonstrate retained early text through the browser UI, while queued-send and missing-session scenarios use mocked-Gateway browser tests.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users cannot start a draft while a session link is still loading.
Reason: The maintainer-authored direction addresses a visible interruption, preserves existing saved drafts, and reuses normal send admission.

Merge readiness

⛔ Needs changes before merge - 4 items remain

This maintainer-authored PR provides useful early typing, but delayed submission loses modified-Enter intent and long desktop drafts change size at handoff.

Priority: P2
Reviewed head: f23c3b930b9a22a20f51ce4daee7d9762fd939f7

Before merge

  • Preserve the modified-Enter action while submission is held (P2) - With an active run, Enter-to-send, and Steer selected, press Cmd/Ctrl+Enter while route verification or outbox readiness holds submission. This branch queues only the text, before computing followUpModeOverride; flushQueuedSubmit later calls submitDraft(draft) without that override. The message therefore steers instead of waiting in Queue. Retain the chosen per-message action through the hold, including the inverse Queue-to-Steer case.
  • Match the desktop composer's height limit during boot (P2) - Paste a twelve-line draft while a desktop session link loads at a roomy viewport such as 1440×900. This 188px cap shows approximately six lines, but the existing pane composer grows to twelve lines, so adoption expands the frame and moves the text. The twelve-line contract is already present on the merge base from improve: grow desktop chat drafts up to twelve lines #186874. Match that desktop limit and retain the mobile six-line behavior; the current short-draft handoff tests miss this case.
  • Update the readiness test for intentional desktop autofocus (P3) - The added boot autofocus is transferred into the real composer even when its draft is empty, but this existing consumer still requires the composer to be unfocused. The reviewed CI run fails this assertion with actual=true in both parameterized cases. Align the assertion with the new desktop contract and explicitly configure a mobile browser identity when testing touch-only focus behavior.
  • Explain or restore the original intent of Modified-Enter submission - fdb68df: Preserve an explicit per-message Queue/Steer override; the pending branch omits it without explaining a changed shortcut contract.

Findings

  • [P2] Preserve the modified-Enter action while submission is held — ui/src/pages/chat/components/chat-composer-keydown.ts:186-189
  • [P2] Match the desktop composer's height limit during boot — ui/index.html:511-515
  • [P3] Update the readiness test for intentional desktop autofocus — ui/src/e2e/control-ui-route-readiness.e2e.test.ts:62

Provenance

  • Modified-Enter submission changes intended behavior without addressing why it exists (fdb68df: Preserve an explicit per-message Queue/Steer override; the pending branch omits it without explaining a changed shortcut contract.)

Tests

  • Missing end-to-end proof: Screenshots establish visible draft handoff; delayed-send ordering has mocked-Gateway coverage, without retained base-red/head-green execution evidence.
Agent review details

How this fits together

The Control UI carries a document-owned textarea through connection and route loading, then hands its draft to the session pane and existing send admission.

flowchart LR
  A[Session link] --> B[Static boot textarea]
  B --> C[Connection and route skeletons]
  C --> D[Resolved session pane]
  D --> E[Composer send admission]
  E --> F[Gateway chat send]
Loading

Technical review

Best possible solution:

Keep the single boot textarea and existing send owner, preserve queued shortcut intent, and match the established desktop and mobile sizing limits.

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

The base has a non-editable loading slot, and the inspected before/after screenshots demonstrate the requested draft-retention improvement; the two production findings follow directly from the changed source.

Is this the best way to solve the issue?

The existing draft and send owners are the right boundaries, but pending submission must retain the chosen action and the boot layout must honor the existing height contract.

Full review comments:

  • [P2] Preserve the modified-Enter action while submission is held — ui/src/pages/chat/components/chat-composer-keydown.ts:186-189
    With an active run, Enter-to-send, and Steer selected, press Cmd/Ctrl+Enter while route verification or outbox readiness holds submission. This branch queues only the text, before computing followUpModeOverride; flushQueuedSubmit later calls submitDraft(draft) without that override. The message therefore steers instead of waiting in Queue. Retain the chosen per-message action through the hold, including the inverse Queue-to-Steer case.
    Confidence: 0.98
  • [P2] Match the desktop composer's height limit during boot — ui/index.html:511-515
    Paste a twelve-line draft while a desktop session link loads at a roomy viewport such as 1440×900. This 188px cap shows approximately six lines, but the existing pane composer grows to twelve lines, so adoption expands the frame and moves the text. The twelve-line contract is already present on the merge base from improve: grow desktop chat drafts up to twelve lines #186874. Match that desktop limit and retain the mobile six-line behavior; the current short-draft handoff tests miss this case.
    Confidence: 0.97
  • [P3] Update the readiness test for intentional desktop autofocus — ui/src/e2e/control-ui-route-readiness.e2e.test.ts:62
    The added boot autofocus is transferred into the real composer even when its draft is empty, but this existing consumer still requires the composer to be unfocused. The reviewed CI run fails this assertion with actual=true in both parameterized cases. Align the assertion with the new desktop contract and explicitly configure a mobile browser identity when testing touch-only focus behavior.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Static and Solid loading frames keeps the original intent (f3464c7: Paint a theme-aware chat frame before application assets load.)
  • Loading-to-chat geometry keeps the original intent (71be892: Preserve composer size and position through boot, route loading, and history loading; the new six-line cap misses the later twelve-line desktop contract.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/chat-composer-actions.test.ts src/app/boot-composer.test.ts
  • pnpm test:ui:e2e ui/src/e2e/chat-boot-composer.e2e.test.ts ui/src/e2e/chat-snapshot-route.e2e.test.ts ui/src/e2e/control-ui-route-readiness.e2e.test.ts
  • Verify modified-Enter retains both Queue and Steer choices after a pending hold clears.
  • Inspect desktop twelve-line and mobile handoffs for unchanged frame size, text, focus, and caret.
  • Run changed-file checks and git diff --check; do not add a changelog entry.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fdb68df adds ui/src/pages/chat/components/chat-composer.ts:200 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fdb68df71380; files: ui/src/pages/chat/components/chat-composer.ts)
  • Marvinthebored: Raw commit 402e7f4 adds ui/src/styles/chat/composer-surface.css:46 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 402e7f4a4c86; files: ui/src/styles/chat/composer-surface.css)

PR surface

Source +433, Tests +319. Total +752 across 28 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 22 460 27 +433
Tests 6 332 13 +319
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 792 40 +752

Labels

Label changes:

  • add P2: Useful loading-flow improvement with bounded shortcut and layout defects.
  • add merge-risk: 🚨 message-delivery: A held Cmd/Ctrl+Enter can steer an active run when the user explicitly chose Queue.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Useful loading-flow improvement with bounded shortcut and layout defects.
  • merge-risk: 🚨 message-delivery: A held Cmd/Ctrl+Enter can steer an active run when the user explicitly chose Queue.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 October 30, 2026, 3:19 AM ET / 07:19 UTC.

The chat composer never takes focus on load; focusing the boot composer at first paint moved focus away from pickers, question docks and shortcuts in existing flows.

Co-authored-by: vyctorbrzezowski <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the roboclaw/boot-composer-typing branch from e3850e2 to f23c3b9 Compare October 30, 2026 07:44
@roboclaw-bot
roboclaw-bot disabled auto-merge October 30, 2026 07:44
@roboclaw-bot
roboclaw-bot merged commit 4ad9aea into main Oct 30, 2026
88 of 92 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/boot-composer-typing branch October 30, 2026 08:16
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…enclaw#188153)

* improve(ui): let session links accept typing while the page loads

Opening a session link painted a "Loading…" placeholder where the composer
belongs until the Gateway connected and the route resolved, so early typing
was lost. The boot frame now ships a real composer that carries focus, text
and an early Enter through every loading frame. The route's chat pane adopts
it once the session resolves, and an Enter made before the composer can send
waits for the composer's own admission, then sends once.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): keep the boot draft's caret through the composer handoff

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): leave boot composer focus to the operator

The chat composer never takes focus on load; focusing the boot composer at first paint moved focus away from pickers, question docks and shortcuts in existing flows.

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve(ui): paint the boot composer with the chat composer's surface

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: vyctorbrzezowski <[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 merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L 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