Repository navigation
feat(macos): show web composer badges and session actions in the sidebar - #163193
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed October 1, 2026, 11:44 PM ET / October 2, 2026, 03:44 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR adds web-owned draft and outbox badges to the macOS sidebar and lets its session menus open the selected conversation’s web actions. Merge readiness✅ Ready for maintainer review This remains a useful continuation of the landed native-menu work. Current main lacks the requested capability, the inspected proof supports the visible behavior, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe macOS conversation bridge connects the native sidebar to the Gateway’s embedded web chat. It projects composer metadata into native rows and returns action-menu requests to the web owners that execute them. flowchart LR
A[Web composer and outbox] --> B[Bounded metadata snapshot]
B --> C[Document-bound conversation bridge]
C --> D[Native sidebar badges]
E[Native More actions selection] --> C
C --> F[Selected web session menu]
F --> G[Existing plugin and worker actions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +249, Tests +421, Docs +7, Other +330. Total +1007 across 33 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep native presentation as a document-bound projection while composer state, confirmations, and action execution remain with the existing web owners. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this adds a capability absent from current main, and inspected native screenshots demonstrate the visible after-change flow. Is this the best way to solve the issue? Yes. Negotiated metadata projection and menu handoff extend the existing bridge without creating another composer, plugin execution, or worker-stop owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2fc571a22758. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
…ve app Keep conversation contract 1 and negotiate sidebar facts/actions with host features. Forward the existing sidebar's document-bound, bounded draft/attention projection without composer or transcript content. Open the current web session menu through the existing navigation path; plugin execution and worker Stop stay with web owners. The chat header previously lacked sidebar plugin/Stop entries. Expose their existing owners only for negotiated native hosts. A quick menu selection confirms opening before its animation ends. Compact menu reset stays with the existing open hook. Follow-up: Control UI durable-draft badges after reload. The current sessionStorage projection does not enumerate IndexedDB drafts until their pane restores them (outbox-store-projection.ts; composer-draft-store.runtime.ts; durable-composer-persistence.ts). This deliberately preserves the web sidebar's current behavior on both surfaces. Validation: focused web tests, native-conversation E2E, Stop ordering regressions, UI/core/root typechecks, localization/performance tests, and P2 autoreview.
Render web-owned draft pencils and outbox attention counts for sidebar sessions. Retire facts and actions with the trusted document, and hide More actions for older UI documents. Reserve the clicked target before navigating to its web actions menu. Keep keyboard focus in that menu and leave plugin/worker execution with web owners. Align the native command waiter with the web's 15-second deadline; retain the separate 10-second document readiness timeout. Match web slash encoding when enforcing the snapshot byte limit, so valid snapshots do not retain stale badges. Quick Chat and iOS retain their existing Swift ownership and behavior. Validation: native/default app builds, macOS test compilation, focused Swift contract/row/menu and ownership/draft/outbox/route suites, localization checks, and P2 autoreview. Native app launch and full native tests remain with the coordinator's isolated live-proof rig; no push or publication.
Preserve durable draft ownership, omit inactive badge rows, and memoize native action presentation without duplicating web execution. Reconcile native test waits and record the measured startup budget within the approved sub-1% allowance.
046e75e to
3b05933
Compare
|
Land-ready review for The web composer/outbox remain authoritative. Native rows receive bounded, capability-negotiated facts; More actions… uses the existing web navigation and action owners. The canonical projection preserves account/revision fences and omits inactive facts. The only conflict resolution retained main's pull-request menu wrapper. Final production delta is +464/−45; tests +619/−44. The native/shared/iOS builds and focused checks are recorded in the body. Final-head CI: https://github.com/openclaw/openclaw/actions/runs/36961125051. The earlier iOS smoke and screenshot failures all came from one strict-lint warning; it was reproduced and fixed by splitting the badge arguments, followed by a single code-fix push. No workflow/job reruns or main-chasing refreshes were used. The latest ClawSweeper review is on this exact head, with no actionable/security findings and no published rank-up moves. Its proof confidence is 5/6. The full independent review's three INDEX-only findings were already corrected in the committed candidate; the agent-identity finding was disproved at the canonical caller. The final formatting-only review is scoped-clean at P2. All four PNGs were visually inspected, embedded in the body, and downloaded from their uploaded URLs: 200 image/png, with SHA-256 equal to each original. The captures are synthetic, include the documented light/dark difference, and predate the preserved mechanical rebase. Native runtime verification ran on disposable macOS CI; no browser automation or operator app was launched by this landing worker. Local verification commandsexport DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
node scripts/run-vitest.mjs --config ui/vitest.config.ts --project unit --project unit-mock-registry ui/src/app/native-conversation-bridge.test.ts ui/src/lib/chat/outbox-store.test.ts ui/src/lib/chat/outbox-store-projection.test.ts ui/src/pages/chat/chat-pane-session-menu.test.ts ui/src/pages/chat/components/chat-header-session-menu.test.ts ui/src/app/app-host-native-shell.test.ts ui/src/app/app-host-pairing-access.test.ts
pnpm ui:build
pnpm ui:check-performance --json
pnpm tsgo:ui
node scripts/run-vitest.mjs test/scripts/control-ui-performance.test.ts
swift build --package-path apps/macos --build-system native --product OpenClaw
swift build --package-path apps/macos --product OpenClaw
swift build --package-path apps/macos --build-system native --build-tests
swift build --package-path apps/shared/OpenClawKit --build-system native --build-tests
swift build --package-path apps/shared/OpenClawKit --build-system native --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator27.0.sdk --triple arm64-apple-ios18.0-simulator --target OpenClawChatUI
pnpm native:i18n:baseline
pnpm native:i18n:verifyChanged production Swift files were passed explicitly to Startup gzip is 372,863 B; the approved baseline/cap adjustment is 0.298%. Chat/new boot requests are 32/27 against 35. The obsolete largest-chunk ceiling increase was removed. |
|
Merged via squash.
|
…bar (openclaw#163193) * feat(ui): publish sidebar facts and open session actions for the native app Keep conversation contract 1 and negotiate sidebar facts/actions with host features. Forward the existing sidebar's document-bound, bounded draft/attention projection without composer or transcript content. Open the current web session menu through the existing navigation path; plugin execution and worker Stop stay with web owners. The chat header previously lacked sidebar plugin/Stop entries. Expose their existing owners only for negotiated native hosts. A quick menu selection confirms opening before its animation ends. Compact menu reset stays with the existing open hook. Follow-up: Control UI durable-draft badges after reload. The current sessionStorage projection does not enumerate IndexedDB drafts until their pane restores them (outbox-store-projection.ts; composer-draft-store.runtime.ts; durable-composer-persistence.ts). This deliberately preserves the web sidebar's current behavior on both surfaces. Validation: focused web tests, native-conversation E2E, Stop ordering regressions, UI/core/root typechecks, localization/performance tests, and P2 autoreview. * feat(macos): show web composer badges and session actions in the sidebar Render web-owned draft pencils and outbox attention counts for sidebar sessions. Retire facts and actions with the trusted document, and hide More actions for older UI documents. Reserve the clicked target before navigating to its web actions menu. Keep keyboard focus in that menu and leave plugin/worker execution with web owners. Align the native command waiter with the web's 15-second deadline; retain the separate 10-second document readiness timeout. Match web slash encoding when enforcing the snapshot byte limit, so valid snapshots do not retain stale badges. Quick Chat and iOS retain their existing Swift ownership and behavior. Validation: native/default app builds, macOS test compilation, focused Swift contract/row/menu and ownership/draft/outbox/route suites, localization checks, and P2 autoreview. Native app launch and full native tests remain with the coordinator's isolated live-proof rig; no push or publication. * fix(macos): reconcile sidebar bridge with current UI owners Preserve durable draft ownership, omit inactive badge rows, and memoize native action presentation without duplicating web execution. Reconcile native test waits and record the measured startup budget within the approved sub-1% allowance. * style(macos): format sidebar badge arguments for strict lint
* fix(ui): wait for native session actions to become ready 35b8a1a (#163193) introduced a readiness race: the native command queries the session menu before metadata renders it. A settled route and Lit update do not guarantee that the selected session's header exists, so valid commands can return unavailable. Wait for the menu within the existing command deadline and cancellation scope, then retain the acknowledgement after the menu actually opens. Cover delayed readiness, superseded selection, and retired documents. * fix(ui): finish native session menu contract migration Update the sibling popup-boundary test to pass the containing pane and await the dropdown's Lit update. Keep all four outcomes and assertions. Rename the observer callback bindings to avoid shadowing the resolved menu. Fixes the type, lint, and UI unit failures introduced by eb1cdec. Validated the UI-chat test graph, touched-file and boundary lint, 59 unit tests across both owner files, and all six native-conversation e2e cases.
…3351) * fix(ui): wait for native session actions to become ready 584d1b0 (openclaw#163193) introduced a readiness race: the native command queries the session menu before metadata renders it. A settled route and Lit update do not guarantee that the selected session's header exists, so valid commands can return unavailable. Wait for the menu within the existing command deadline and cancellation scope, then retain the acknowledgement after the menu actually opens. Cover delayed readiness, superseded selection, and retired documents. * fix(ui): finish native session menu contract migration Update the sibling popup-boundary test to pass the containing pane and await the dropdown's Lit update. Keep all four outcomes and assertions. Rename the observer callback bindings to avoid shadowing the resolved menu. Fixes the type, lint, and UI unit failures introduced by eb1cdec. Validated the UI-chat test graph, touched-file and boundary lint, 59 unit tests across both owner files, and all six native-conversation e2e cases.
What Problem This Solves
The native macOS sidebar could not show web composer drafts or outbox attention, and its row menus could not reach web-owned plugin actions and Stop cloud worker….
Related: #163001 (native sidebar session menus), which deferred these web-owned actions to More actions….
User Impact
With the Native experience and a supporting Gateway UI, session rows show the web sidebar's draft pencil and outbox attention count. More actions… selects that conversation and opens its existing web session menu. Confirmation, progress, errors, plugin execution, and worker stopping remain in the web conversation. iOS, Quick Chat, and the Swift fallback keep their existing behavior; the shared kit still compiles for iOS.
Why This Change Was Made
The web pane owns composer state and these operations. Contract v1 now negotiates
session-facts-v1andsession-actions-v1, publishes bounded metadata-only snapshots, and hands menu opening back to that owner. Native projections and callbacks retire with their document. The native command waiter is 15 seconds; readiness remains 10 seconds. Menu opening is acknowledged independently of long-running operations.Rebase integration preserves main's durable and attachment-only draft recovery, revision/identity fences, and unchanged-menu rendering. Cleared/no-attention rows are omitted from the bounded snapshot; they must not displace real badges. Native action presentation uses the existing header memoization pattern and current-row callback, while execution stays with the existing web owners. Three native tests now use main's canonical observed wait helper.
Production: +464/−45 (net +419). Tests: +619/−44. Tooling/budget metadata: +5/−5; docs: +7; generated native localization inventory: +6. Production growth implements the two new capabilities, bounded cross-language admission, document lifecycle cleanup, and native presentation. There is no second plugin execution or worker-reclaim path.
The original lane grew startup gzip by 90 B and raised the largest-chunk ceiling from 220,160 B to 222,350 B (+0.9947%). After rebasing, the largest chunk measures 183,515 B, so that obsolete ceiling increase is removed. The measured startup baseline/cap is now 372,878 B, versus 371,771 B before (+1,107 B, 0.298%), within the authorized sub-1% rule. The 512 B growth allowance and 64 B variance allowance are unchanged. The initial matched-toolchain main measures 372,406 B and the candidate 372,579 B (+173 B, 0.046%); main itself exceeded the old enforcement limit. The comparison passed in 45.49 s. Startup and route boot request budgets pass.
Evidence
The lane's recorded pre-change proof failed at absent capabilities (18.82 s), and its baseline Swift decoder rejected session facts (0.84 s). The lane also recorded six native-conversation web E2Es passing (57.85 s), 33 Stop/startup-owner checks passing, and a real Foundation/Node byte-count regression: slash-heavy JSON was incorrectly counted as 121,547 B instead of 61,547 B before
.withoutEscapingSlashes.The supplied live rig served this branch's Control UI build through
gateway.controlUi.rootwhile the native build drove it. The captures below show the native draft badge, native More actions…, and the resulting web menu. They are pre-rebase rig evidence; no browser or browser automation was used during landing. Native WebKit/WebChat runtime tests are compiled locally and run on the exact-head disposable macOS CI worker, not on the operator desktop.An initial local UI lint prerequisite detected files appearing during the concurrent iOS build; after native compilation finished, the unchanged lint preparation and checks passed. Initial stale Mermaid dependencies were refreshed with the frozen lockfile before rebuilding.
All screenshot data is synthetic; avatars are blurred. The draft-badge capture uses dark appearance, while the before/menu captures use light appearance.
Autoreview returned a nonzero findings result for the mixed index/working-tree target. Three INDEX-only findings (removed Swift wait helper, inactive facts, and account-less test fixture) explicitly recognized their fixes in the working tree; those tested fixes are included in the final commit. The agent-identity finding is rejected:
apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebar+ContextMenu.swift:24resolves the key-first agent plus mutation-target fallback before constructing the private row menu. Repeating that policy inside the menu would duplicate its owner. No accepted finding remains unresolved; this is a dispositioned review, not an unqualified scoped-clean result.After GitHub reported a real conflict, the branch was rebased once onto main
81f65e98ad4e. The only manual resolution preserves the new pull-request menu wrapper and places More actions… after it; the range diff shows no other bridge behavior change. All affected checks above were repeated. Startup remeasured 372,863 B gzip, with zero budget violations; chat/new boot requests remain 32/27 against the 35 limit. The original CI run 36958028303 was superseded by this conflict repair, not rerun to obtain green. The fresh autoreview dispositions remain applicable to the unchanged bridge logic.CI run 36959763696 completed with the macOS packages and runtime test jobs green; the Swift runtime test step ran successfully for 8m13s. Its three iOS failures all reported the same branch-owned
multiline_argumentswarning in the badge initializer, promoted to an error by CI’s--strict. The warning was reproduced locally, then fixed by placingcounton its own line. Strict lint now passes for every touched production Swift file under the macOS and iOS configs (0.10/0.14 s), with SwiftFormat (0.27 s) and i18n verification green. A fresh single-pass autoreview of this formatting-only diff is scoped-clean at P2 (195.66 s). This code-fix push uses head81d69b8c5ef9d077661368b0d69433b48050c5bb; no workflow or job was manually rerun.