Repository navigation
fix(ui): allow opening completion-toast sessions in new tabs - #186028
Conversation
|
Codex review: needs changes before merge. What this changesThis PR renders completion-toast session actions as native links while preserving ordinary navigation and owner checks. Example: A background session finishes while an unsent draft remains on /new.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses a current navigation defect, but its new-tab destination can resolve against a different saved Gateway. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherBackground-session completion produces a toast whose action uses the shared session URL builder; primary clicks use application navigation, while alternate clicks start a new browser document. flowchart LR
A[Background run completes] --> B[Completion notice owner]
B --> C[Session URL builder]
C --> D[Toast link]
D --> E[Primary application navigation]
D --> F[New browser document]
F --> G[Startup Gateway selection]
Technical reviewBest possible solution: Bind alternate activation to the originating Gateway through the existing URL and startup owners, preserving native links, draft contents, and current authorization checks. Do we have a high-confidence way to reproduce the issue? Current-main markup establishes the middle-click failure; source and existing bootstrap tests also establish the introduced cross-tab Gateway mismatch, without executing target code. Is this the best way to solve the issue? Native links and the existing navigation helpers are the smallest appropriate approach, but their destination must preserve the submitting Gateway across document startup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 67ad5acf5f90. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +29, Tests +73. Total +102 across 5 files. Added test files: 0. 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 27, 2026, 11:02 AM ET / 15:02 UTC. |
|
Merged via squash.
|
The offline identity repair filtered bootstrap data at callers, discarding unscoped Gateway-wide names along with foreign scoped identities. Move that selection into the shared identity projection: scoped bootstrap facts require a matching agent and same-origin transport; cached agent facts outrank the unscoped name fallback. Keep account and access retirement at the caller. Correct the quota E2E's stale expectation that Main's scoped bootstrap name belongs to Work. Exercise scoped and unscoped bootstrap separately, reject late Main identity, and require Work's live identity after its response. The new foreign-Gateway unscoped-name regression fails on the prior head. All 164 focused unit cases and 32 of 36 selected E2E cases pass, including quota, warm boot, and offline titles. The four remaining browser failures reproduce on detached main 6172290: attachment-card size checks at both viewports (#186058) and completion-toast button lookups (#186028). Leave those inherited failures unchanged. UI typecheck, targeted lint, formatting, build, diff checks, and independent review through P2 pass. The production change is three lines smaller than the prior head. Release-note context: preserve Gateway-wide display-name fallbacks without borrowing scoped identity from another agent or Gateway.
#186028 renders a completion toast's action as an <a href> when it carries actionHref (so middle-click and Cmd-click open a new tab). The background new-session e2e still clicked a button named "Open", so desktop and mobile "starts a draft in the background" timed out after 30 s in checks-ui-e2e (seen on PR #186290). Click the "Open session" link instead; the test still proves a plain click opens the session in the current tab. Proof: ui/src/e2e/new-session-page.transition.e2e.test.ts 8/8 (44 s) with a fresh bundled build; only the background-session notice sets actionHref.
…6316) * fix(ui): retain cached agent identity through offline reloads Cached chat panes read assistant identity only from bootstrap config, which the offline shell cannot fetch, and reset the displayed name on transport edges. This made a custom agent show as Message Assistant until live identity arrived. Project display name and emoji from the existing admitted boot roster through the agent identity owner without admitting cached live discovery. Seed panes before their first render, retain identity through reconnect, and retire it across Gateway/account/recovery ownership changes. The boot-record read owns the connection-revision fence. Refresh cached facts from current discovery so reconnect cannot revive retired agents or old names. Proof: the warm-boot regression fails on base with Message Assistant, then passes with unavailable bootstrap config and Gateway hello held. All 11 warm-boot/offline-title E2E cases and 162 focused unit cases pass. UI typecheck, formatting, diff checks and production UI build pass. The real-Gateway network-fault rig retains Message Harbor proof assistant from its first cached render through offline reload and warm reconnect. Independent autoreview is clean through P2. Full pnpm lint reports inherited repository failures. After lint repairs, changed-file lint reports only bootstrap's pre-existing max-lines failure: 705 counted lines on base and 704 with this change, against a 700-line limit. The production build also reports a non-failing 29-byte CSS gzip overrun. Simplification: retain the placeholder history contract and remove three redundant current-placeholder assertions (11 test lines). All 11 focused E2E cases pass again; production behavior and the rig inputs are unchanged. Independent review of the simplification is clean through P2. * fix(ui): preserve unscoped identity across Gateway routes The offline identity repair filtered bootstrap data at callers, discarding unscoped Gateway-wide names along with foreign scoped identities. Move that selection into the shared identity projection: scoped bootstrap facts require a matching agent and same-origin transport; cached agent facts outrank the unscoped name fallback. Keep account and access retirement at the caller. Correct the quota E2E's stale expectation that Main's scoped bootstrap name belongs to Work. Exercise scoped and unscoped bootstrap separately, reject late Main identity, and require Work's live identity after its response. The new foreign-Gateway unscoped-name regression fails on the prior head. All 164 focused unit cases and 32 of 36 selected E2E cases pass, including quota, warm boot, and offline titles. The four remaining browser failures reproduce on detached main 6172290: attachment-card size checks at both viewports (#186058) and completion-toast button lookups (#186028). Leave those inherited failures unchanged. UI typecheck, targeted lint, formatting, build, diff checks, and independent review through P2 pass. The production change is three lines smaller than the prior head. Release-note context: preserve Gateway-wide display-name fallbacks without borrowing scoped identity from another agent or Gateway. * fix(ui): dismiss hover tooltips when typing elsewhere Growing the mobile command-palette draft can move an attachment action under a stationary pointer. Its tooltip can reopen after focus leaves and consume Escape at window capture, keeping the palette open. Dismiss active and pending tooltips on input outside their owned trigger and content through the existing close lifecycle. Preserve normal tooltip Escape behavior and the scoped identity cache. Proof: the new browser regression fails before the fix; all 29 tooltip browser cases pass in Chromium and WebKit. All 21 palette-drop, quota-pill, warm-boot, and offline-title e2e cases pass. The focused unit wrapper passes 205 cases across two shards. UI typecheck, changed-file lint, formatting, diff checks, and independent review through P2 pass. * test(ui): simplify identity regressions and fix textarea types The tooltip regression's inferred generic element type exceeded the core UI-components test compiler's union limit. Use an explicit native textarea type and verify the exact failing tsgo configuration. Consolidate identity reconnect and stale-fork cases without dropping their failure boundaries. Read quota identity and auth state in one snapshot, remove unused held-method replies, and use the shared E2E lifecycle instead of bespoke optional recording plumbing. Retain standard screenshots and all scoped, unscoped, stale-response, reconnect, and fork outcome assertions. Remove 149 test lines from the previous head, bringing this PR's net test line delta from +149 to zero. Do not change the ceiling. Detached main at 6b13100 independently has 6,289,898 lines against a 6,288,829 ceiling (over by 1,069); adding this PR's test diff leaves that count unchanged and the no-growth ratchet passes. Proof: exact UI-components, chat, and chat-E2E test typechecks; all 24 focused identity/quota/warm/offline-title/palette E2E cases; 204 focused unit cases; 29 tooltip browser cases each in Chromium and WebKit; changed-file lint, formatting, diff checks, simplification, and independent review through P2. No production behavior changes. Leave the inherited prompt-attachments failure and auto-merge settings untouched.
openclaw#186028 renders a completion toast's action as an <a href> when it carries actionHref (so middle-click and Cmd-click open a new tab). The background new-session e2e still clicked a button named "Open", so desktop and mobile "starts a draft in the background" timed out after 30 s in checks-ui-e2e (seen on PR openclaw#186290). Click the "Open session" link instead; the test still proves a plain click opens the session in the current tab. Proof: ui/src/e2e/new-session-page.transition.e2e.test.ts 8/8 (44 s) with a fresh bundled build; only the background-session notice sets actionHref.
…nclaw#186316) * fix(ui): retain cached agent identity through offline reloads Cached chat panes read assistant identity only from bootstrap config, which the offline shell cannot fetch, and reset the displayed name on transport edges. This made a custom agent show as Message Assistant until live identity arrived. Project display name and emoji from the existing admitted boot roster through the agent identity owner without admitting cached live discovery. Seed panes before their first render, retain identity through reconnect, and retire it across Gateway/account/recovery ownership changes. The boot-record read owns the connection-revision fence. Refresh cached facts from current discovery so reconnect cannot revive retired agents or old names. Proof: the warm-boot regression fails on base with Message Assistant, then passes with unavailable bootstrap config and Gateway hello held. All 11 warm-boot/offline-title E2E cases and 162 focused unit cases pass. UI typecheck, formatting, diff checks and production UI build pass. The real-Gateway network-fault rig retains Message Harbor proof assistant from its first cached render through offline reload and warm reconnect. Independent autoreview is clean through P2. Full pnpm lint reports inherited repository failures. After lint repairs, changed-file lint reports only bootstrap's pre-existing max-lines failure: 705 counted lines on base and 704 with this change, against a 700-line limit. The production build also reports a non-failing 29-byte CSS gzip overrun. Simplification: retain the placeholder history contract and remove three redundant current-placeholder assertions (11 test lines). All 11 focused E2E cases pass again; production behavior and the rig inputs are unchanged. Independent review of the simplification is clean through P2. * fix(ui): preserve unscoped identity across Gateway routes The offline identity repair filtered bootstrap data at callers, discarding unscoped Gateway-wide names along with foreign scoped identities. Move that selection into the shared identity projection: scoped bootstrap facts require a matching agent and same-origin transport; cached agent facts outrank the unscoped name fallback. Keep account and access retirement at the caller. Correct the quota E2E's stale expectation that Main's scoped bootstrap name belongs to Work. Exercise scoped and unscoped bootstrap separately, reject late Main identity, and require Work's live identity after its response. The new foreign-Gateway unscoped-name regression fails on the prior head. All 164 focused unit cases and 32 of 36 selected E2E cases pass, including quota, warm boot, and offline titles. The four remaining browser failures reproduce on detached main 1156516: attachment-card size checks at both viewports (openclaw#186058) and completion-toast button lookups (openclaw#186028). Leave those inherited failures unchanged. UI typecheck, targeted lint, formatting, build, diff checks, and independent review through P2 pass. The production change is three lines smaller than the prior head. Release-note context: preserve Gateway-wide display-name fallbacks without borrowing scoped identity from another agent or Gateway. * fix(ui): dismiss hover tooltips when typing elsewhere Growing the mobile command-palette draft can move an attachment action under a stationary pointer. Its tooltip can reopen after focus leaves and consume Escape at window capture, keeping the palette open. Dismiss active and pending tooltips on input outside their owned trigger and content through the existing close lifecycle. Preserve normal tooltip Escape behavior and the scoped identity cache. Proof: the new browser regression fails before the fix; all 29 tooltip browser cases pass in Chromium and WebKit. All 21 palette-drop, quota-pill, warm-boot, and offline-title e2e cases pass. The focused unit wrapper passes 205 cases across two shards. UI typecheck, changed-file lint, formatting, diff checks, and independent review through P2 pass. * test(ui): simplify identity regressions and fix textarea types The tooltip regression's inferred generic element type exceeded the core UI-components test compiler's union limit. Use an explicit native textarea type and verify the exact failing tsgo configuration. Consolidate identity reconnect and stale-fork cases without dropping their failure boundaries. Read quota identity and auth state in one snapshot, remove unused held-method replies, and use the shared E2E lifecycle instead of bespoke optional recording plumbing. Retain standard screenshots and all scoped, unscoped, stale-response, reconnect, and fork outcome assertions. Remove 149 test lines from the previous head, bringing this PR's net test line delta from +149 to zero. Do not change the ceiling. Detached main at 9c63f48 independently has 6,289,898 lines against a 6,288,829 ceiling (over by 1,069); adding this PR's test diff leaves that count unchanged and the no-growth ratchet passes. Proof: exact UI-components, chat, and chat-E2E test typechecks; all 24 focused identity/quota/warm/offline-title/palette E2E cases; 204 focused unit cases; 29 tooltip browser cases each in Chromium and WebKit; changed-file lint, formatting, diff checks, simplification, and independent review through P2. No production behavior changes. Leave the inherited prompt-attachments failure and auto-merge settings untouched.
Fixes #186020
What Problem This Solves
Middle-clicking Open session in a background-session completion toast does nothing.
User Impact
The completed session can open in another tab while the current conversation or unsent draft stays visible. Normal left-click navigation is preserved.
Why This Change Was Made
Render this navigation action as a native link using the existing session URL builder. Keep the captured Gateway-owner check for primary, modified, auxiliary, and context-menu events. Undo and Dismiss remain buttons.
Evidence
Risk and coverage
No new state or navigation owner. Production delta: +43/-14 lines; test delta: +74/-1 lines. Browser proof uses synthetic Gateway responses; CI results are pending.
Visual evidence
Background-session completion with an unsent draft, at the same 1360 × 1000 viewport. The navigation action keeps its appearance.
Toast action sequence at original speed. Alternative clicks preserve the current draft; a normal click then navigates. The new-tab destination is checked by the browser assertions described above.
186028-actions.mp4