Repository navigation
improve(ui): let session links accept typing while the page loads - #188153
Conversation
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]>
Co-authored-by: vyctorbrzezowski <[email protected]>
|
🦞👀 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 changes before merge. What this changesAdds 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.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1e906e961436. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +433, Tests +319. Total +752 across 28 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment 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]>
e3850e2 to
f23c3b9
Compare
Co-authored-by: vyctorbrzezowski <[email protected]>
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…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]>
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
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.tskeeps 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.submitDraftadmission 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.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:
After — the composer accepts typing while the session loads, and the session opens with that draft in place:
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 onechat.sendonly aftersessions.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.chat-snapshot-routee2e: Enter while route authority is pending is held, then sent once after it settles.boot-composer.test.ts, queued-submit cases inchat-composer-actions.test.ts, and skeleton accessibility checks.boot-module-boundariesplacement-recovery cases fail identically on unmodifiedmain.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.chat-widget-retention(live widget handoff) fails identically on unmodified87facf07locally.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 inboot-composer.ts.