Repository navigation
feat(ui): add a native conversation surface for the macOS app - #159739
Conversation
Keep the web chat header, transcript, composer, side panels, and overlays in one embedded pane while native windows own surrounding navigation. Add a lazy document-bound conversation bridge with state publication, in-page session navigation, Dashboard handoff, presentation, and composer focus. Preserve existing browser and iOS settings embeds. Validate navigation completion, superseding web navigation, hidden-window route ownership, and agent-scoped state with unit and mocked-Gateway browser coverage. Raise only the paired startup JS baseline/cap by the authorized measured 249 bytes; retain all other budgets and allowances.
Echo each command result with its originating document ID, including stale-document rejections. Suspend retained panes and clear drag state only on effective presented-to-hidden transitions. Restore the normal 12px leading header inset through the lazy native embed stylesheet. Cover same-requestId commands across documents, repeated hidden updates for web and native presentation, and matching browser/native header geometry. Keep all performance budgets unchanged.
|
🦞👀 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: blocked before merge. Reviewed September 27, 2026, 1:57 PM ET / 17:57 UTC (Revision 3). ClawSweeper reviewWhat this changesAdds a single-pane Control UI chat embed and a document-bound bridge for a future macOS native window, with routing, presentation, documentation, and browser coverage. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main lacks this native conversation surface, and the supplied visual and browser evidence supports the feature. One introduced proof-capture defect remains before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway serves the Control UI, which renders the selected chat session and sends messages through the existing chat flow. A native window can inject embed flags and exchange navigation and presentation messages with the page. flowchart LR
A[Native window flags and commands] --> B[Control UI embed mode]
B --> C[Chat route and session]
C --> D[Conversation pane]
D --> E[Composer and transcript]
C --> F[Bridge state and results]
F --> G[Native window navigation]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +579, Tests +1086, Docs +45, Other 0. Total +1710 across 19 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Give each capture attempt one directory from the existing UI artifact allocator and keep both scenario screenshots together there. Do we have a high-confidence way to reproduce the issue? Yes. With optional UI proof capture enabled, two runs target the same screenshot filenames; the collision follows from source inspection, although this read-only review did not execute it. Is this the best way to solve the issue? Yes for the product path: the PR extends the existing embed and chat owners. The proof harness should use the repository's existing per-attempt artifact allocator. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 89b736ae43dc. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
…tion Preserve transcript file, session, and panel link ownership. Show a translated toast when Dashboard handoff fails, and keep visible inactive native windows presented. Bound host navigation by a 15-second receipt deadline, fence expired continuations, and allow an explicit navigation to recover a failed state acknowledgement. Validation: pre-fix regression failures; 82 focused tests, 3 mocked-Gateway E2E cases, 52 performance tests, UI lint/typecheck/i18n, import-cycle checks, production build at 371541 bytes under the unchanged 371581-byte startup cap, and scoped-clean independent review.
|
Both P2 findings and the corresponding rank-up moves are addressed in ee84a15:
The same commit addresses the accepted native-window findings: visible inactive panes keep rendering and navigating, and navigation produces a bounded result within 15 seconds, including a stalled host acknowledgement. Regression coverage includes recovery through a fresh explicit request after failed state confirmation. The preceding e155adf fixes the CI-reported static import cycle. The PR body now records pre-fix reproductions, passing focused/E2E/performance checks, the unchanged startup budget, and scoped-clean Codex autoreview. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
|
Post-merge follow-up: ClawSweeper revision 3 flags the optional screenshot capture paths in Revision 2 was clean. Revision 3 appeared during recovery of the landing-tool dependency mismatch, and I missed that update before the native merge completed as 3780784. The current PR is therefore merged with this test-harness follow-up still outstanding. The final validation runs did not enable optional screenshot capture; the inspected proof images already uploaded in this PR remain available. No additional runtime defect was reported in revision 3. |
…aw#159739) * feat(ui): add a native conversation surface for macOS Keep the web chat header, transcript, composer, side panels, and overlays in one embedded pane while native windows own surrounding navigation. Add a lazy document-bound conversation bridge with state publication, in-page session navigation, Dashboard handoff, presentation, and composer focus. Preserve existing browser and iOS settings embeds. Validate navigation completion, superseding web navigation, hidden-window route ownership, and agent-scoped state with unit and mocked-Gateway browser coverage. Raise only the paired startup JS baseline/cap by the authorized measured 249 bytes; retain all other budgets and allowances. * fix(ui): preserve native conversation reply and presentation ownership Echo each command result with its originating document ID, including stale-document rejections. Suspend retained panes and clear drag state only on effective presented-to-hidden transitions. Restore the normal 12px leading header inset through the lazy native embed stylesheet. Cover same-requestId commands across documents, repeated hidden updates for web and native presentation, and matching browser/native header geometry. Keep all performance budgets unchanged. * fix(ui): separate the native conversation bridge contract * fix(ui): preserve native conversation interactions and bounded navigation Preserve transcript file, session, and panel link ownership. Show a translated toast when Dashboard handoff fails, and keep visible inactive native windows presented. Bound host navigation by a 15-second receipt deadline, fence expired continuations, and allow an explicit navigation to recover a failed state acknowledgement. Validation: pre-fix regression failures; 82 focused tests, 3 mocked-Gateway E2E cases, 52 performance tests, UI lint/typecheck/i18n, import-cycle checks, production build at 371541 bytes under the unchanged 371581-byte startup cap, and scoped-clean independent review.
What Problem This Solves
The macOS app's Native experience renders chats with its own Swift transcript and composer, which keep falling behind the web chat (rendering bugs, missing composer features). To show the real web conversation inside the native window, the Control UI needs an embed mode that renders just the conversation pane — the existing native embed mode still shows the iOS "Back · Chat" heading and the web agent switcher on chat routes.
User Impact
User impact: none by itself. It adds an opt-in
conversationsurface and a small host bridge that the macOS app (follow-up PR) uses to embed the web chat pane — header, transcript, composer, side panels — next to its native sidebar. Normal browser use and the iOS settings embed are unchanged.Why This Change Was Made
window.__OPENCLAW_NATIVE_EMBED__.surface = "conversation"renders chat routes as a single chat pane without the embedded-page heading, agent switcher, or split layout; navigation to non-chat routes is not performed in the embedded document but handed to the host (open-dashboard).ui/src/app/native-conversation-bridge.ts(lazy; loaded only for this surface) implements a document-bound contract with the host:navigate/presentation/focus-composercommands andready/state/route-changed/open-dashboard/command-resultmessages. Every message carries a per-document id so a replaced document's delayed messages cannot act on the new one;navigatesucceeds only after the route and state actually switched.Evidence
Rig: dev Gateway on loopback with a scripted mock model; Chromium with the host flags injected (and a stub
openclawConversationhandler for the after shot). Synthetic content.Before (main, existing embed mode on a desktop chat route): iOS "Back · Chat" heading and agent row.
After (
surface: "conversation"): only the chat pane — header, transcript, composer. The bridge publishedreadythenstate.Checks: bridge unit tests and chat-page lifecycle tests (164 focused/performance tests, 14.9 s),
ui/src/e2e/native-conversation.e2e.test.ts(3 cases: surface rendering + send, in-page navigate / route-changed / open-dashboard, normal chat and iOS embed unchanged; 26 s), UI lint/typecheck lanes fromcheck-changed, Control UI performance checks, Codex autoreview (P0–P2) scoped-clean after two fixes (stale-reply document correlation; transition-only pane suspension).Follow-up repairs and validation
Both ClawSweeper findings are addressed: transcript file, session, and side-panel links retain their existing handlers; only unclaimed non-chat application routes are handed to the host. A rejected or failed Dashboard handoff shows the existing translated toast and keeps the conversation.
Visible inactive native windows now keep rendering and accepting navigation; active status gates composer focus only. Native navigation settles within 15 seconds of receipt, including queueing and host acknowledgement, with
navigate-timeoutornavigate-rejectedon failure. Expired continuations cannot publish for later commands. A fresh explicit navigation can recover a previously rejected or timed-out state confirmation; passive refresh stays change-only.CI run 36329252894 exposed a static type import cycle and was cancelled by fail-fast. Commit e155adf moves the unchanged bridge interface into a leaf type module. No CI rerun or baseline weakening was used.
Validation after the repairs: 82 focused tests passed (2.74 seconds), 3 mocked-Gateway E2E cases passed (15.90 seconds total; 4.2 seconds in the test cases), and 52 performance-owner tests passed. The regressions failed before their fixes, including the real transcript file click, inactive pane presentation, missing timeout result, and failed acknowledgement recovery. UI typecheck, lint, styles, i18n verification, formatting, runtime/static import-cycle checks, and the production build pass. The final startup measurement is 371,541 B against the existing 371,581 B cap; no further budget increase. Codex autoreview is scoped-clean at P2 after correcting the failed-acknowledgement recovery finding.
Commands used:
Lint used the core UI lane selected by
check-changed, followed by a targeted rerun with the same configuration after its two test-only findings were fixed (file length and a shadowed variable). Native app execution remains outside this web PR's proof; host integration is the follow-up PR.Final hosted validation: CI run 36337483053 completed green for
ee84a153021cde35957f0af858ee1e3af6100a87, with no pending checks. ClawSweeper revision 2 reviewed that exact head and found no actionable defects; both original findings are addressed. No unrelated CI reruns were needed.Post-merge review update: ClawSweeper revision 3 added one accepted test-harness follow-up: allocate optional screenshot captures with
createControlUiE2eArtifactDirso repeated attempts retain separate evidence. That review update was missed during landing-tool recovery and read after merge. This follow-up remains outstanding; the already uploaded proof images are intact. No additional runtime defect was reported.