The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.
Profiles as in Arc: New Space keeps the space's profile, Spaces ▸ Change Profile, "Which Spaces should use this Profile?" (#164)
Victor Kildahl0678d7ec8ca2
diff --git a/Packages/CraCore/Sources/CraCore/SpaceProfiles.swift b/Packages/CraCore/Sources/CraCore/SpaceProfiles.swiftnew file mode 100644index 0000000..8495db5--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/SpaceProfiles.swift@@ -0,0 +1,13 @@+import Foundation++/// Arc's rules for which profile a space is on (Arc 1.171, watched in a fresh copy, 3 Nov 2026).+/// A space never gets cookies of its own by itself: every space is on Default until one is moved+/// onto another profile, and spaces on the same profile share their sign-ins.+public enum SpaceProfiles {+ /// New Space… preselects the profile of the space it was opened from ("Profile, Work" from a+ /// space on Work, "Profile, Default" from one on Default). A profile that is gone is Default.+ public static func forNewSpace(from focused: Space?, profiles: [BrowserProfile]) -> UUID? {+ guard let id = focused?.profileID, profiles.contains(where: { $0.id == id }) else { return nil }+ return id+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/SpaceProfilesTests.swift b/Packages/CraCore/Tests/CraCoreTests/SpaceProfilesTests.swiftnew file mode 100644index 0000000..1d2a115--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/SpaceProfilesTests.swift@@ -0,0 +1,22 @@+import CraCore+import Foundation+import Testing++/// A new space starts on the profile of the space it is made from, as in Arc.+struct SpaceProfilesTests {+ private func space(profile: UUID?) -> Space {+ Space(id: UUID(), title: "S", emoji: "🌱", theme: SpaceTheme.presets[0], favoritesContainerID: UUID(),+ pinnedContainerID: UUID(), todayContainerID: UUID(), createdAt: Date(), profileID: profile)+ }++ @Test func newSpaceTakesTheFocusedSpacesProfile() {+ let work = BrowserProfile(id: UUID(), name: "Work")+ #expect(SpaceProfiles.forNewSpace(from: space(profile: work.id), profiles: [work]) == work.id)+ #expect(SpaceProfiles.forNewSpace(from: space(profile: nil), profiles: [work]) == nil, "Default stays Default")+ #expect(SpaceProfiles.forNewSpace(from: nil, profiles: [work]) == nil)+ }++ @Test func aMissingProfileIsDefault() {+ #expect(SpaceProfiles.forNewSpace(from: space(profile: UUID()), profiles: []) == nil)+ }+}diff --git a/Sources/Cra/App/AppDelegate.swift b/Sources/Cra/App/AppDelegate.swiftindex d9641bd..12a102f 100644--- a/Sources/Cra/App/AppDelegate.swift+++ b/Sources/Cra/App/AppDelegate.swift@@ -930,6 +930,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {if isNew { LiveFolderManager.shared.refresh(f.id) }case "newSpace": main.showSpaceEditor(space: nil)case "editSpace": if !main.isIncognito { main.showSpaceEditor(space: store.focusedSpace) }+ case "changeProfile": if !main.isIncognito { main.showChangeProfileDialog(forSpace: store.focusedSpace.id) }case "deleteSpace": if !main.isIncognito { confirmDeleteSpace(store.focusedSpace) }case "manageSpaces": if !main.isIncognito { main.showManageSpaces() }case "closeTab":@@ -1061,7 +1062,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {self.settingsWindow?.close()self.main.showWindow(nil)},- exportDiagnostics: { [weak self] in self?.exportDiagnostics() })+ exportDiagnostics: { [weak self] in self?.exportDiagnostics() },+ newProfile: { [weak self] in+ guard let self, let w = self.settingsWindow else { return }+ self.main.showNewProfileDialog(over: w)+ })let c = SettingsWindowController(store: store, bindings: bindings, actions: actions)settingsController = csettingsWindow = c.window@@ -1160,7 +1165,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {let spaces = NSMenu(title: "Spaces")spaces.addItem(item("nextSpace")); spaces.addItem(item("previousSpace"))spaces.addItem(.separator())- spaces.addItem(item("editSpace")); spaces.addItem(item("deleteSpace")); spaces.addItem(item("manageSpaces"))+ for id in ["editSpace", "changeProfile", "deleteSpace", "manageSpaces"] { spaces.addItem(item(id)) }spaces.addItem(.separator())for n in 1...9 { spaces.addItem(item("space\(n)")) }spaces.addItem(.separator())diff --git a/Sources/Cra/App/KeyBindings.swift b/Sources/Cra/App/KeyBindings.swiftindex fec3d9d..ec15b18 100644--- a/Sources/Cra/App/KeyBindings.swift+++ b/Sources/Cra/App/KeyBindings.swift@@ -186,6 +186,7 @@ final class KeyBindingRegistry {KeyAction(id: "nextSpace", name: "Next Space", section: .spaces, shortcuts: [Shortcut(Shortcut.right, cmdOpt)], inCommandBar: false),KeyAction(id: "previousSpace", name: "Previous Space", section: .spaces, shortcuts: [Shortcut(Shortcut.left, cmdOpt)], inCommandBar: false),KeyAction(id: "editSpace", name: "Edit Space…", section: .spaces, shortcuts: [], triggers: ["theme", "color", "emoji", "edit space"]),+ KeyAction(id: "changeProfile", name: "Change Profile", section: .spaces, shortcuts: [], triggers: ["profile", "change profile", "set profile"]),KeyAction(id: "deleteSpace", name: "Delete Space…", section: .spaces, shortcuts: [], triggers: ["delete space", "remove space"]),KeyAction(id: "manageSpaces", name: "Manage Spaces…", section: .spaces, shortcuts: [], triggers: ["manage spaces", "reorder spaces"]),// Tabsdiff --git a/Sources/Cra/UI/Settings/ProfilesPane.swift b/Sources/Cra/UI/Settings/ProfilesPane.swiftindex b6f9534..daa13fd 100644--- a/Sources/Cra/UI/Settings/ProfilesPane.swift+++ b/Sources/Cra/UI/Settings/ProfilesPane.swift@@ -7,7 +7,6 @@ struct ProfilesPane: View {let actions: SettingsActions@Environment(SidebarStore.self) private var store@State private var naming: BrowserProfile?- @State private var creating = false@State private var name = ""@State private var deleting: BrowserProfile?@@ -26,7 +25,7 @@ struct ProfilesPane: View {}}HStack {- Button("Create Profile…") { name = ""; creating = true }+ Button("Create Profile…") { actions.newProfile() }Spacer()// Spaces an Arc import left on Default, back on their Arc profiles (#131).if ArcProfileRebuilder.isAvailable {@@ -35,14 +34,7 @@ struct ProfilesPane: View {}}.padding(.top, 7.5)- SettingsFootnote("Profiles help keep your data separate across Spaces, like logins, cookies and site data. You can use any Profile across one or more Spaces: right-click a Space and choose Edit Space to pick one. Only Profiles not assigned to any Spaces can be deleted.")- }- .alert("Create a new Profile", isPresented: $creating) {- TextField("Profile name", text: $name)- Button("Create") { if !trimmed.isEmpty { store.createProfile(name: trimmed) } }- Button("Cancel", role: .cancel) {}- } message: {- Text("What do you want to call this Profile?")+ SettingsFootnote("Profiles help keep your data separate across Spaces, like logins, cookies and site data. You can use any Profile across one or more Spaces: choose Spaces ▸ Change Profile, or Set Profile on a Space's menu. Spaces on the same Profile share their logins. Only Profiles not assigned to any Spaces can be deleted.")}.alert("Rename Profile", isPresented: Binding(get: { naming != nil }, set: { if !$0 { naming = nil } })) {TextField("Profile name", text: $name)diff --git a/Sources/Cra/UI/Settings/SettingsWindowController.swift b/Sources/Cra/UI/Settings/SettingsWindowController.swiftindex 33e17ac..8a618a8 100644--- a/Sources/Cra/UI/Settings/SettingsWindowController.swift+++ b/Sources/Cra/UI/Settings/SettingsWindowController.swift@@ -7,6 +7,7 @@ struct SettingsActions {var rebuildArcProfiles: () -> Void = {}var openURL: (String) -> Void = { _ in }var exportDiagnostics: () -> Void = {}+ var newProfile: () -> Void = {}}/// The panes in Dia's Settings sidebar (Dia 1.54.2: Account, Tabs, Privacy, Profiles, Skills,diff --git a/Sources/Cra/UI/Settings/ShortcutsPane.swift b/Sources/Cra/UI/Settings/ShortcutsPane.swiftindex 44554cc..6795d27 100644--- a/Sources/Cra/UI/Settings/ShortcutsPane.swift+++ b/Sources/Cra/UI/Settings/ShortcutsPane.swift@@ -288,6 +288,7 @@ enum ShortcutDescriptions {"nextSpace": "Switch to the next space.","previousSpace": "Switch to the previous space.","editSpace": "Change the space’s name, emoji and theme.",+ "changeProfile": "Pick the profile the space’s sign-ins, cookies and extensions come from.","deleteSpace": "Delete the current space.","manageSpaces": "Open the Library’s Spaces page: every space side by side, to reorder or edit them.","pinTab": "Pin the tab or unpin it.",diff --git a/Sources/Cra/UI/Windows/MainWindowController+SpaceMenu.swift b/Sources/Cra/UI/Windows/MainWindowController+SpaceMenu.swiftindex 6d956b0..774df6e 100644--- a/Sources/Cra/UI/Windows/MainWindowController+SpaceMenu.swift+++ b/Sources/Cra/UI/Windows/MainWindowController+SpaceMenu.swift@@ -56,18 +56,46 @@ extension MainWindowController {window.addChildWindow(panel, ordered: .above)panel.makeKeyAndOrderFront(nil)}- /// Set Profile ▸ New Profile…: Arc's dialog over the dimmed window; Next makes the profile and- /// moves the space into it (pages already open reload in it, BrowserManager).+ /// Set Profile ▸ New Profile…: Arc's dialog over the dimmed window; Next asks which spaces use+ /// the profile (this one ticked) and Create Profile moves them into it (pages already open+ /// reload in it, BrowserManager).func showNewProfileDialog(forSpace id: UUID) {guard let window else { return }+ showNewProfileDialog(over: window, ticked: [id])+ }++ /// Settings ▸ Profiles ▸ Create Profile…: the same dialog over Settings, no space ticked.+ func showNewProfileDialog(over window: NSWindow, ticked: Set<UUID> = []) {+ DialogOverlayWindow.present(over: window) { close in+ NewProfileDialog(spaces: profileSpaces, ticked: ticked, onCreate: { [weak self] name, ids in+ self?.createProfile(name: name, forSpaces: ids)+ close()+ }, onCancel: close)+ }+ }++ /// Spaces ▸ Change Profile: Arc's "Change <space>’s Profile" dialog for the focused space.+ func showChangeProfileDialog(forSpace id: UUID) {+ guard let window, let space = store.space(id) else { return }let store = self.storeDialogOverlayWindow.present(over: window) { close in- NewProfileDialog(onCreate: { name in- store.setProfile(store.createProfile(name: name).id, forSpace: id)+ ChangeProfileDialog(space: space, profiles: store.profiles, spaces: profileSpaces, onChange: { p in+ store.setProfile(p, forSpace: id)+ close()+ }, onCreate: { [weak self] name, ids in+ self?.createProfile(name: name, forSpaces: ids)close()}, onCancel: close)}}++ /// The spaces a profile can be given to: every space but incognito ones, in sidebar order.+ private var profileSpaces: [Space] { store.orderedSpaces.filter { !store.isIncognito(space: $0.id) } }++ private func createProfile(name: String, forSpaces ids: Set<UUID>) {+ let p = store.createProfile(name: name)+ for s in profileSpaces where ids.contains(s.id) { store.setProfile(p.id, forSpace: s.id) }+ }/// Manage Spaces…: the Library on its Spaces page, every space side by side.func showManageSpaces() { showLibrary(.spaces) }}diff --git a/Sources/Cra/UI/Windows/MainWindowController.swift b/Sources/Cra/UI/Windows/MainWindowController.swiftindex 6aaa322..227c587 100644--- a/Sources/Cra/UI/Windows/MainWindowController.swift+++ b/Sources/Cra/UI/Windows/MainWindowController.swift@@ -2427,7 +2427,9 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMfunc showSpaceEditor(space: Space?) {guard let window else { return }let panel = NSPanel(contentRect: NSRect(x: 0, y: 0, width: 520, height: 520), styleMask: [.titled], backing: .buffered, defer: false)- let view = SpaceEditorView(existing: space, profiles: store.profiles, onSave: { [weak self, weak panel] title, emoji, theme, profile, newName in+ // Arc's New Space starts on the profile of the space it was opened from.+ let initialProfile = space == nil && !isIncognito ? SpaceProfiles.forNewSpace(from: store.focusedSpace, profiles: store.profiles) : nil+ let view = SpaceEditorView(existing: space, profiles: store.profiles, initialProfile: initialProfile, onSave: { [weak self, weak panel] title, emoji, theme, profile, newName inguard let self else { return }let id: UUIDif var s = space {diff --git a/Sources/Cra/UI/Windows/NewProfileDialog.swift b/Sources/Cra/UI/Windows/NewProfileDialog.swiftindex bd26033..8a6bd1b 100644--- a/Sources/Cra/UI/Windows/NewProfileDialog.swift+++ b/Sources/Cra/UI/Windows/NewProfileDialog.swift@@ -2,18 +2,43 @@ import AppKitimport SwiftUI/// Arc 1.171's "Create a new Profile" dialog (Set Profile ▸ New Profile…), measured from a 2x-/// capture (1 Nov): a 450 × 426 pt navy card centred on the window, which dims behind it.+/// capture (1 Nov): a 450 × 426 pt navy card centred on the window, which dims behind it. Next+/// goes on to "Which Spaces should use this Profile?" (3 Nov), with the space it was opened for+/// ticked; Create Profile makes the profile and moves the ticked spaces onto it.struct NewProfileDialog: View {- let onCreate: (String) -> Void+ let spaces: [Space]+ let onCreate: (String, Set<UUID>) -> Voidlet onCancel: () -> Void@State private var name = ""+ @State private var ticked: Set<UUID>+ @State private var choosingSpaces = false@FocusState private var focused: Bool- private static let card = Color(hex: "#161C2F")- private static let body = Color(hex: "#B8B9C4")+ static let card = Color(hex: "#161C2F")+ static let body = Color(hex: "#B8B9C4")private var trimmed: String { name.trimmingCharacters(in: .whitespaces) }+ init(spaces: [Space], ticked: Set<UUID>, onCreate: @escaping (String, Set<UUID>) -> Void, onCancel: @escaping () -> Void) {+ self.spaces = spaces+ self.onCreate = onCreate+ self.onCancel = onCancel+ _ticked = State(initialValue: ticked)+ }+var body: some View {+ if choosingSpaces {+ ProfileSpacesStep(spaces: spaces, ticked: $ticked, onBack: { choosingSpaces = false }) { onCreate(trimmed, ticked) }+ } else {+ nameStep+ }+ }++ private func next() {+ guard !trimmed.isEmpty else { return }+ if spaces.isEmpty { onCreate(trimmed, []) } else { choosingSpaces = true }+ }++ private var nameStep: some View {VStack(alignment: .leading, spacing: 0) {ProfileAvatar().padding(.top, 38.5)Text("Create a new Profile")@@ -37,7 +62,7 @@ struct NewProfileDialog: View {.font(.system(size: 14)).foregroundStyle(.white).focused($focused)- .onSubmit { if !trimmed.isEmpty { onCreate(trimmed) } }+ .onSubmit(next).padding(.horizontal, 12.5).frame(height: 49).background(RoundedRectangle(cornerRadius: 8, style: .continuous).strokeBorder(Color(hex: "#23293B"), lineWidth: 1))@@ -53,7 +78,7 @@ struct NewProfileDialog: View {Spacer()DialogButton(title: "Cancel", key: "ESC", enabled: true, primary: false, action: onCancel).keyboardShortcut(.cancelAction)- DialogButton(title: "Next", key: "↩", enabled: !trimmed.isEmpty, primary: true) { onCreate(trimmed) }+ DialogButton(title: "Next", key: "↩", enabled: !trimmed.isEmpty, primary: true, action: next)}.padding(.top, 27)Spacer(minLength: 0)@@ -132,7 +157,7 @@ struct DialogButton: View {}/// Arc's profile glyph: a lavender smiley in a dashed ring with a green plus badge.-private struct ProfileAvatar: View {+struct ProfileAvatar: View {var body: some View {ZStack(alignment: .bottomTrailing) {ZStack {@@ -161,7 +186,7 @@ private struct ProfileAvatar: View {}}-private struct SmileArc: Shape {+struct SmileArc: Shape {func path(in r: CGRect) -> Path {var p = Path()p.move(to: CGPoint(x: r.minX, y: r.minY))diff --git a/Sources/Cra/UI/Windows/ProfileDialogs.swift b/Sources/Cra/UI/Windows/ProfileDialogs.swiftnew file mode 100644index 0000000..309a110--- /dev/null+++ b/Sources/Cra/UI/Windows/ProfileDialogs.swift@@ -0,0 +1,252 @@+import SwiftUI++/// Arc 1.171's "Which Spaces should use this Profile?" (the second step of Create a new Profile),+/// measured from a 2x capture (3 Nov): a 450 × 506 pt card; each space as a 63 × 95 pt card in its+/// theme over a 16 pt circle (green with a tick when chosen) and its name, 76 pt apart.+struct ProfileSpacesStep: View {+ let spaces: [Space]+ @Binding var ticked: Set<UUID>+ let onBack: () -> Void+ let onCreate: () -> Void++ var body: some View {+ VStack(alignment: .leading, spacing: 0) {+ ProfileAvatar().padding(.top, 38.5)+ Text("Which Spaces should use this Profile?")+ .font(.system(size: 17.5, weight: .semibold))+ .foregroundStyle(.white)+ .padding(.top, 19)+ Text("These Spaces will start fresh in your brand new Profile — so you’ll have to log back in to websites, re-save your passwords, add extensions, etc. You can always switch back to your previous Profile though if you forgot something!")+ .font(.system(size: 14))+ .lineSpacing(0.7)+ .foregroundStyle(NewProfileDialog.body)+ .fixedSize(horizontal: false, vertical: true)+ .frame(width: 375.5, alignment: .leading)+ .padding(.top, 12)+ ScrollView(.horizontal, showsIndicators: false) {+ HStack(alignment: .top, spacing: 13) {+ ForEach(spaces) { s in+ SpaceChoice(space: s, on: ticked.contains(s.id)) {+ if ticked.contains(s.id) { ticked.remove(s.id) } else { ticked.insert(s.id) }+ }+ }+ }+ .padding(.horizontal, 38.5)+ }+ .padding(.horizontal, -38.5)+ .frame(height: 155)+ .padding(.top, 14)+ HStack(spacing: 7) {+ Spacer()+ DialogButton(title: "Back", key: "ESC", enabled: true, primary: false, action: onBack)+ .keyboardShortcut(.cancelAction)+ DialogButton(title: "Create Profile", key: "↩", enabled: true, style: .accent, action: onCreate)+ .keyboardShortcut(.defaultAction)+ }+ .padding(.top, 31)+ Spacer(minLength: 0)+ }+ .padding(.horizontal, 38.5)+ .frame(width: 450, height: 506)+ .background(NewProfileDialog.card, in: RoundedRectangle(cornerRadius: 24, style: .continuous))+ .environment(\.colorScheme, .dark)+ }+}++/// One space in the step above: the theme as a little window, the circle, the name.+private struct SpaceChoice: View {+ let space: Space+ let on: Bool+ let toggle: () -> Void++ var body: some View {+ Button(action: toggle) {+ VStack(spacing: 14.5) {+ ZStack {+ Color(white: space.theme.palette.isDark ? 0.12 : 0.97)+ SpaceBackground(palette: space.theme.palette)+ }+ .frame(width: 63, height: 95)+ .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))+ .overlay(RoundedRectangle(cornerRadius: 12, style: .continuous).strokeBorder(.white.opacity(0.3), lineWidth: 1))+ ZStack {+ if on {+ Circle().fill(Color(hex: "#007C00"))+ Image(systemName: "checkmark").font(.system(size: 8.5, weight: .bold)).foregroundStyle(Color(hex: "#062A1E"))+ } else {+ Circle().strokeBorder(Color(hex: "#5B616F"), lineWidth: 1.5)+ }+ }+ .frame(width: 16, height: 16)+ Text(space.title)+ .font(.system(size: 12))+ .foregroundStyle(Color(hex: "#C8CAD2"))+ .lineLimit(1)+ .frame(width: 76)+ }+ .frame(width: 63)+ .contentShape(Rectangle())+ }+ .buttonStyle(.plain)+ .accessibilityLabel(space.title)+ .accessibilityValue(on ? "1" : "0")+ }+}++/// Arc 1.171's Spaces ▸ Change Profile (3 Nov): "Change <space>’s Profile" on a 450 × 338 pt+/// card, the space's icon on a blue tile with a profile badge, and a blue pill that picks Default,+/// another profile or New Profile. Change Profile with New Profile goes on to Create a new Profile.+struct ChangeProfileDialog: View {+ let space: Space+ let profiles: [BrowserProfile]+ let others: [Space]+ let onChange: (UUID?) -> Void+ let onCreate: (String, Set<UUID>) -> Void+ let onCancel: () -> Void+ @State private var choice: SpaceProfileChoice+ @State private var creating = false+ @State private var pill = CGRect.zero++ init(space: Space, profiles: [BrowserProfile], spaces: [Space], onChange: @escaping (UUID?) -> Void,+ onCreate: @escaping (String, Set<UUID>) -> Void, onCancel: @escaping () -> Void) {+ self.space = space+ self.profiles = profiles+ self.others = spaces+ self.onChange = onChange+ self.onCreate = onCreate+ self.onCancel = onCancel+ _choice = State(initialValue: .existing(space.profileID))+ }++ var body: some View {+ if creating {+ NewProfileDialog(spaces: others, ticked: [space.id], onCreate: onCreate, onCancel: onCancel)+ } else {+ picker+ }+ }++ private var choiceName: String {+ switch choice {+ case .new: return "New Profile"+ case .existing(let id): return profiles.first { $0.id == id }?.name ?? "Default"+ }+ }++ private func showMenu() {+ // The dialog's own window, which needn't be key (Cra may be in the background).+ guard let content = NSApp.windows.last(where: { $0 is DialogOverlayWindow && $0.isVisible })?.contentView else { return }+ let m = NSMenu()+ m.autoenablesItems = false+ MenuItems.add(m, "Default") { choice = .existing(nil) }+ for p in profiles { MenuItems.add(m, p.name) { choice = .existing(p.id) } }+ m.addItem(.separator())+ MenuItems.add(m, "New Profile") { choice = .new }+ // SwiftUI's global frame is top-left based in the window; the content view is not flipped.+ let y = content.isFlipped ? pill.maxY + 4 : content.bounds.height - pill.maxY - 4+ // Next turn of the run loop, so the button's press returns before the menu tracks.+ DispatchQueue.main.async { m.popUp(positioning: nil, at: NSPoint(x: pill.minX, y: y), in: content) }+ }++ private func confirm() {+ switch choice {+ case .new: creating = true+ case .existing(let id): if id == space.profileID { onCancel() } else { onChange(id) }+ }+ }++ private var picker: some View {+ VStack(alignment: .leading, spacing: 0) {+ SpaceProfileIcon(space: space).padding(.top, 38)+ (Text("Change ") + Text("\(space.title)’s").bold() + Text(" Profile"))+ .font(.system(size: 17.5))+ .foregroundStyle(.white)+ .padding(.top, 17)+ Text("Each Profile has different browser data, so you might get logged out of some websites, see different Favorites up top, or need to re-install extensions.")+ .font(.system(size: 14))+ .lineSpacing(0.7)+ .foregroundStyle(NewProfileDialog.body)+ .fixedSize(horizontal: false, vertical: true)+ .frame(width: 375.5, alignment: .leading)+ .padding(.top, 12)+ HStack(spacing: 6) {+ (Text("\(space.title)’s").bold() + Text(" Profile"))+ .font(.system(size: 14))+ .foregroundStyle(Color(hex: "#DBDCDF"))+ // An NSMenu under the pill, like Arc's (Default, the other profiles, New Profile).+ Button(action: showMenu) {+ // Arc's lavender circle with the chevron cut in the pill's blue, 14 pt.+ HStack(spacing: 5) {+ ZStack {+ Circle().fill(Color(hex: "#BEC0F3"))+ Image(systemName: "chevron.down").font(.system(size: 7, weight: .heavy)).foregroundStyle(Color(hex: "#2E36E7"))+ .offset(y: 0.5)+ }+ .frame(width: 14, height: 14)+ Text(choiceName).font(.system(size: 14)).foregroundStyle(Color(hex: "#BEC0F3"))+ }+ .padding(.horizontal, 8)+ .frame(height: 27)+ .background(Color(hex: "#2E36E7"), in: RoundedRectangle(cornerRadius: 4, style: .continuous))+ .background(GeometryReader { g in Color.clear.onAppear { pill = g.frame(in: .global) }+ .onChange(of: g.frame(in: .global)) { _, f in pill = f } })+ }+ .buttonStyle(.plain)+ .fixedSize()+ .accessibilityElement(children: .ignore)+ .accessibilityLabel(choiceName)+ .accessibilityAddTraits(.isButton)+ .accessibilityAction { showMenu() }+ }+ .padding(.top, 8)+ HStack(spacing: 7) {+ Spacer()+ DialogButton(title: "Cancel", key: "ESC", enabled: true, primary: false, action: onCancel)+ .keyboardShortcut(.cancelAction)+ DialogButton(title: "Change Profile", key: "↩", enabled: true, style: .accent, action: confirm)+ .keyboardShortcut(.defaultAction)+ }+ .padding(.top, 27.5)+ Spacer(minLength: 0)+ }+ .padding(.horizontal, 38.5)+ .frame(width: 450, height: 338)+ .background(NewProfileDialog.card, in: RoundedRectangle(cornerRadius: 24, style: .continuous))+ .environment(\.colorScheme, .dark)+ }+}++/// The space's emoji (or Icon-tab glyph) on Arc's 62 pt blue tile, with the profile smiley badge.+private struct SpaceProfileIcon: View {+ let space: Space++ var body: some View {+ ZStack(alignment: .bottomTrailing) {+ ZStack {+ RoundedRectangle(cornerRadius: 14, style: .continuous).fill(Color(hex: "#4049DC"))+ if let symbol = space.symbol {+ Image(systemName: symbol).font(.system(size: 26, weight: .medium)).foregroundStyle(.white)+ } else {+ Text(space.emoji.isEmpty ? "🌱" : space.emoji).font(.system(size: 30))+ }+ }+ .frame(width: 62, height: 62)+ .frame(width: 68, height: 68, alignment: .topLeading)+ ZStack {+ Circle().fill(Color(hex: "#30305D"))+ Circle().strokeBorder(Color(hex: "#6262A3"), lineWidth: 1.5)+ VStack(spacing: 2.5) {+ HStack(spacing: 3.5) {+ Capsule().fill(Color(hex: "#C4C4DC")).frame(width: 2, height: 5)+ Capsule().fill(Color(hex: "#C4C4DC")).frame(width: 2, height: 5)+ }+ SmileArc().stroke(Color(hex: "#C4C4DC"), style: StrokeStyle(lineWidth: 2, lineCap: .round))+ .frame(width: 10, height: 2.5)+ }+ }+ .frame(width: 23, height: 23)+ .overlay(Circle().strokeBorder(NewProfileDialog.card, lineWidth: 2))+ }+ .frame(width: 68, height: 68)+ }+}diff --git a/Sources/Cra/UI/Windows/SpaceEditorView.swift b/Sources/Cra/UI/Windows/SpaceEditorView.swiftindex dfd51cd..907f4f3 100644--- a/Sources/Cra/UI/Windows/SpaceEditorView.swift+++ b/Sources/Cra/UI/Windows/SpaceEditorView.swift@@ -26,11 +26,12 @@ struct SpaceEditorView: View {private static let emojis = ["🌱", "💼", "🏠", "🎨", "🧪", "📚", "🎮", "🎵", "🛒", "✈️", "💡", "🔥", "🌊", "🍕", "🐦", "🧑💻","📈", "🧠", "❤️", "⭐️", "🌙", "☕️", "🏃", "📷", "🎬", "🧩", "🪴", "🏔️", "🛠️", "💰", "📝", "🎯"]- init(existing: Space?, profiles: [BrowserProfile], onSave: @escaping (String, String, SpaceTheme, SpaceProfileChoice, String) -> Void,- onCancel: @escaping () -> Void) {+ /// `initialProfile` is a new space's starting profile (Arc: the focused space's).+ init(existing: Space?, profiles: [BrowserProfile], initialProfile: UUID? = nil,+ onSave: @escaping (String, String, SpaceTheme, SpaceProfileChoice, String) -> Void, onCancel: @escaping () -> Void) {self.existing = existingself.profiles = profiles- _profile = State(initialValue: .existing(existing?.profileID))+ _profile = State(initialValue: .existing(existing == nil ? initialProfile : existing?.profileID))self.onSave = onSaveself.onCancel = onCancellet t = existing?.theme ?? SpaceTheme.presets[Int.random(in: 0..<5)]diff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.mdindex e3a8076..cd78b78 100644--- a/docs/arc-reverse-engineering.md+++ b/docs/arc-reverse-engineering.md@@ -780,6 +780,31 @@ Observed live on a throwaway Today split (example.com | example.org), archived abetween arrows (#F1EAE5 #E69FBA #9E749B #E1686F #EF8C62 #F2D66D #73E59C #7FB8D6 #666786); a 224 × 15 pt waveslider and a dotted dial.+### Profiles and spaces: who shares cookies (Arc 1.171, live in a fake-home copy, 3 Nov)+- [O] A space's cookies, logins, history and extensions are its profile's. Every space is on Default+ (`"profile": {"default": true}`) until it is moved; spaces on one profile share sign-ins. There is no+ setting for "cookies per space": Settings, Spaces menu and space menu only pick a space's profile.+ Victor's own Arc: both spaces on Default. Favorites are per profile too (topAppsContainerIDs).+- [O] New Space… (sidebar "Create a Space": Space name…, `Profile [Default ▾] ⓘ`, Choose a Theme,+ Create Space / Cancel) preselects the focused space's profile: AX `Profile, Work` from a space on Work,+ `Profile, Default` from one on Default.+- [O] Spaces ▸ Change Profile: a 450 × 338 sheet, the space icon on a 62 pt #4049DC tile with the+ profile badge, "Change **<space>’s** Profile", "Each Profile has different browser data, so you might+ get logged out of some websites, see different Favorites up top, or need to re-install extensions.",+ "**<space>’s** Profile" + a #2E36E7 pill (`spacePicker`; 14 pt #BEC0F3 circle with the chevron in+ the pill blue, the name in #BEC0F3) opening an NSMenu Default | other profiles | — | New Profile;+ Cancel `ESC` / Change Profile `↩`. Change Profile with New Profile opens Create a new Profile.+- [O] Create a new Profile ▸ Next ▸ "Which Spaces should use this Profile?" (450 × 506): "These Spaces+ will start fresh in your brand new Profile — so you’ll have to log back in to websites, re-save your+ passwords, add extensions, etc. You can always switch back to your previous Profile though if you+ forgot something!", one 63 × 95 theme card per space 76 pt apart, a 16 pt circle under each (#5B616F+ ring; #007C00 with a tick when chosen, the space it was opened for already ticked), the name;+ Back `ESC` / Create Profile `↩`.+- [O] Settings ▸ Profiles: "Your Profiles" with "N Space" counts and + / − / rename; per profile Search+ engine, Search Settings…, Include search engine suggestions, Archive tabs after (asks "all of your+ Profiles, or only your X Profile?"), New documents, Download location, and Privacy and Security,+ Passwords, Credit Cards, Notifications, Clear Browsing Data.+### One space (Arc 1.171, static)- [O strings] Defaults key `showSpaceHeaderOnSingleUnnamedSpaces` (+ `…DidChange` action); the space contextmenu has "Show Space Header" / "Hide Space Header" ("Menu item to toggle space header visibility").