Skip to content

fix(ui): allow opening completion-toast sessions in new tabs - #186028

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/toast-session-link
Oct 27, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/toast-session-link

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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

  • Real Chromium flow with a mocked Gateway: start a background session, complete it, then middle-click or Cmd/Ctrl-click the toast. Both open the expected session URL and preserve the current draft; right-click leaves the current page in place; left-click navigates once.
  • The browser regression fails on the base because no new tab opens, and passes with the fix (3.76 seconds of test time; 6.47 seconds total).
  • Existing toast tests: 19 passed. Background-completion tests: 20 passed, including stale Gateway/account/credential checks for alternative activation. Combined command wall time: 5.06 seconds.
  • UI typecheck, targeted lint, formatting, and independent code review passed.

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.

Before After
Before: completion toast After: completion toast with a native session link

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

@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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.

  • Before: Middle-clicking Open session does nothing.
  • After: Middle-clicking opens /chat/main/toast-completion in another tab and preserves the draft.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The bounded native-link approach is useful, but the destination-Gateway defect blocks correctness and the supplied browser coverage checks only the popup URL.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports Chromium coverage with a mocked Gateway, and no attached live artifact was supplied.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users cannot open a completed background session in another tab while keeping their current conversation or draft visible.
Reason: The maintainer-authored direction provides standard link behavior through existing owners without adding configuration or persistent state.

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
Reviewed head: f13fb32275ac0b3b2e64a1953de1133b6fa88536

Before merge

  • Preserve the source Gateway in the new-tab destination (P2) - Keep tab A connected to Gateway A, then select Gateway B in another tab on the same UI origin. Mounted runtimes intentionally retain their own connection, but new documents load the shared saved selection (settings.ts:357-403, bootstrap-connection.ts:26-30); existing bootstrap coverage demonstrates this distinction. This href contains only a session path, so middle-clicking A's completion toast starts the destination on B. isCurrentOwner() still passes because A itself has not changed. The result is a missing session or an unrelated B conversation rather than the completed A session. Bind the destination to the originating Gateway through the existing navigation/startup contract and cover the destination's actual Gateway and session, rather than only its pathname.

Findings

  • [P2] Preserve the source Gateway in the new-tab destination — ui/src/pages/new-session/background-session-notice.ts:131-132

Tests

  • Missing end-to-end proof: The browser case does not verify the destination Gateway and loaded conversation after another tab changes the saved Gateway selection.
Agent review details

How this fits together

Background-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]
Loading

Technical review

Best 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:

  • [P2] Preserve the source Gateway in the new-tab destination — ui/src/pages/new-session/background-session-notice.ts:131-132
    Keep tab A connected to Gateway A, then select Gateway B in another tab on the same UI origin. Mounted runtimes intentionally retain their own connection, but new documents load the shared saved selection (settings.ts:357-403, bootstrap-connection.ts:26-30); existing bootstrap coverage demonstrates this distinction. This href contains only a session path, so middle-clicking A's completion toast starts the destination on B. isCurrentOwner() still passes because A itself has not changed. The result is a missing session or an unrelated B conversation rather than the completed A session. Bind the destination to the originating Gateway through the existing navigation/startup contract and cover the destination's actual Gateway and session, rather than only its pathname.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 67ad5acf5f90.

Provenance checked

  • Toast action rendering changes intended behavior with a stated reason (ecdc40d: The Solid migration preserved existing toast callbacks, dismissal behavior, and service contracts.)
  • Completion-action owner checks keeps the original intent (fix: stale completion notices open sessions on a different Gateway #157103: Prevent delayed completion actions from changing another Gateway's selected conversation while allowing same-owner reconnects.)
  • Non-navigation toast actions keeps the original intent (39ddf71: Provide reversible session archiving through an Undo action.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test:ui:e2e ui/src/e2e/native-notifications-loading.e2e.test.ts
  • pnpm --dir ui test src/pages/new-session/draft-submission-background.test.ts src/lib/toast.test.ts src/app/bootstrap.gateway-credentials.test.ts
  • git diff --check

What I checked:

PR surface

Source +29, Tests +73. Total +102 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 43 14 +29
Tests 2 74 1 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 117 15 +102

Labels

Label changes:

  • add P2: Alternate-tab navigation is a useful bounded workflow improvement; ordinary primary navigation remains available.
  • add merge-risk: 🚨 session-state: The new document can interpret the completed session's path on another tab's saved Gateway, selecting an unrelated conversation or failing to find the intended one.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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: Alternate-tab navigation is a useful bounded workflow improvement; ordinary primary navigation remains available.
  • merge-risk: 🚨 session-state: The new document can interpret the completed session's path on another tab's saved Gateway, selecting an unrelated conversation or failing to find the intended one.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 27, 2026, 11:02 AM ET / 15:02 UTC.

@vyctorbrzezowski vyctorbrzezowski changed the title fix(ui): open completion-toast sessions in new tabs fix(ui): allow opening completion-toast sessions in new tabs Oct 27, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 91e8cd0 into main Oct 27, 2026
125 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/toast-session-link branch October 27, 2026 20:34
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 27, 2026
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.
steipete added a commit that referenced this pull request Oct 27, 2026
#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.
steipete added a commit that referenced this pull request Oct 28, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…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.
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: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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.

[Bug]: Completion toast cannot open its session in a new tab

1 participant