Skip to content

improve(macos): replace browser cookie-import modal with an inline dashboard banner - #104591

Merged
steipete merged 6 commits into
mainfrom
claude/cookie-import-redesign-71bbdc
Jul 11, 2026
Merged

steipete merged 6 commits into
mainfrom
claude/cookie-import-redesign-71bbdc

Conversation

@steipete

@steipete steipete commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #104588

What Problem This Solves

The macOS app offered the browser cookie import (from #104057) through a blocking NSAlert that fired a few seconds after launch and again on control-channel connect. The modal stole focus from whatever the user was doing, buried import progress and results in follow-up alerts, and looked heavyweight for an optional offer.

Why This Change Was Made

An inline, dismissible banner is the established pattern for "import data from your browser" offers in desktop apps with a built-in browser. Moving the offer into the dashboard window keeps it discoverable without interrupting, and lets the same card show progress, the imported-cookie count, and errors inline instead of via stacked alerts.

User Impact

  • The dashboard window now shows a floating banner when a Chrome-family profile with cookies is available on a local Gateway: app icon with a globe badge, "Use your browser logins" title, a one-line summary of what gets copied (cookies only, never passwords), an Import control (a menu when several profiles qualify), and a dismiss ×.
  • Import progress ("Touch ID may be required"), the imported count ("409 of 412 cookies copied into "imported""), and failures (with Retry) all render in the same banner.
  • Dismissing persists via the existing /system-profile-import/dismiss endpoint and sticks for the session even if the write is slow or lost; automatic status polls can never resurrect a dismissed offer or clobber a fresher banner state (generation-guarded).
  • Settings → General → Browser login → Import… still force-re-offers (even after dismissal) and now opens the dashboard so the banner is visible; unavailable states keep their explanatory alerts.
  • The banner withdraws when the app switches to a remote gateway, since the import endpoints are host-local.
  • Banner copy is wrapped in String(localized:) and tracked in the native i18n inventory.
  • No more launch-time modal.

Screenshots

Offer Importing
offer importing
Imported Failed
imported failed

Placement in the dashboard window (floating, centered, below the titlebar chrome):

dashboard

(Captured via a headless window harness; the Import button renders with its accent tint and the real app icon in the live app.)

Evidence

  • BrowserProfileImportPrompter (modal NSAlert + popup picker + result alerts) is replaced by BrowserProfileImportModel, an @Observable state machine (hidden → offering → importing → imported/failed) with an injectable transport, plus BrowserProfileImportBannerView (SwiftUI) hosted in the dashboard pane.
  • Race hardening from structured review: cross-browser SwiftUI menu identity (menuID), a phase-generation guard so stale status polls never clobber or resurrect user-driven state, and session-sticky dismissal (force refresh still overrides). Each has a dedicated regression test.
  • swift test --package-path apps/macos --filter BrowserProfileImport: 15 tests pass (offer gating, refresh outcomes, import success/failure/retry, dismissal persistence/suppression, stale-poll races, banner copy/actions).
  • Full suite swift test --package-path apps/macos --parallel: 1039 tests, 133 suites, all pass locally; hosted CI green on this branch.
  • Codex structured review (gpt-5.5, xhigh): three earlier findings fixed with regression tests; final run clean — "no accepted/actionable findings".
  • swiftformat --lint and swiftlint (CI config) clean; pnpm native:i18n:check clean after inventory sync; pnpm docs:map:gen refreshed.
  • Docs: added an "Import browser logins" section to docs/platforms/macos.md.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos size: XL maintainer Maintainer-authored PR labels Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c3dbd3a47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

: "System browser profile import is disabled in the local Gateway configuration."
return .unavailable(title: "No browser login available", message: message)
}
self.phase = .offering(status)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recheck mode before publishing refresh results

When a launch/connect/window refresh starts in Local mode and the user switches to Remote before /system-profile-import/status returns, handleConnectionModeChange() hides the banner but this stale continuation still publishes .offering(status). The callers can overlap (MenuBar.swift:83, MenuBar.swift:450, DashboardWindowController.swift:277), and importProfile only checks for .offering, so the remote dashboard can show a host-local import offer and allow the import action after the gateway switch. Recheck isLocalMode() or a refresh generation after the await before setting phase.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6c7b8ba1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

: "System browser profile import is disabled in the local Gateway configuration."
return .unavailable(title: "No browser login available", message: message)
}
self.phase = .offering(status)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve in-flight import state before re-offering

When the Settings Import… button calls refresh(force: true) while a banner import is already in .importing, this continuation can publish a new .offering after the status GET returns, replacing the progress/result banner and re-enabling the Import control while the first /profiles/import request is still in flight. Fresh evidence beyond the existing remote-mode race is the new force path in GeneralSettings.swift:128, which has no phase guard; the deleted prompter's isPrompting kept this path blocked until the import finished.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 8e546f3e548f77750ee17d89529ca1b95f5ef1fc, but the PR head is now 81765de36ae9a39962e0fd965b372dbe306397a7. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (2 earlier review cycles)
  • reviewed 2026-07-11T17:49:14.511Z sha 358af1e :: needs real behavior proof before merge. :: [P2] Recheck Local mode before publishing the status result | [P2] Drop import completions after switching to Remote | [P2] Localize the new banner content
  • reviewed 2026-07-11T17:57:26.760Z sha 8e546f3 :: needs real behavior proof before merge. :: [P2] Drop import completions after leaving Local mode | [P2] Localize the banner content before rendering it

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 358af1eab1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +175
self.phase = .imported(result)
} catch {
self.phase = .failed(message: error.localizedDescription, retry: status)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Drop stale import results after mode switches

When the user starts an import in Local mode and switches to Remote before the 120s /profiles/import call returns, handleConnectionModeChange() has already hidden the local-only banner, but this continuation unconditionally republishes .imported/.failed. The dashboard can then show a host-local import result or retry while connected to a remote Gateway; recheck isLocalMode() or a request generation before setting phase.

Useful? React with 👍 / 👎.

Comment on lines +33 to +35
title: "Use your browser logins",
subtitle: "Copy cookies from \(browsers) into an isolated agent profile. " +
"Passwords are never touched.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Localize banner copy before rendering from strings

This new banner copy is kept as plain String fields and rendered later via Text(content.title)/Text(content.subtitle), so SwiftUI treats it as verbatim and scripts/native-app-i18n.ts does not put strings like Use your browser logins in apps/.i18n/native-source.json. In localized macOS builds the inline banner stays English even though this replaces a localized alert; wrap the copy in String(localized:)/LocalizedStringResource or otherwise feed it to the native i18n pipeline.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 11, 2026
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Jul 11, 2026
@steipete
steipete merged commit 9ad59ae into main Jul 11, 2026
86 of 91 checks passed
@steipete
steipete deleted the claude/cookie-import-redesign-71bbdc branch July 11, 2026 18:11
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…shboard banner (openclaw#104591)

* feat(macos): replace browser cookie-import modal with dashboard banner

* fix(macos): cross-browser menu identity, banner pane ownership, docs map

* chore: refresh native i18n inventory

* fix(macos): stale import status polls no longer clobber fresher banner state

* fix(macos): generation-guard stale import polls; drop dashboard-show poll trigger

* fix(macos): session-sticky dismissal and localized banner copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: replace modal browser cookie-import prompt with an inline dashboard banner

1 participant