Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Spaces macOS: one Settings, the in-app page; remove the native Settings window (CUA-2315) (#5994)

cua-agents[bot]a2d3e58e9c18
diff --git a/apps/cua-spaces-macos/README.md b/apps/cua-spaces-macos/README.md
index cd3c40720c..9dbed5fe8d 100644
--- a/apps/cua-spaces-macos/README.md
+++ b/apps/cua-spaces-macos/README.md
@@ -12,7 +12,7 @@ render and do platform glue.
| New Space | Step-by-step sheet: System, Resources, Options, Summary; Connect by address |
| Keyvault | Sidebar and list: categories, a site's accounts with their unattended switches, approval sheets |
| Onboarding | The shared web onboarding (`/onboarding` in `apps/cua-spaces-web`), in the New UI window, whether or not the New UI setting is on; the app draws none of its own. The page asks and finishes it through `onboarding.get` and `onboarding.complete` (the state is `onboarding.json`); a Space it creates posts a "<Space> is ready" notification (`notifyWhenReady`) that opens the Space. With the New UI off, the window gives way to the native one when the first run ends. A launch (or a window that opens again) while it is not done opens `/onboarding?due=1`: the page goes to Spaces instead when the person chose "Skip for now" (kept in the page's storage), so the welcome does not come back at every launch; Settings → Welcome and the sidebar's "Finish setting up" open it without `due` and always show it |
-| Devices | Settings → Devices: this Mac's enrollment (enrolled until, grace ends, needs enrollment), the account's devices with Rename and Revoke, Recent Access; the Enroll sheet (sign in again, or a one-time code approved from an enrolled device), the approval sheet for a device asking to join (a notification too; Approve asks for Touch ID or the login password), and a banner in the main window when this Mac needs enrolling |
+| Devices | Settings → Trusted devices (the page's): this Mac's enrollment (enrolled until, grace ends, needs enrollment), the account's devices with Rename and Revoke, Recent Access; the Enroll sheet (sign in again, or a one-time code approved from an enrolled device), the approval sheet for a device asking to join (a notification too; Approve asks for Touch ID or the login password), and a banner in the main window when this Mac needs enrolling |
| Menu bar | The Cua mark (template); status line, Open, New Space, Settings, Quit |
| Launch at login | Settings → General: `SMAppService.mainApp`, showing what macOS reports (on, off, waiting for approval with a button to Login Items, not found); the first run's Done page (the web onboarding's) ticks it. A login launch opens without the main window, and the app's daemon (host Spaces, persistent agents, Cua Volume) starts with it |
| Join with a code | `host.joinWithCode` runs the bundled `cua host setup --pair <code>` (3 minute limit); `cua://add/<CODE>` opens Machines at `?join=<CODE>` and the page asks before joining |
@@ -92,7 +92,7 @@ UI tests (XCUITest) need Xcode: `xcodegen generate` (project.yml), then
Environment (debug builds only; release builds ignore every `CUA_SPACES_*` hook):
`CUA_SPACES_FIXTURES=1` runs on fixtures (no daemon, no Space, an in-memory login item whose status `CUA_SPACES_LOGIN_ITEM` sets: `enabled`, `notRegistered`, `requiresApproval`, `notFound`; a relay allowance `CUA_SPACES_RELAY_USAGE` sets: `reached`, `team`, `none`, default the free plan within it);
-`CUA_SPACES_START_VIEW` opens `new-space`, `keyvault`, `approval`, `settings-devices`, `settings-about`, `device-approval` (with `CUA_SPACES_APPROVE_CODE`), `device-enroll`, `device-enroll-code`,
+`CUA_SPACES_START_VIEW` opens `new-space`, `keyvault`, `approval`, `settings` (presses ⌘,), `device-approval` (with `CUA_SPACES_APPROVE_CODE`), `device-enroll`, `device-enroll-code`,
`onboarding`, `stream` (the Space detail at its Stream section), `window-pip` (the same, with the first window popped out), `teleport-picker` (the Space's teleport picker; set `CUA_TELEPORT_APP_ROOTS` to fixture apps for images), `run-timeline` (an agent run's conversation from the Space's Agents section; fixtures give `local:aurora` two runs) or a notch state (`notch-open`, which springs
open 1.5 s after launch, `notch-hover`, `notch-permission`,
`notch-drag-target`, `notch-drop`); `CUA_SPACES_SELECT`
@@ -179,10 +179,12 @@ page: `spaces.createOptions` is the env the native sheet opens with
(`AppModel.runCreate`). While the `web_ui` experiment is on, every New Space
item (⌘N, the menu bar, the toolbar, a machine's "New Space on…") opens the
New UI window's wizard (`spaces.newRequested`); the native sheet is the
-fallback when it is off. The app menu's Settings command (⌘,) opens the New UI's
-Settings (`settings.openRequested`) while its window is the key window (or, with no key
-window, the frontmost one), even when its web view has no focus; with any other window
-in front it opens the native Settings scene (`WebUIWindowController.openSettings`).
+fallback when it is off. Settings is only the New UI's page (Account, General,
+Connected apps, Trusted devices, Advanced, About): the app menu's "Settings…" (⌘,),
+the menu bar item, the notch and the command palette all open it in the New UI
+window, with New UI on or off (`MainUIRouter.openSettings`,
+`WebUIWindowController.openSettings`; an open window gets `settings.openRequested`).
+There is no native Settings window.
Keyvault unlocks use the native
prompt and the daemon's Touch ID; a passphrase never crosses the bridge.
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift
index 0ac7ae2e00..dea804cb71 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift
@@ -415,9 +415,7 @@ public enum AppEnvironment {
/// `CUA_SPACES_START_VIEW`: `new-space`, `new-space-picker`, `new-space-resources`, `keyvault`, `keyvault-waiting`,
/// `approval`, `onboarding` (the first run, in the New UI window), `this-machine`, `host-setup`,
- /// `host-configured`, `settings`, `settings-devices` (Settings on its
- /// Devices tab), `settings-about` (on its About tab), `settings-experiments`
- /// (on its Experiments tab), `device-approval` (the approval sheet for the first
+ /// `host-configured`, `settings` (the app menu's ⌘, item), `device-approval` (the approval sheet for the first
/// device asking; `CUA_SPACES_APPROVE_CODE` types its code),
/// `device-enroll` (the enroll sheet), `device-enroll-code` (it, having
/// chosen Approve from another device), `space`, `space-window` (the selected
@@ -496,16 +494,9 @@ public enum AppEnvironment {
// The Volume page shows with Cua Volume on (this run only).
model.settings.experiments.cuaVolume = true
model.selection = .drive
- case "settings", "settings-devices", "settings-storage", "settings-about", "settings-experiments":
- if env["CUA_SPACES_START_VIEW"] == "settings-devices" { model.settingsTab = .devices }
- if env["CUA_SPACES_START_VIEW"] == "settings-about" { model.settingsTab = .about }
- if env["CUA_SPACES_START_VIEW"] == "settings-experiments" { model.settingsTab = .experiments }
- if env["CUA_SPACES_START_VIEW"] == "settings-storage" {
- // Storage shows with the Cua Volume experiment on (this
- // run only; the settings file is not written).
- model.settings.experiments.cuaVolume = true
- model.settingsSection = "storage"
- }
+ case "settings":
+ // The app menu's ⌘, item, as a person presses it: the
+ // page's Settings in the New UI window.
try? await Task.sleep(for: .seconds(2))
NSApp.activate()
if let item = NSApp.mainMenu?.items.first?.submenu?.items.first(where: { $0.keyEquivalent == "," }),
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
index 6ed9f1f2e5..3167bd680f 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
@@ -14,15 +14,6 @@ public struct PendingTeleport: Equatable {
public var files: [String]
}
-/// The Settings window's tabs.
-public enum SettingsTab: Hashable, Sendable {
- case general
- case agents
- case devices
- case experiments
- case about
-}
-
/// What the main window shows.
public enum MainSelection: Hashable {
case space(String)
@@ -114,10 +105,6 @@ public final class AppModel {
public let cloud: CloudModel
/// The cloud hosts the elastic pool added (Machines), read-only.
public let elastic: ElasticModel
- /// The Settings tab showing.
- public var settingsTab: SettingsTab = .general
- /// A Settings section to scroll to when Settings opens (captures).
- public var settingsSection: String?
/// The Cua account, the telemetry switch and the coding agents.
let account: AccountRunning?
let telemetry: TelemetryRunning?
@@ -1805,8 +1792,8 @@ public final class AppModel {
/// Reads the usage-data switch alone. The web page gets it with its
/// Settings snapshot (`settings.get`) and drops every usage signal while
- /// that has none, so it cannot wait for the native Settings view's
- /// `loadSettings` (the page runs signed out, before any Settings view).
+ /// that has none, so it cannot wait for `loadSettings` (the page runs
+ /// signed out, before Settings opens).
public func refreshTelemetry() {
telemetryInput = telemetry?.status()
}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AboutView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AboutView.swift
deleted file mode 100644
index bca6fa75e5..0000000000
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AboutView.swift
+++ /dev/null
@@ -1,239 +0,0 @@
-// SPDX-License-Identifier: FSL-1.1-MIT
-// Copyright (c) 2026 Cua AI, Inc.
-
-import AppKit
-import CuaSDK
-import CuaSpacesFFI
-import SwiftUI
-
-/// Settings → About: the icon, name and version, the links, the copyright,
-/// then the update controls. Everything shown is the core's `appAboutView`;
-/// the updater is Sparkle's.
-struct AboutSettingsView: View {
- @Bindable var updates: UpdatesModel
- @State private var showingNotices = false
- @Environment(\.openURL) private var openURL
-
- var body: some View {
- let v = updates.view
- VStack(spacing: 0) {
- VStack(spacing: 6) {
- Image(nsImage: NSApp.applicationIconImage)
- .resizable()
- .frame(width: 72, height: 72)
- .accessibilityHidden(true)
- Text(v.title)
- .font(.title3.weight(.semibold))
- .accessibilityIdentifier("about-title")
- Text(v.versionLine)
- .font(.callout)
- .foregroundStyle(.secondary)
- .textSelection(.enabled)
- .accessibilityIdentifier("about-version")
- }
- .padding(.bottom, 14)
- VStack(spacing: 4) {
- ForEach(v.links, id: \.label) { link in
- Button(link.label) { open(link) }
- .buttonStyle(.link)
- .accessibilityIdentifier("about-\(Self.id(link.id))")
- }
- }
- .padding(.bottom, 14)
- Text(v.copyright)
- .font(.caption)
- .foregroundStyle(.secondary)
- if let u = v.updates {
- Divider().padding(.vertical, 16)
- updateControls(u)
- }
- }
- .padding(24)
- .frame(width: 520)
- .sheet(isPresented: $showingNotices) { NoticesView(done: { showingNotices = false }) }
- }
-
- @ViewBuilder private func updateControls(_ u: AppAboutUpdates) -> some View {
- Grid(alignment: .leading, horizontalSpacing: 8, verticalSpacing: 10) {
- GridRow {
- Color.clear.gridCellUnsizedAxes([.horizontal, .vertical])
- Toggle(u.autoCheckLabel, isOn: Binding(get: { u.autoCheck }, set: updates.setAutoCheck))
- .toggleStyle(.checkbox)
- .accessibilityIdentifier("about-auto-check")
- }
- GridRow {
- Color.clear.gridCellUnsizedAxes([.horizontal, .vertical])
- Toggle(u.autoInstallLabel, isOn: Binding(get: { u.autoInstall }, set: updates.setAutoInstall))
- .toggleStyle(.checkbox)
- .disabled(!u.autoInstallEnabled)
- .accessibilityIdentifier("about-auto-install")
- }
- GridRow {
- Text(u.channelLabel).gridColumnAlignment(.trailing)
- HStack(spacing: 6) {
- Picker(u.channelLabel, selection: Binding(
- get: { u.channels.first(where: \.active)?.id ?? "stable" },
- set: { updates.choose(channel: $0) })) {
- ForEach(u.channels, id: \.id) { Text($0.label).tag($0.id) }
- }
- .labelsHidden()
- .pickerStyle(.menu)
- .fixedSize()
- .accessibilityIdentifier("about-channel")
- Image(systemName: "info.circle")
- .foregroundStyle(.secondary)
- .help(u.channelHelp)
- .accessibilityLabel(u.channelHelp)
- }
- }
- GridRow {
- Color.clear.gridCellUnsizedAxes([.horizontal, .vertical])
- HStack(spacing: 10) {
- Button(u.checkLabel) { updates.checkNow() }
- .disabled(!u.checkEnabled)
- .accessibilityIdentifier("about-check-now")
- Text(u.lastCheck)
- .font(.callout)
- .foregroundStyle(.secondary)
- .accessibilityIdentifier("about-last-check")
- }
- }
- }
- .fixedSize()
- }
-
- private func open(_ link: AppAboutLink) {
- if let url = link.url.flatMap(URL.init(string:)) {
- openURL(url)
- } else {
- showingNotices = true
- }
- }
-
- static func id(_ id: AppAboutLinkId) -> String {
- switch id {
- case .acknowledgements: "acknowledgements"
- case .privacy: "privacy"
- case .terms: "terms"
- case .status: "status"
- case .issue: "issue"
- }
- }
-}
-
-/// The bundled third-party notices (THIRD_PARTY_NOTICES.md, copied into
-/// Contents/Resources by scripts/build-app.sh).
-struct NoticesView: View {
- let done: () -> Void
-
- var body: some View {
- VStack(spacing: 0) {
- ScrollView {
- VStack(alignment: .leading, spacing: 10) {
- ForEach(Array(NoticeBlock.parse(Self.text).enumerated()), id: \.offset) { _, block in
- blockView(block)
- }
- }
- .padding(20)
- .frame(maxWidth: .infinity, alignment: .leading)
- .textSelection(.enabled)
- }
- Divider()
- HStack {
- Spacer()
- Button("Done", action: done).keyboardShortcut(.defaultAction)
- }
- .padding(12)
- }
- .frame(width: 620, height: 520)
- }
-
- static var text: String {
- guard let url = Bundle.main.url(forResource: "THIRD_PARTY_NOTICES", withExtension: "md"),
- let text = try? String(contentsOf: url, encoding: .utf8) else {
- return "The third-party notices are missing from this build (THIRD_PARTY_NOTICES.md)."
- }
- return text
- }
-
- @ViewBuilder private func blockView(_ block: NoticeBlock) -> some View {
- switch block {
- case .heading(let level, let text):
- Text(inline(text)).font(level == 1 ? .title2.weight(.semibold) : .headline)
- .padding(.top, level == 1 ? 0 : 6)
- case .paragraph(let text):
- Text(inline(text)).fixedSize(horizontal: false, vertical: true)
- case .row(let cells):
- VStack(alignment: .leading, spacing: 2) {
- Text(inline(cells.first ?? ""))
- ForEach(Array(cells.dropFirst().enumerated()), id: \.offset) { _, cell in
- Text(inline(cell)).font(.callout).foregroundStyle(.secondary)
- }
- }
- case .verbatim(let text):
- Text(text).font(.system(.caption, design: .monospaced))
- .fixedSize(horizontal: false, vertical: true)
- }
- }
-
- private func inline(_ s: String) -> AttributedString {
- (try? AttributedString(markdown: s, options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace)))
- ?? AttributedString(s)
- }
-}
-
-/// The few Markdown blocks the notices use: headings, paragraphs, table
-/// rows (the header and separator rows dropped) and fenced license texts.
-enum NoticeBlock: Equatable {
- case heading(Int, String)
- case paragraph(String)
- case row([String])
- case verbatim(String)
-
- static func parse(_ text: String) -> [NoticeBlock] {
- var blocks: [NoticeBlock] = []
- var paragraph: [String] = []
- var fence: [String]?
- var tableRow = 0
- func flush() {
- if !paragraph.isEmpty { blocks.append(.paragraph(paragraph.joined(separator: " "))) }
- paragraph = []
- }
- for raw in text.components(separatedBy: "\n") {
- let line = raw.trimmingCharacters(in: .whitespaces)
- if line.hasPrefix("```") {
- if let f = fence {
- blocks.append(.verbatim(f.joined(separator: "\n")))
- fence = nil
- } else {
- flush()
- fence = []
- }
- continue
- }
- if fence != nil { fence!.append(raw); continue }
- if line.hasPrefix("|") {
- flush()
- tableRow += 1
- // The header row and the |---| separator.
- if tableRow <= 2 { continue }
- let cells = line.trimmingCharacters(in: CharacterSet(charactersIn: "|"))
- .components(separatedBy: " | ").map { $0.trimmingCharacters(in: .whitespaces) }
- blocks.append(.row(cells))
- continue
- }
- tableRow = 0
- if line.isEmpty { flush(); continue }
- if line.hasPrefix("#") {
- flush()
- let level = line.prefix(while: { $0 == "#" }).count
- blocks.append(.heading(level, line.dropFirst(level).trimmingCharacters(in: .whitespaces)))
- continue
- }
- paragraph.append(line)
- }
- flush()
- if let f = fence { blocks.append(.verbatim(f.joined(separator: "\n"))) }
- return blocks
- }
-}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentKeysSettingsView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentKeysSettingsView.swift
deleted file mode 100644
index 252b21cf18..0000000000
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentKeysSettingsView.swift
+++ /dev/null
@@ -1,172 +0,0 @@
-// SPDX-License-Identifier: FSL-1.1-MIT
-// Copyright (c) 2026 Cua AI, Inc.
-
-import CuaSpacesFFI
-import SwiftUI
-
-/// What the add or replace sheet is for.
-struct AgentKeySheetTarget: Identifiable, Equatable {
- let provider: String
- let env: String?
- var id: String { "\(provider):\(env ?? "")" }
-}
-
-/// Settings → Agents: Anthropic and OpenAI (Not set, or •••• and the last
-/// four characters with when it was added), then other keys by variable
-/// name; Add or Replace opens a sheet with a secure field (the key is never
-/// shown again), Remove asks first. Everything shown is the core's
-/// `appAgentKeysView`.
-struct AgentKeysSettingsView: View {
- let keys: AgentKeysModel
- @State private var sheet: AgentKeySheetTarget?
- @State private var removing: String?
- @State private var failure: String?
-
- var body: some View {
- let v = keys.view
- Form {
- Section {
- Text(v.intro).font(.callout).foregroundStyle(.secondary)
- .accessibilityIdentifier("agent-keys-intro")
- if let notice = v.notice {
- Label(notice, systemImage: "exclamationmark.triangle").foregroundStyle(.orange)
- .accessibilityIdentifier("agent-keys-notice")
- }
- }
- Section(v.title) {
- ForEach(v.rows, id: \.env) { row($0, v) }
- }
- Section {
- HStack(alignment: .firstTextBaseline) {
- Button(v.addOtherLabel) { sheet = AgentKeySheetTarget(provider: "other", env: nil) }
- .disabled(!v.canEdit)
- .accessibilityIdentifier("agent-keys-add-other")
- Text(v.otherHelp).font(.callout).foregroundStyle(.secondary)
- }
- }
- }
- .formStyle(.grouped)
- .frame(width: 520)
- .frame(minHeight: 360)
- .task { await keys.load() }
- .sheet(item: $sheet) { target in
- AgentKeySheet(keys: keys, target: target) { sheet = nil }
- }
- .alert(pendingRemove?.confirm.title ?? "", isPresented: Binding(get: { pendingRemove != nil }, set: { if !$0 { removing = nil } }),
- presenting: pendingRemove) { item in
- Button(item.confirm.confirmLabel, role: .destructive) {
- Task {
- do { try await keys.remove(env: item.env) } catch { failure = error.localizedDescription }
- }
- }
- Button(item.confirm.cancelLabel, role: .cancel) {}
- } message: { item in
- Text(item.confirm.message)
- }
- .alert("Couldn't remove the key", isPresented: Binding(get: { failure != nil }, set: { if !$0 { failure = nil } })) {
- Button("OK", role: .cancel) {}
- } message: {
- Text(failure ?? "")
- }
- }
-
- /// The key a Remove asks about, with the core's question.
- private var pendingRemove: PendingRemove? {
- guard let env = removing, let confirm = keys.removeConfirm(env: env) else { return nil }
- return PendingRemove(env: env, confirm: confirm)
- }
-
- struct PendingRemove {
- let env: String
- let confirm: AppAgentKeyConfirm
- }
-
- @ViewBuilder private func row(_ r: AppAgentKeyRow, _ v: AppAgentKeysView) -> some View {
- LabeledContent {
- HStack(spacing: 8) {
- VStack(alignment: .trailing, spacing: 1) {
- Text(r.status).font(r.set ? .body.monospaced() : .body).foregroundStyle(r.set ? .primary : .secondary)
- if let ms = r.addedMs {
- Text(Self.added(v.addedLabel, ms)).font(.caption).foregroundStyle(.secondary)
- }
- }
- Button(r.actionLabel) { sheet = AgentKeySheetTarget(provider: r.provider, env: r.provider == "other" ? r.env : nil) }
- .disabled(!v.canEdit)
- .accessibilityIdentifier("agent-key-action-\(r.env)")
- if let remove = r.removeLabel {
- Button(remove) { removing = r.env }
- .disabled(!v.canEdit)
- .accessibilityIdentifier("agent-key-remove-\(r.env)")
- }
- }
- } label: {
- VStack(alignment: .leading, spacing: 1) {
- Text(r.title)
- Text(r.detail).font(.caption).foregroundStyle(.secondary)
- }
- }
- .accessibilityIdentifier("agent-key-\(r.env)")
- }
-
- /// "Added Oct 4, 2026".
- static func added(_ label: String, _ ms: UInt64) -> String {
- let date = Date(timeIntervalSince1970: TimeInterval(ms) / 1000)
- return "\(label) \(date.formatted(.dateTime.month(.abbreviated).day().year()))"
- }
-}
-
-/// Add or replace one key. The key stays in the secure field until Save,
-/// then the sheet closes and it is gone.
-struct AgentKeySheet: View {
- let keys: AgentKeysModel
- let target: AgentKeySheetTarget
- let done: () -> Void
- @State private var name = ""
- @State private var value = ""
- @State private var busy = false
- @State private var error: String?
-
- var body: some View {
- let v = keys.form(provider: target.provider, env: target.env, name: name,
- hasValue: !value.trimmingCharacters(in: .whitespaces).isEmpty)
- VStack(alignment: .leading, spacing: 12) {
- Text(v.title).font(.headline)
- Text(v.lede).font(.callout).foregroundStyle(.secondary)
- if let label = v.nameLabel {
- TextField(label, text: $name, prompt: v.namePlaceholder.map { Text($0) })
- .font(.body.monospaced())
- .autocorrectionDisabled()
- .accessibilityIdentifier("agent-key-name")
- if let e = v.nameError { Text(e).font(.caption).foregroundStyle(.red) }
- }
- SecureField(v.valueLabel, text: $value, prompt: Text(v.valuePlaceholder))
- .accessibilityIdentifier("agent-key-value")
- Text(v.valueHelp).font(.caption).foregroundStyle(.secondary)
- if let error { Text(error).font(.callout).foregroundStyle(.red) }
- HStack {
- Spacer()
- Button(v.cancelLabel, role: .cancel) { done() }
- .keyboardShortcut(.cancelAction)
- Button(busy ? "Saving…" : v.saveLabel) { Task { await save(v) } }
- .keyboardShortcut(.defaultAction)
- .disabled(!v.canSave || busy)
- .accessibilityIdentifier("agent-key-save")
- }
- }
- .padding(20)
- .frame(width: 420)
- }
-
- private func save(_ v: AppAgentKeyFormView) async {
- busy = true
- error = nil
- do {
- try await keys.save(provider: v.provider, env: v.env, value: value)
- value = ""
- done()
- } catch {
- self.error = error.localizedDescription
- busy = false
- }
- }
-}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
index 226736c3f7..f6ba062695 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
@@ -98,7 +98,6 @@ struct NavigationCommands: View {
/// type in the core's order (`appPaletteRank`, the React palette's too).
struct CommandPaletteView: View {
let model: AppModel
- @Environment(\.openSettings) private var openSettings
@State private var query = ""
@State private var active = 0
@FocusState private var focused: Bool
@@ -230,7 +229,7 @@ struct CommandPaletteView: View {
model.selection = .notifications
},
Command(id: "nav:settings", entry: entry("Go to", chrome.settingsLabel, keywords: "page preferences"),
- symbol: "gearshape", shortcut: SharedShortcuts.label("nav.settings")) { openSettings() },
+ symbol: "gearshape", shortcut: SharedShortcuts.label("nav.settings")) { MainUIRouter(model: model).openSettings() },
Command(id: "nav:checklist", entry: entry("Go to", "Getting started", keywords: "checklist steps tour help first"),
symbol: "checklist") { model.openGettingStarted() },
]
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift
index 6a1ccb49ad..1ce3ee3660 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift
@@ -8,8 +8,9 @@ import Observation
import CuaSpacesStreaming
import SwiftUI
-/// Cua Spaces for macOS: the main window, Settings, the menu bar extra and
-/// the notch panel, all over one `AppModel`.
+/// Cua Spaces for macOS: the main window, the menu bar extra and the notch
+/// panel, all over one `AppModel`. Settings is a page of the New UI window
+/// (`WebUIWindowController.openSettings`); there is no Settings window.
public struct CuaSpacesMacApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) private var delegate
@State private var model: AppModel
@@ -44,9 +45,12 @@ public struct CuaSpacesMacApp: App {
Button(model.chrome.newSpaceLabel) { Task { await model.openNewSpace() } }
.keyboardShortcut("n")
}
- // No `.appSettings` group here: the `Settings` scene's item is the
- // app menu's one "Settings…". The New UI window answers its
- // action itself (`WebUIAppWindow`), so ⌘, opens its Settings.
+ // The app menu's "Settings…" (⌘,): the page's Settings, the one
+ // Settings there is (no `Settings` scene).
+ CommandGroup(replacing: .appSettings) {
+ Button("Settings…") { MainUIRouter(model: model).openSettings() }
+ .keyboardShortcut(",")
+ }
CommandGroup(before: .sidebar) {
NavigationCommands(model: model)
Divider()
@@ -67,10 +71,6 @@ public struct CuaSpacesMacApp: App {
.defaultLaunchBehavior(.suppressed)
.restorationBehavior(.disabled)
- Settings {
- SettingsScene(model: model)
- }
-
// Not inserted in an offscreen run (`OffscreenRun`).
MenuBarExtra(isInserted: .constant(!OffscreenRun.isOn)) {
MenuBarContent(model: model)
@@ -186,7 +186,6 @@ struct MenuBarContent: View {
let model: AppModel
var disk: LowDiskMonitor = .shared
@Environment(\.openWindow) private var openWindow
- @Environment(\.openSettings) private var openSettings
var body: some View {
// This Mac is short of space: the warning, with the Cua key, first.
@@ -232,7 +231,7 @@ struct MenuBarContent: View {
// The native sheet needs the main window; New UI opens its own.
if !model.settings.experiments.webUi { openWindow(id: "main") }
Task { await model.openNewSpace() }
- case .settings: router.open(.settings) { activate(); openSettings() }
+ case .settings: router.openSettings()
case .volumeConflicts:
router.open(.drive) {
activate(); openWindow(id: "main")
@@ -369,9 +368,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
controller.onOpenList = { [weak controller] in
router.open(.home) { controller?.showMain?() }
}
- controller.onOpenSettings = { [weak controller] in
- router.open(.settings) { controller?.showSettings?() }
- }
+ controller.onOpenSettings = { router.openSettings() }
controller.onOpenAccess = { [weak controller] in
router.open(.access) {
model.selection = .keyvault(.category(category: .access))
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DevicesViews.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DevicesViews.swift
index 2096ec7f9d..c774d42332 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DevicesViews.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DevicesViews.swift
@@ -5,249 +5,6 @@ import CuaSDK
import CuaSpacesFFI
import SwiftUI
-/// The Settings window: General (the core's settings page), Agents (provider keys), Devices,
-/// Experiments and About (with the updater).
-struct SettingsScene: View {
- @Bindable var model: AppModel
-
- var body: some View {
- TabView(selection: $model.settingsTab) {
- SettingsView(model: model)
- .tabItem { Label("General", systemImage: "gearshape") }
- .tag(SettingsTab.general)
- AgentKeysSettingsView(keys: model.agentKeys)
- .tabItem { Label("Agents", systemImage: "key") }
- .tag(SettingsTab.agents)
- DevicesSettingsView(devices: model.devices)
- .tabItem { Label(model.devices.view.labels.title, systemImage: "laptopcomputer.and.iphone") }
- .tag(SettingsTab.devices)
- ExperimentsSettingsView(model: model)
- .tabItem { Label(model.experimentsPage.title, systemImage: "flask") }
- .tag(SettingsTab.experiments)
- AboutSettingsView(updates: model.updates)
- .tabItem { Label("About", systemImage: "info.circle") }
- .tag(SettingsTab.about)
- }
- }
-}
-
-/// Settings → Experiments: the core's page, one switch per experiment with
-/// its one line under the title (all off until turned on).
-struct ExperimentsSettingsView: View {
- @Bindable var model: AppModel
-
- var body: some View {
- let page = model.experimentsPage
- Form {
- ForEach(page.sections, id: \.id) { section in
- Section {
- ForEach(section.rows.filter { $0.kind == .toggle }, id: \.id) { r in
- let note = section.rows.first { $0.id == "\(r.id)-note" }?.label
- Toggle(isOn: Binding(
- get: { r.options.first(where: { $0.id == "on" })?.active ?? false },
- set: { model.chooseExperiment(row: r.id, option: $0 ? "on" : "off") })) {
- Text(r.label)
- if let note { Text(note) }
- }
- .disabled(!r.enabled)
- .accessibilityIdentifier("settings-\(r.id)")
- }
- }
- }
- }
- .formStyle(.grouped)
- .frame(width: 520)
- .frame(minHeight: 320)
- }
-}
-
-/// Settings → Devices: this Mac's enrollment, the account's devices (Rename,
-/// Revoke with its confirmation, Approve) and Recent Access. Everything
-/// shown is the core's `appDevicesView`.
-struct DevicesSettingsView: View {
- @Bindable var devices: DevicesModel
- @State private var renaming: AppDeviceRow?
- @State private var newName = ""
- @State private var revoking: AppDeviceRow?
-
- var body: some View {
- let v = devices.view
- Form {
- if !devices.signedIn {
- Text(v.labels.signedOut).foregroundStyle(.secondary)
- } else {
- Section(v.labels.thisDevice) {
- LabeledContent {
- HStack(spacing: 8) {
- Text(devices.thisDeviceText(v.thisDevice))
- .foregroundStyle(v.thisDevice.kind == .enrolled ? Color.secondary : Color.orange)
- .lineLimit(1)
- .accessibilityIdentifier("devices-this-status")
- if let label = v.thisDevice.actionLabel {
- Button(label) { devices.startEnroll(in: .settings) }
- .accessibilityIdentifier("devices-enroll")
- }
- }
- } label: {
- Label(v.thisDevice.name ?? Foundation.Host.current().localizedName ?? "This Mac",
- systemImage: "laptopcomputer")
- .lineLimit(1)
- }
- if let banner = v.banner {
- Text(banner.text)
- .font(.callout)
- .foregroundStyle(.secondary)
- .lineLimit(2)
- }
- }
- if !v.unconfirmedMachines.isEmpty {
- Section(v.labels.newMachines) {
- ForEach(v.unconfirmedMachines, id: \.id) { m in
- HStack(spacing: 10) {
- Image(systemName: "questionmark.circle.fill")
- .foregroundStyle(.orange)
- .frame(width: 20)
- Text(m.title).lineLimit(1)
- Spacer()
- Button(v.labels.confirmMachine) { devices.confirming = m }
- .controlSize(.small)
- }
- .accessibilityIdentifier("unconfirmed-machine-\(m.id)")
- }
- }
- }
- if !v.rows.isEmpty {
- Section(v.labels.devices) {
- ForEach(v.rows, id: \.id) { row($0, labels: v.labels) }
- }
- }
- Section(v.labels.recent) {
- if v.recent.isEmpty {
- Text(v.labels.recentEmpty).foregroundStyle(.secondary)
- }
- ForEach(Array(v.recent.enumerated()), id: \.offset) { _, a in
- LabeledContent {
- Text(devices.relativeText(a.ts)).foregroundStyle(.secondary)
- } label: {
- HStack(spacing: 6) {
- if a.notable {
- Image(systemName: "person.2.fill").foregroundStyle(.orange)
- .help("Another account or an unenrolled device")
- }
- Text(a.text).lineLimit(1).truncationMode(.middle)
- }
- }
- }
- }
- .accessibilityIdentifier("devices-recent")
- if let error = devices.error {
- Text(error).foregroundStyle(.red).lineLimit(2).help(error)
- }
- }
- }
- .formStyle(.grouped)
- .frame(width: 520)
- .frame(minHeight: 480)
- .task { await devices.refresh() }
- .sheet(isPresented: sheetBinding(\.enroll, .settings, { devices.enrollSurface })) {
- EnrollSheet(devices: devices)
- }
- .sheet(isPresented: sheetBinding(\.approval, .settings, { devices.approvalSurface })) {
- DeviceApprovalSheet(devices: devices)
- }
- .alert(v.labels.renameTitle, isPresented: Binding(get: { renaming != nil },
- set: { if !$0 { renaming = nil } })) {
- TextField(v.labels.renameTitle, text: $newName)
- Button(v.labels.renameConfirm) {
- if let r = renaming { Task { await devices.rename(id: r.id, to: newName) } }
- renaming = nil
- }
- .disabled(appDevicesCleanName(name: newName) == nil)
- Button(v.labels.cancel, role: .cancel) { renaming = nil }
- }
- .alert(revoking?.revokeConfirm?.title ?? "", isPresented: Binding(get: { revoking?.revokeConfirm != nil },
- set: { if !$0 { revoking = nil } })) {
- if let r = revoking, let c = r.revokeConfirm {
- Button(c.confirmLabel, role: .destructive) {
- revoking = nil
- Task { await devices.revoke(id: r.id) }
- }
- Button(c.cancelLabel, role: .cancel) { revoking = nil }
- }
- } message: {
- Text(revoking?.revokeConfirm?.message ?? "")
- }
- .alert(devices.confirming?.confirm.title ?? "",
- isPresented: Binding(get: { devices.confirming != nil }, set: { if !$0 { devices.confirming = nil } })) {
- if let m = devices.confirming {
- Button(m.confirm.confirmLabel) {
- devices.confirming = nil
- Task { await devices.confirmMachine(id: m.id) }
- }
- Button(m.confirm.cancelLabel, role: .cancel) { devices.confirming = nil }
- }
- } message: {
- Text(devices.confirming?.confirm.message ?? "")
- }
- }
-
- /// A sheet binding for Settings' copy of a Devices sheet.
- private func sheetBinding<T>(_ key: ReferenceWritableKeyPath<DevicesModel, T?>, _ surface: DevicesSurface,
- _ current: @escaping () -> DevicesSurface) -> Binding<Bool> {
- Binding(get: { devices[keyPath: key] != nil && current() == surface },
- set: { if !$0 { devices[keyPath: key] = nil } })
- }
-
- @ViewBuilder private func row(_ r: AppDeviceRow, labels: AppDevicesLabels) -> some View {
- HStack(spacing: 10) {
- Image(systemName: Self.symbol(r.platform))
- .foregroundStyle(.secondary)
- .frame(width: 20)
- VStack(alignment: .leading, spacing: 2) {
- Text(r.title).lineLimit(1)
- Text(devices.rowDetail(r)).font(.caption).foregroundStyle(.secondary).lineLimit(1)
- }
- Spacer()
- if r.actions.contains(.approve) {
- Button(labels.approve) { devices.openApproval(deviceId: r.id, in: .settings) }
- .controlSize(.small)
- Button(labels.deny) { Task { await devices.denyApproval(deviceId: r.id) } }
- .controlSize(.small)
- .disabled(devices.busy)
- }
- if r.actions.contains(.rename) || r.actions.contains(.revoke) {
- Menu {
- if r.actions.contains(.rename) {
- Button(labels.rename) {
- newName = r.name
- renaming = r
- }
- }
- if r.actions.contains(.revoke) {
- Button(labels.revoke, role: .destructive) { revoking = r }
- }
- } label: {
- Image(systemName: "ellipsis.circle")
- }
- .menuStyle(.borderlessButton)
- .menuIndicator(.hidden)
- .fixedSize()
- .disabled(devices.busy)
- }
- }
- .accessibilityIdentifier("device-\(r.id)")
- }
-
- static func symbol(_ platform: String) -> String {
- switch platform {
- case "macOS": return "laptopcomputer"
- case "Windows", "Linux", "FreeBSD": return "desktopcomputer"
- case "iOS", "Android": return "iphone"
- default: return "questionmark.circle"
- }
- }
-}
-
/// "Enroll This Device": Sign in again, or Approve from another device
/// (the one-time code shows while this Mac waits). The core's
/// `appEnrollView`.
@@ -474,42 +231,3 @@ struct ShareRemovalBanner: View {
}
}
}
-
-/// Settings → Account: the plan and the relay allowance this month, where
-/// it applies. The plan card is always there, never a prompt: Free offers
-/// Pro and a team; each button opens its checkout on the account app.
-struct RelayUsageRow: View {
- let view: AppRelayUsageView
- var onPlanLink: () -> Void = {}
- @Environment(\.openURL) private var openURL
-
- var body: some View {
- LabeledContent {
- Text(view.plan).foregroundStyle(.secondary)
- } label: {
- Text(view.label)
- Text(view.line)
- }
- .accessibilityIdentifier("settings-relay-usage")
- LabeledContent {
- HStack {
- if let link = view.planCard.secondary { planButton(link, id: "plan-secondary") }
- if let link = view.planCard.primary { planButton(link, id: "plan-primary") }
- }
- } label: {
- Text(view.planCard.label)
- Text(view.planCard.detail)
- }
- .accessibilityIdentifier("settings-plan-card")
- }
-
- private func planButton(_ link: AppPlanLink, id: String) -> some View {
- Button(link.label) {
- guard let url = URL(string: link.url) else { return }
- onPlanLink()
- openURL(url)
- }
- .controlSize(.small)
- .accessibilityIdentifier(id)
- }
-}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
index 3b074ec0e3..9c8f3797ba 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
@@ -11,7 +11,6 @@ import SwiftUI
/// opens the command palette.
public struct MainWindow: View {
@Bindable var model: AppModel
- @Environment(\.openSettings) private var openSettings
public init(model: AppModel) {
self.model = model
@@ -120,8 +119,7 @@ public struct MainWindow: View {
KeyvaultDetail(keyvault: model.keyvault, selection: selection)
case .agents:
AgentsPageView(model: model.persistent, openAgentKeys: {
- model.settingsTab = .agents
- openSettings()
+ MainUIRouter(model: model).openSettings(.path("/settings/connected-apps"))
})
.onAppear {
model.recordFeature("agents_page_open")
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift
deleted file mode 100644
index f7fc3a414a..0000000000
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift
+++ /dev/null
@@ -1,198 +0,0 @@
-// SPDX-License-Identifier: FSL-1.1-MIT
-// Copyright (c) 2026 Cua AI, Inc.
-
-import CuaSDK
-import CuaSpacesFFI
-import SwiftUI
-
-/// Settings: the core's page (Account, General, Privacy, AI agents) with
-/// the core's Storage section after General while the Cua Volume
-/// experiment is on, each row one line. What a row does is wired in
-/// `AppModel.press` / `choose`, and for Storage in `StorageModel`.
-struct SettingsView: View {
- @Bindable var model: AppModel
-
- var body: some View {
- let storage = model.storage.section
- let sections = model.settingsPageWithStorage.sections
- ScrollViewReader { proxy in
- Form {
- ForEach(sections, id: \.id) { section in
- Section {
- ForEach(section.rows, id: \.id) { row($0, in: section.id) }
- if section.id == "account", let usage = model.devices.relayUsageView {
- RelayUsageRow(view: usage) { model.devices.recordUpsell("upsell_plan_card_click") }
- }
- } header: {
- HStack {
- Text(section.title)
- Spacer()
- if let button = section.button {
- Button(button) { Task { await headerButton(section.id) } }
- .controlSize(.small)
- .disabled(!section.buttonEnabled)
- .help(section.buttonHelp ?? "")
- }
- }
- }
- .id(section.id)
- }
- }
- .formStyle(.grouped)
- .task(id: "\(model.settingsSection ?? "")/\(storage.rows.count)") {
- guard let id = model.settingsSection else { return }
- try? await Task.sleep(for: .milliseconds(600))
- proxy.scrollTo(id, anchor: .top)
- }
- }
- .frame(width: 520)
- .frame(minHeight: 480)
- .task { await model.loadSettings() }
- .task { await model.devices.readRelayUsage(maxAge: DevicesModel.relayUsageFocusAge) }
- .background { watchTask }
- // While the mount settles (mounting, or waiting for the extension's
- // approval in System Settings), follow it.
- .task(id: Self.settling(storage)) {
- while Self.settling(model.storage.section), !Task.isCancelled {
- try? await Task.sleep(for: .seconds(2))
- await model.storage.load()
- }
- }
- }
-
- /// The agent prompt shows: poll for the bucket it sets up.
- private var watchTask: some View {
- Color.clear.frame(width: 0, height: 0)
- .task(id: model.storage.watching) {
- while model.storage.watching, !Task.isCancelled {
- try? await Task.sleep(for: .seconds(2))
- await model.storage.load()
- }
- }
- }
-
- /// The mount is on its way: mounting, or waiting for approval.
- static func settling(_ s: AppSettingsSection) -> Bool {
- s.rows.contains { $0.id == "mount-approval" || ($0.id == "mount-path" && $0.button == nil) }
- }
-
- private func headerButton(_ section: String) async {
- switch section {
- case "storage": await model.storage.send(.save)
- default: await model.configureAllAgents()
- }
- }
-
- private func press(_ r: AppSettingsRow, in section: String) {
- Task {
- if section == "storage" { await model.storage.press(r.id) } else { await model.press(row: r.id) }
- }
- }
-
- private func choose(_ r: AppSettingsRow, _ option: String, in section: String) {
- Task {
- if section == "storage" {
- await model.storage.choose(r.id, option)
- } else {
- await model.choose(row: r.id, option: option)
- }
- }
- }
-
- @ViewBuilder private func row(_ r: AppSettingsRow, in section: String) -> some View {
- switch r.kind {
- case .text:
- LabeledContent {
- HStack(spacing: 8) {
- if let value = r.value {
- Text(value).foregroundStyle(.secondary).lineLimit(1).truncationMode(.middle)
- }
- if let button = r.button {
- Button(button) { press(r, in: section) }
- .disabled(!r.enabled)
- }
- }
- } label: {
- Text(r.label).lineLimit(1)
- }
- .opacity(r.enabled || r.button != nil ? 1 : 0.5)
- .help(r.help ?? "")
- case .choice:
- Picker(r.label, selection: Binding(
- get: { r.options.first(where: \.active)?.id ?? "" },
- set: { id in choose(r, id, in: section) })) {
- ForEach(r.options, id: \.id) { Text($0.label).tag($0.id) }
- }
- .pickerStyle(.segmented)
- .disabled(!r.enabled)
- .help(r.help ?? "")
- case .toggle:
- Toggle(r.label, isOn: Binding(
- get: { r.options.first(where: { $0.id == "on" })?.active ?? false },
- set: { choose(r, $0 ? "on" : "off", in: section) }))
- .disabled(!r.enabled)
- .help(r.help ?? "")
- .accessibilityIdentifier("settings-\(r.id)")
- case .field:
- TextField(r.label, text: Binding(get: { r.value ?? "" }, set: { model.storage.edit(r.id, $0) }),
- prompt: r.placeholder.map { Text($0) })
- .disabled(!r.enabled)
- .accessibilityIdentifier("settings-\(r.id)")
- case .secret:
- SecureField(r.label, text: Binding(get: { r.value ?? "" }, set: { model.storage.edit(r.id, $0) }),
- prompt: r.placeholder.map { Text($0) })
- .disabled(!r.enabled)
- .accessibilityIdentifier("settings-\(r.id)")
- case .prompt:
- PromptBox(label: r.label, text: r.value ?? "", copyLabel: r.button ?? "Copy")
- case .link:
- Button(r.label) { press(r, in: section) }
- .buttonStyle(.link)
- .disabled(!r.enabled)
- .accessibilityIdentifier("settings-\(r.id)")
- case .note:
- HStack(spacing: 4) {
- Text(r.label).font(.callout).foregroundStyle(.secondary).lineLimit(1).help(r.label)
- if let label = r.linkLabel, let url = r.linkUrl.flatMap(URL.init(string:)) {
- Link(label, destination: url).font(.callout)
- }
- }
- case .error:
- Text(r.label).foregroundStyle(.red).lineLimit(1).help(r.label)
- }
- }
-}
-
-/// A prompt to hand to a coding agent: a label, the text in a quiet
-/// read-only box (selectable, wrapping) and Copy.
-struct PromptBox: View {
- let label: String
- let text: String
- let copyLabel: String
- @State private var copied = false
-
- var body: some View {
- VStack(alignment: .leading, spacing: 6) {
- HStack {
- Text(label).foregroundStyle(.secondary)
- Spacer()
- Button(copyLabel) {
- NSPasteboard.general.clearContents()
- NSPasteboard.general.setString(text, forType: .string)
- copied = true
- }
- .controlSize(.small)
- .accessibilityIdentifier("storage-prompt-copy")
- }
- Text(text)
- .font(.callout)
- .textSelection(.enabled)
- .fixedSize(horizontal: false, vertical: true)
- .frame(maxWidth: .infinity, alignment: .leading)
- .padding(8)
- .background(Color(nsColor: .textBackgroundColor), in: .rect(cornerRadius: 6))
- .overlay(RoundedRectangle(cornerRadius: 6).strokeBorder(Color(nsColor: .separatorColor)))
- .accessibilityIdentifier("storage-prompt")
- }
- }
-}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift
index 6e411eda9d..0ed8c3f739 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift
@@ -70,22 +70,34 @@ public enum MainUIRoute: Equatable, Sendable {
/// The one place the app's chrome (the notch, the menu bar item, the menus,
/// notifications) opens the main UI: the New UI window at a route while its
-/// experiment is on, else the native window or Settings as before.
+/// experiment is on, else the native window as before. Settings is always
+/// the page's (`openSettings`).
@MainActor
struct MainUIRouter {
let model: AppModel
/// Opens the New UI window at a route (tests set their own).
var web: (MainUIRoute) -> Void
+ /// Opens the page's Settings (tests set their own).
+ var settings: (MainUIRoute) -> Void
- init(model: AppModel, web: ((MainUIRoute) -> Void)? = nil) {
+ init(model: AppModel, web: ((MainUIRoute) -> Void)? = nil, settings: ((MainUIRoute) -> Void)? = nil) {
self.model = model
self.web = web ?? { WebUIWindowController.show(model: model, at: $0) }
+ self.settings = settings ?? { WebUIWindowController.openSettings(model: model, at: $0) }
}
func open(_ route: MainUIRoute, native: () -> Void) {
if model.settings.experiments.webUi { web(route) } else { native() }
}
+ /// Settings (⌘,, the menu bar item, the notch, the palette): the page's
+ /// Settings in the New UI window, with New UI on or off. There is no
+ /// native Settings window, so the two can't drift. `route`: one tab
+ /// (`/settings/connected-apps`, ...).
+ func openSettings(_ route: MainUIRoute = .settings) {
+ settings(route)
+ }
+
/// The page a View menu `nav.*` command names.
static func route(forNav command: String) -> MainUIRoute? {
switch command {
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
index 63aa80e6ee..88e1084ba0 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
@@ -44,8 +44,8 @@ public struct WebUIActions {
/// shows. `spaces.createProgress` carries a create's progress (the page's
/// pending id), and `spaces.newRequested` (`{on}`) asks the page to open
/// its New Space wizard (the app's New Space menu items, the notch).
-/// `settings.openRequested` asks the page to open its Settings (the app
-/// menu's Settings command, ⌘,, while the New UI window is in front).
+/// `settings.openRequested` asks the page to open its Settings (⌘, and every
+/// other Settings item, while the window is open; there is no native one).
/// `window.dropTarget` (`{spaceId}`, null for none) names the Space tile a
/// real window is being dragged over (`window.setDropTargets` said where the
/// tiles are; the notch's drag monitor follows the drag).
@@ -553,7 +553,7 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {
host?.emit("spaces.newRequested", payload: ["on": on.map { $0 as Any } ?? NSNull()])
}
- // MARK: - Settings (the app menu's command while this window is in front)
+ // MARK: - Settings (⌘, and the other Settings items while this window is open)
/// Asks the page to go to its Settings; queued until the page listens.
func requestSettings() {
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift
index e01303731b..3f4fbcd4df 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift
@@ -155,7 +155,7 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,
videoSurfaces = nil
}
- let window = WebUIAppWindow(contentRect: NSRect(x: 0, y: 0, width: 1200, height: 780),
+ let window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 1200, height: 780),
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
backing: .buffered, defer: true)
window.title = "Cua Spaces"
@@ -490,86 +490,16 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,
}
}
-// MARK: - Settings: ⌘, goes where the user is
-
-/// Which window is in front, as far as the Settings command goes.
-enum SettingsFrontWindow: Equatable {
- /// The New UI window, or a sheet on it.
- case webUI
- /// Any other window of the app.
- case other
- /// None (the app is in the background, or only a utility panel is key).
- case none
-}
-
-/// Where the Settings command (⌘, in the app menu) goes.
-enum SettingsRoute: Equatable {
- /// The New UI page's own Settings.
- case web
- /// The SwiftUI Settings scene (the classic UI).
- case native
-}
+// MARK: - Settings
extension WebUIWindowController {
- /// The New UI window's Settings when it is the key window, whether or
- /// not its web view has focus; the native scene when another window is
- /// key. With no key window (the app is in the background, a dialog of
- /// another app has focus) the frontmost window of the app decides.
- static func settingsRoute(key: SettingsFrontWindow, frontmost: SettingsFrontWindow) -> SettingsRoute {
- switch key {
- case .webUI: return .web
- case .other: return .native
- case .none: return frontmost == .webUI ? .web : .native
- }
- }
-
- /// `window` as the Settings command sees it: this window (or a sheet on
- /// it), another window of the app, or none when it is a utility panel
- /// that can't be the main window (the notch).
- static func settingsFront(_ window: NSWindow?, webUI: NSWindow?) -> SettingsFrontWindow {
- guard let window else { return .none }
- if let parent = window.sheetParent { return parent === webUI ? .webUI : .other }
- if window === webUI { return .webUI }
- return window.canBecomeMain ? .other : .none
- }
-
- /// The decision over real windows: `key` is the key window (nil: none),
- /// `frontmost` the frontmost one (`frontmostWindow`).
- static func settingsRoute(webUI: NSWindow?, key: NSWindow?, frontmost: NSWindow?) -> SettingsRoute {
- guard let webUI else { return .native }
- return settingsRoute(key: settingsFront(key, webUI: webUI), frontmost: settingsFront(frontmost, webUI: webUI))
- }
-
- /// The frontmost visible window that can be the main one, from the app's
- /// windows ordered front to back.
- static func frontmostWindow(in ordered: [NSWindow], webUI: NSWindow?, visible: (NSWindow) -> Bool = { $0.isVisible }) -> NSWindow? {
- ordered.first { visible($0) && ($0 === webUI || $0.canBecomeMain) }
- }
-
- /// The Settings command: the page's Settings when the New UI window is
- /// in front, else `native` (the classic UI's Settings scene).
- static func openSettings(native: () -> Void) {
- guard let c = shared, let window = c.window, window.isVisible,
- settingsRoute(webUI: window, key: NSApp.keyWindow,
- frontmost: frontmostWindow(in: NSApp.orderedWindows, webUI: window)) == .web
- else { return native() }
- c.bridge.requestSettings()
- }
-}
-
-/// The New UI window. The app menu's "Settings…" (⌘,) is the `Settings`
-/// scene's own item, which sends `showSettingsWindow:` down the responder
-/// chain; while this window is key it answers first and opens the page's
-/// Settings, else the native scene gets it. One menu item, no
-/// `CommandGroup(replacing: .appSettings)` (that left the scene's item next
-/// to its own: two "Settings…").
-final class WebUIAppWindow: NSWindow {
- static let settingsAction = Selector(("showSettingsWindow:"))
-
- @objc func showSettingsWindow(_ sender: Any?) {
- WebUIWindowController.openSettings(native: {
- _ = NSApp.tryToPerform(Self.settingsAction, with: sender)
- })
+ /// The page's Settings: an open window goes there (`settings.openRequested`),
+ /// else the window opens at `route` (`/settings`, or one tab).
+ static func openSettings(model: AppModel, at route: MainUIRoute = .settings) {
+ NSApp.activate()
+ guard route == .settings, shared != nil else { return show(model: model, at: route) }
+ show(model: model)
+ shared?.bridge.requestSettings()
}
}
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/AgentKeysTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/AgentKeysTests.swift
index 61c2dd60b0..3a8e7c3a32 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/AgentKeysTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/AgentKeysTests.swift
@@ -82,16 +82,6 @@ struct AgentKeysTests {
#expect(none.view.notice?.contains("need the cua daemon") == true)
}
- @Test func theSettingsTabRenders() async {
- let m = AgentKeysModel(tools: FakeAgentKeysTools())
- await m.load()
- let host = NSHostingView(rootView: AgentKeysSettingsView(keys: m))
- host.frame = NSRect(x: 0, y: 0, width: 520, height: 420)
- host.layoutSubtreeIfNeeded()
- #expect(host.fittingSize.width > 0)
- #expect(AgentKeysSettingsView.added("Added", 1_790_000_000_000).hasPrefix("Added "))
- }
-
@Test func theWebBridgeRoutesAgentKeysToTheDaemon() {
for m in ["agentKeys.list", "agentKeys.set", "agentKeys.remove"] {
#expect(WebUIBridge.methods.contains(m))
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
index 13ff6778dc..a1276b4398 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
@@ -226,17 +226,10 @@ struct DriveTests {
@Test func snapshots() async throws {
let snap = SnapshotTests()
let tools = FakeDriveTools()
- // Settings with the Storage section (S3, the volume mounted).
tools.mount = "mounted"
tools.enabled = true
tools.backend = "s3"
tools.hasKeys = true
- let m = try await snap.model()
- m.storage = StorageModel(tools: tools)
- await m.loadSettings()
- // Storage shows only with the Cua Volume experiment on.
- m.settings.experiments = AppExperiments(cuaVolume: true, yourCloud: false, sharing: false, webUi: false)
- try snap.assertSnapshot(SettingsView(model: m), "settings-storage", size: CGSize(width: 520, height: 900))
// The Drive page, mounted and syncing with a conflict.
let p = PersistentModel(tools: tools)
p.now = { Date(timeIntervalSince1970: 1_790_000_000) }
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SettingsCommandTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SettingsCommandTests.swift
index 159c4815e6..420272d463 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SettingsCommandTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SettingsCommandTests.swift
@@ -6,91 +6,50 @@ import AppKit
import Foundation
import Testing
-/// ⌘, (the app menu's Settings command) opens the New UI's Settings when its
-/// window is the one in front, whether or not its web view has focus (it once
-/// opened the native SwiftUI Settings window while another dialog had
-/// focus); the classic UI keeps the native scene.
+/// Settings is one page, the New UI's: ⌘, (the app menu's "Settings…"), the
+/// menu bar item, the notch and the palette all open it, with New UI on or
+/// off. There is no native Settings window to drift from it.
@MainActor
@Suite("Settings command")
struct SettingsCommandTests {
init() { _ = NSApplication.shared }
- /// A window of the app as the running app has them (a process with no
- /// Dock presence, like this test's, reports none as able to be main).
- final class AppWindow: NSWindow {
- override var canBecomeMain: Bool { true }
+ func model() -> AppModel {
+ let dir = FileManager.default.temporaryDirectory.appendingPathComponent("cua-settings-\(UUID().uuidString)")
+ return AppModel(backend: FixtureSpacesBackend(), keyvault: KeyvaultModel(client: nil),
+ onboarding: OnboardingModel(statePath: dir.appendingPathComponent("onboarding.json").path),
+ settingsPath: dir.appendingPathComponent("settings.json").path,
+ telemetry: FixtureTelemetry())
}
- /// A panel like the notch: it can be key but never the main window.
- final class UtilityPanel: NSWindow {
- override var canBecomeMain: Bool { false }
+ /// The classic UI too: Settings never falls back to a native window.
+ @Test func settingsIsThePagesWithNewUIOnOrOff() {
+ for webUi in [true, false] {
+ let m = model()
+ m.settings.experiments.webUi = webUi
+ var web: [MainUIRoute] = [], settings: [MainUIRoute] = []
+ let router = MainUIRouter(model: m, web: { web.append($0) }, settings: { settings.append($0) })
+ router.openSettings()
+ router.openSettings(.path("/settings/connected-apps"))
+ #expect(settings == [.settings, .path("/settings/connected-apps")], "webUi \(webUi)")
+ #expect(web.isEmpty)
+ }
}
- func window() -> NSWindow {
- AppWindow(contentRect: NSRect(x: 0, y: 0, width: 200, height: 120), styleMask: [.titled],
- backing: .buffered, defer: true)
+ /// The notch's Settings button goes through the app's hook (the router).
+ @Test func theNotchSettingsButtonOpensThePage() {
+ let c = NotchController(model: NotchModel(scheduler: ManualScheduler()))
+ var calls: [MainUIRoute] = []
+ let router = MainUIRouter(model: model(), web: { _ in }, settings: { calls.append($0) })
+ c.onOpenSettings = { router.openSettings() }
+ c.run(.settings)
+ #expect(calls == [.settings])
}
- typealias Controller = WebUIWindowController
-
- @Test func theKeyWindowDecidesAndTheFrontmostOneWhenThereIsNone() {
- // The New UI window is key: its Settings, even if another window is listed in front.
- #expect(Controller.settingsRoute(key: .webUI, frontmost: .other) == .web)
- #expect(Controller.settingsRoute(key: .webUI, frontmost: .none) == .web)
- // Another of the app's windows is key (the classic UI, the native Settings): the native scene.
- #expect(Controller.settingsRoute(key: .other, frontmost: .webUI) == .native)
- #expect(Controller.settingsRoute(key: .other, frontmost: .other) == .native)
- // No key window (the app is in the background, a dialog of another app has focus): the front window decides.
- #expect(Controller.settingsRoute(key: .none, frontmost: .webUI) == .web)
- #expect(Controller.settingsRoute(key: .none, frontmost: .other) == .native)
- #expect(Controller.settingsRoute(key: .none, frontmost: .none) == .native)
- }
-
- @Test func overRealWindows() {
- let web = window(), classic = window()
- // No New UI window at all: the native scene.
- #expect(Controller.settingsRoute(webUI: nil, key: classic, frontmost: classic) == .native)
- #expect(Controller.settingsRoute(webUI: nil, key: nil, frontmost: nil) == .native)
- // The web window is key, with or without focus in its web view.
- #expect(Controller.settingsRoute(webUI: web, key: web, frontmost: web) == .web)
- #expect(Controller.settingsRoute(webUI: web, key: web, frontmost: classic) == .web)
- // The classic main window or the native Settings is key.
- #expect(Controller.settingsRoute(webUI: web, key: classic, frontmost: classic) == .native)
- #expect(Controller.settingsRoute(webUI: web, key: classic, frontmost: web) == .native)
- // Nothing is key; the web window is the one in front (the case of the TCC prompt over the app).
- #expect(Controller.settingsRoute(webUI: web, key: nil, frontmost: web) == .web)
- #expect(Controller.settingsRoute(webUI: web, key: nil, frontmost: classic) == .native)
- #expect(Controller.settingsRoute(webUI: web, key: nil, frontmost: nil) == .native)
- }
-
- @Test func aUtilityPanelDoesNotCount() {
- let web = window()
- let notch = UtilityPanel(contentRect: NSRect(x: 0, y: 0, width: 80, height: 30), styleMask: [.borderless],
- backing: .buffered, defer: true)
- #expect(Controller.settingsFront(notch, webUI: web) == .none)
- #expect(Controller.settingsFront(web, webUI: web) == .webUI)
- #expect(Controller.settingsFront(window(), webUI: web) == .other)
- #expect(Controller.settingsFront(nil, webUI: web) == .none)
- // The notch is key but the New UI window is in front: its Settings.
- #expect(Controller.settingsRoute(webUI: web, key: notch, frontmost: web) == .web)
- #expect(Controller.settingsRoute(webUI: web, key: notch, frontmost: window()) == .native)
- }
-
- @Test func theFrontmostWindowIsTheFirstVisibleOneThatCanBeMain() {
- let web = window(), classic = window(), settings = window()
- let notch = UtilityPanel(contentRect: NSRect(x: 0, y: 0, width: 80, height: 30), styleMask: [.borderless],
- backing: .buffered, defer: true)
- let visible: (NSWindow) -> Bool = { _ in true }
- #expect(Controller.frontmostWindow(in: [notch, web, classic], webUI: web, visible: visible) === web)
- #expect(Controller.frontmostWindow(in: [notch, classic, web], webUI: web, visible: visible) === classic)
- // A hidden window is behind the rest.
- #expect(Controller.frontmostWindow(in: [web, settings], webUI: web, visible: { $0 !== web }) === settings)
- #expect(Controller.frontmostWindow(in: [notch], webUI: web, visible: visible) == nil)
- // The New UI window counts even where a window reports it can't be main.
- let odd = UtilityPanel(contentRect: .zero, styleMask: [.titled], backing: .buffered, defer: true)
- #expect(Controller.frontmostWindow(in: [odd], webUI: odd, visible: visible) === odd)
- #expect(Controller.settingsFront(odd, webUI: odd) == .webUI)
- #expect(Controller.settingsRoute(webUI: odd, key: odd, frontmost: nil) == .web)
+ /// The page's Settings routes: `/settings` is Account, then one per tab.
+ @Test func theSettingsRoutes() {
+ #expect(MainUIRoute.settings.webPath == "/settings")
+ #expect(MainUIRouter.route(forNav: "nav.settings") == .settings)
}
func bridge() -> (WebUIWindowController, WebUIBridge) {
@@ -135,17 +94,3 @@ struct SettingsCommandTests {
#expect(seen.suffix(2).sorted() == ["settings.openRequested", "spaces.newRequested"])
}
}
-
-/// The app menu's one "Settings…" is the `Settings` scene's item; the New UI
-/// window answers its action.
-@MainActor
-@Suite("Settings menu action")
-struct SettingsMenuActionTests {
- @Test func theNewUIWindowAnswersTheScenesSettingsAction() {
- _ = NSApplication.shared
- let window = WebUIAppWindow(contentRect: .zero, styleMask: [.titled], backing: .buffered, defer: true)
- #expect(window.responds(to: WebUIAppWindow.settingsAction))
- #expect(!NSWindow(contentRect: .zero, styleMask: [.titled], backing: .buffered, defer: true)
- .responds(to: WebUIAppWindow.settingsAction))
- }
-}
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
index 7603f202b6..b7f8c84c8f 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
@@ -228,16 +228,6 @@ struct SnapshotTests {
try assertSnapshot(card(stopped, preview), "space-cover-stopped", size: size)
}
- /// Settings, General: "Connect to the desktop automatically", on by
- /// default (the `settings` reference), then off.
- @Test func settingsAutoConnectOff() async throws {
- let m = try await model()
- m.settings.experiments.cuaVolume = true
- await m.choose(row: "auto-connect", option: "off")
- await m.loadSettings()
- try assertSnapshot(SettingsView(model: m), "settings-auto-connect-off", size: CGSize(width: 520, height: 640))
- }
-
/// "Teleport an app…" as the core's grid: sections, a tile previewing
/// its app's frontmost window, icons, the app that cannot move dimmed.
@Test func teleportPickerGrid() async throws {
@@ -277,12 +267,11 @@ struct SnapshotTests {
size: CGSize(width: 640, height: 360))
}
- /// Settings, Keyvault: the auto-wipe switch, off by default.
+ /// Settings, Keyvault (the page's, over this model): its section is there.
@Test func settingsKeyvault() async throws {
let m = try await model(overview: try signedInOverview())
await m.loadSettings()
#expect(m.settingsPage.sections.contains { $0.id == "keyvault" })
- try assertSnapshot(SettingsView(model: m), "settings-keyvault", size: CGSize(width: 520, height: 1000))
}
/// The teleport run says which step it is on: reading the browser's
@@ -431,24 +420,13 @@ struct SnapshotTests {
try assertSnapshot(ThisMachineView(host: off), "this-machine-nothing-shared", size: CGSize(width: 640, height: 520))
}
- @Test func settings() async throws {
- let m = try await model()
- // With Storage (the Cua Volume experiment on), as recorded.
- m.settings.experiments.cuaVolume = true
- await m.loadSettings()
- try assertSnapshot(SettingsView(model: m), "settings", size: CGSize(width: 520, height: 640))
- }
-
/// Launch at login waiting for approval in System Settings (a fake
/// login item; the Mac's own is never touched).
@Test func settingsLoginItemApproval() async throws {
let item = FixtureLoginItem()
item.approval = true
- let m = try await model(loginItem: item)
+ _ = try await model(loginItem: item)
#expect(item.calls == ["register"], "the first run's Done registered it")
- m.settings.experiments.cuaVolume = true
- await m.loadSettings()
- try assertSnapshot(SettingsView(model: m), "settings-login-approval", size: CGSize(width: 520, height: 640))
}
@Test func keyvaultAll() async throws {
@@ -466,15 +444,6 @@ struct SnapshotTests {
try assertSnapshot(ApprovalSheet(keyvault: m.keyvault), "approval", size: CGSize(width: 480, height: 360))
}
- /// Settings → Devices on an account with this Mac enrolled, a new
- /// device and an expired one asking, and recent access.
- @Test func devicesPage() async throws {
- let d = DevicesTests().model()
- await d.refresh()
- d.approval = nil
- try assertSnapshot(DevicesSettingsView(devices: d), "devices", size: CGSize(width: 520, height: 700))
- }
-
/// A new device asking: its name and the code it shows, Approve (after
/// Touch ID) and Deny; then this Mac waiting with its own code.
@Test func deviceSheets() async throws {
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/devices.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/devices.png
deleted file mode 100644
index b5fdbe7cee..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/devices.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-auto-connect-off.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-auto-connect-off.png
deleted file mode 100644
index aa3e8af6e5..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-auto-connect-off.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-keyvault.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-keyvault.png
deleted file mode 100644
index ee13ee6bcd..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-keyvault.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-login-approval.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-login-approval.png
deleted file mode 100644
index 6adacda6d1..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-login-approval.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-storage.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-storage.png
deleted file mode 100644
index 7f49ab5453..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings-storage.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings.png
deleted file mode 100644
index 259475ab52..0000000000
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/settings.png and /dev/null differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/UpdatesTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/UpdatesTests.swift
index 7405483703..70e19ebb5b 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/UpdatesTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/UpdatesTests.swift
@@ -371,44 +371,6 @@ struct UpdatesTests {
URL(fileURLWithPath: $0).resolvingSymlinksInPath().path
} == URL(fileURLWithPath: me!).resolvingSymlinksInPath().path)
}
-
- // MARK: - Acknowledgements
-
- @Test func theNoticesParseIntoBlocks() {
- let blocks = NoticeBlock.parse("""
- # Third-party notices
-
- Intro line one
- line two.
-
- | Project | Used in | What |
- |---|---|---|
- | [A](https://a) | `x.swift` | a thing |
-
- ## Sparkle
-
- ```
- Copyright (c) 2006 Someone
- indented
- ```
- """)
- #expect(blocks == [
- .heading(1, "Third-party notices"),
- .paragraph("Intro line one line two."),
- .row(["[A](https://a)", "`x.swift`", "a thing"]),
- .heading(2, "Sparkle"),
- .verbatim("Copyright (c) 2006 Someone\n indented"),
- ])
- }
-
- @Test func theBundledNoticesNameSparkle() throws {
- let file = URL(fileURLWithPath: #filePath)
- .deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent()
- .appendingPathComponent("THIRD_PARTY_NOTICES.md")
- let blocks = NoticeBlock.parse(try String(contentsOf: file, encoding: .utf8))
- #expect(blocks.contains(.heading(2, "Sparkle")))
- #expect(blocks.contains { if case .verbatim(let t) = $0 { t.contains("Andy Matuschak") } else { false } })
- }
}
/// A copy installed over the running app: Sparkle cannot authorize its
diff --git a/apps/cua-spaces-macos/scripts/build-app.sh b/apps/cua-spaces-macos/scripts/build-app.sh
index ccf6f95c0a..b4e51f2d70 100755
--- a/apps/cua-spaces-macos/scripts/build-app.sh
+++ b/apps/cua-spaces-macos/scripts/build-app.sh
@@ -12,7 +12,7 @@
# (the app installs it onto PATH on first launch, like the Tauri app's
# sidecar), Sparkle.framework (the updater, from the pinned SwiftPM
# artifact, with its XPC services) in Contents/Frameworks and the
-# third-party notices (Settings, About, Acknowledgements), the host
+# third-party notices (THIRD_PARTY_NOTICES.md in Resources), the host
# service (the pinned cua-spacesd from scripts/fetch-spacesd.sh, or
# $CUA_SPACESD_BIN, in Contents/Helpers; the app's own executable runs it as
# its login item, whose SMAppService plist is in
diff --git a/apps/cua-spaces-web/src/bridge/README.md b/apps/cua-spaces-web/src/bridge/README.md
index ff5acf0c2e..e77c8224d4 100644
--- a/apps/cua-spaces-web/src/bridge/README.md
+++ b/apps/cua-spaces-web/src/bridge/README.md
@@ -189,10 +189,11 @@ speaks it as is:
`spaces.createProgress` events until it answers with the Space (or
`cancelled`). The app's own New Space items (⌘N, the menu bar, a machine's
"New Space on…") send `spaces.newRequested {on}`, which opens the wizard;
- the native sheet is the fallback while New UI is off. The app menu's
- Settings command (⌘,) sends `settings.openRequested` while the New UI
- window is in front, and the page goes to Settings (also with no focus in
- its web view). While New UI is on, the notch and the menu bar item send
+ the native sheet is the fallback while New UI is off. The app's
+ Settings items (⌘,, the menu bar item, the notch; New UI on or off) send
+ `settings.openRequested` while the window is open, or open it at
+ `/settings`, and the page goes to Settings (also with no focus in its web
+ view). The Mac app has no native Settings window. While New UI is on, the notch and the menu bar item send
`route.openRequested {path}` (a Space's tile `/spaces/<id>`, with
`?dropped=[names]` for a drop on it; the list `/spaces`; Settings
`/settings`), and the page goes there.