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.
Blank Window (⌃⌘N) and a tab dragged out of the window opens in one, as in Arc (#220, #219)
Victorf1d9c56aafff
diff --git a/Packages/CraCore/Sources/CraCore/BlankWindow.swift b/Packages/CraCore/Sources/CraCore/BlankWindow.swiftnew file mode 100644index 0000000..eb291d8--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/BlankWindow.swift@@ -0,0 +1,48 @@+import Foundation++/// Arc's Blank Window (File ▸ Blank Window, ⌃⌘N; GitHub #220): a normal-profile window whose+/// sidebar is its own. Arc keeps it as a `standalone` sidebar container keyed by the window+/// (`sidebarContext: standalone` in StorableWindows.json, `{standalone: <window id>}` in+/// StorableSidebar.json) beside the global one every other window shares. Seen in Arc 1.172+/// (6 Nov 2026): the header reads "This Window", there are no favorites, no pinned section and no+/// space icons, the command bar opens, and closing the window removes its container.+/// Cra gives the window a space of its own that no space list shows (`Space.standaloneWindowID`).+public enum BlankWindow {+ /// The sidebar header, Arc's words.+ public static let title = "This Window"++ /// Arc's theme-less window, a plain grey-violet. Fitted on window captures (dark mode, inactive):+ /// Arc's sidebar is #313246 at the top and #363247 at the bottom, Cra draws this as #303145 and+ /// #363548. (Arc's empty page area is lighter than Cra's, #4F4B5D against #3A3B4E.)+ public static let theme = SpaceTheme(colors: ["#222337", "#2B273A"], intensity: 0.9, noise: 0.08, appearance: "dark")++ /// The space a new Blank Window shows, with its three containers.+ public static func space(window: UUID, at date: Date, id: UUID = UUID()) -> (space: Space, containers: [SidebarItem]) {+ let favorites = SidebarItem.container(.favorites(spaceID: id))+ let pinned = SidebarItem.container(.pinned(spaceID: id))+ let today = SidebarItem.container(.today(spaceID: id))+ let space = Space(id: id, title: title, emoji: "", theme: theme, favoritesContainerID: favorites.id,+ pinnedContainerID: pinned.id, todayContainerID: today.id, createdAt: date,+ standaloneWindowID: window)+ return (space, [favorites, pinned, today])+ }++ /// The order of the spaces a sidebar lists, from a saved file: the saved order, then any+ /// space the order missed. A Blank Window's space is never listed.+ public static func spaceOrder(saved: [UUID], spaces: [Space]) -> [UUID] {+ let listed = spaces.filter { $0.standaloneWindowID == nil }+ let known = Set(listed.map(\.id))+ var order = saved.filter { known.contains($0) }+ for s in listed where !order.contains(s.id) { order.append(s.id) }+ return order+ }++ /// Blank Windows' spaces whose window is not among the saved windows (windows.json lost or+ /// reset, or a crash between the two files): they go, as the window would have taken them.+ public static func orphans(spaces: [Space], windows: [WindowSession]) -> Set<UUID> {+ Set(spaces.compactMap { s in+ guard let wid = s.standaloneWindowID else { return nil }+ return windows.contains { $0.id == wid && $0.focusedSpaceID == s.id } ? nil : s.id+ })+ }+}diff --git a/Packages/CraCore/Sources/CraCore/SidebarModel.swift b/Packages/CraCore/Sources/CraCore/SidebarModel.swiftindex 05a26d4..837febe 100644--- a/Packages/CraCore/Sources/CraCore/SidebarModel.swift+++ b/Packages/CraCore/Sources/CraCore/SidebarModel.swift@@ -267,9 +267,12 @@ public struct Space: Identifiable, Codable, Equatable {public var profileID: UUID?/// An SF Symbol from the Icon tab of Arc's icon picker, shown instead of `emoji` (then empty).public var symbol: String? = nil+ /// The Blank Window this space belongs to (Arc: a `standalone` sidebar container keyed by its+ /// window). Such a space is in no window's space list and goes when its window closes (BlankWindow).+ public var standaloneWindowID: UUID? = nilpublic init(id: UUID, title: String, emoji: String, theme: SpaceTheme, favoritesContainerID: UUID, pinnedContainerID: UUID,- todayContainerID: UUID, createdAt: Date, profileID: UUID? = nil, symbol: String? = nil) {+ todayContainerID: UUID, createdAt: Date, profileID: UUID? = nil, symbol: String? = nil, standaloneWindowID: UUID? = nil) {self.id = idself.title = titleself.emoji = emoji@@ -280,6 +283,7 @@ public struct Space: Identifiable, Codable, Equatable {self.createdAt = createdAtself.profileID = profileIDself.symbol = symbol+ self.standaloneWindowID = standaloneWindowID}}@@ -770,6 +774,7 @@ extension Space {createdAt = try c.decode(Date.self, forKey: .createdAt)profileID = try c.decodeIfPresent(UUID.self, forKey: .profileID)symbol = try c.decodeIfPresent(String.self, forKey: .symbol)+ standaloneWindowID = try c.decodeIfPresent(UUID.self, forKey: .standaloneWindowID)// Edit Space… → Save in 0.1.31 and older wrote 🌱 beside a space's symbol, and the sidebar// drew both stacked (#205). The symbol was the space's icon, so the emoji beside it goes.if symbol?.isEmpty == false { emoji = "" }diff --git a/Packages/CraCore/Sources/CraCore/TabTearOff.swift b/Packages/CraCore/Sources/CraCore/TabTearOff.swiftnew file mode 100644index 0000000..09274ad--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/TabTearOff.swift@@ -0,0 +1,30 @@+import CoreGraphics++/// A sidebar tab dragged out of the window and let go where no Cra window is (GitHub #219).+/// Arc 1.172 (6 Nov 2026, offline copy, real drags): the tab leaves its space and opens alone in+/// a new Blank Window ("This Window", BlankWindow) the size of the window it came from; the+/// window it left shows no tab if that one was open. Dropped near the screen's top left, the new+/// window sat exactly 20 pt inside the visible frame on both axes.+public enum TabTearOff {+ /// How far inside the screen's visible frame the window stays.+ public static let inset: CGFloat = 20++ /// Whether a drag that ended this way opens the tab in a new window: a tab (not a folder or+ /// a split), let go where nothing took it and over no window of the app. An incognito tab+ /// stays in its window: a Blank Window's pages load in the normal profile.+ public static func tearsOff(isTab: Bool, incognito: Bool, dropAccepted: Bool, overAppWindow: Bool) -> Bool {+ isTab && !incognito && !dropAccepted && !overAppWindow+ }++ /// The new window's frame (AppKit screen coordinates, origin bottom left): `size`, centred on+ /// where the pointer let go, moved inside `visible` (the screen's visible frame) less the inset.+ /// A window larger than that room shrinks to fit it.+ public static func frame(size: CGSize, droppedAt point: CGPoint, visible: CGRect) -> CGRect {+ let room = visible.insetBy(dx: inset, dy: inset)+ guard room.width > 0, room.height > 0 else { return CGRect(origin: point, size: size) }+ let w = min(size.width, room.width), h = min(size.height, room.height)+ let x = min(max(point.x - w / 2, room.minX), room.maxX - w)+ let y = min(max(point.y - h / 2, room.minY), room.maxY - h)+ return CGRect(x: x, y: y, width: w, height: h)+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift b/Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swiftnew file mode 100644index 0000000..8eb06c1--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift@@ -0,0 +1,55 @@+import CraCore+import Foundation+import Testing++/// Arc's Blank Window: a window whose sidebar is its own, in no space list (Arc 1.172, #220).+struct BlankWindowTests {+ let date = Date(timeIntervalSince1970: 1_800_000_000)++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/220"))+ func aBlankWindowsSpaceIsThisWindowAndBelongsToIt() {+ let window = UUID()+ let (space, containers) = BlankWindow.space(window: window, at: date)+ #expect(space.title == "This Window")+ #expect(space.emoji.isEmpty && space.symbol == nil)+ #expect(space.standaloneWindowID == window)+ #expect(space.profileID == nil) // the normal Default profile, not incognito+ #expect(containers.map(\.id) == [space.favoritesContainerID, space.pinnedContainerID, space.todayContainerID])+ #expect(containers.map(\.container) == [.favorites(spaceID: space.id), .pinned(spaceID: space.id), .today(spaceID: space.id)])+ }++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/220"))+ func noSpaceListShowsABlankWindowsSpace() {+ let a = BlankWindow.space(window: UUID(), at: date, id: UUID()).space+ var b = a; b.id = UUID(); b.standaloneWindowID = nil+ var c = a; c.id = UUID(); c.standaloneWindowID = nil+ // Saved with the blank space in the order (an older Cra appended it): it comes out again.+ #expect(BlankWindow.spaceOrder(saved: [c.id, a.id, b.id], spaces: [a, b, c]) == [c.id, b.id])+ // A space the order missed is appended; one the order names that is gone is dropped.+ #expect(BlankWindow.spaceOrder(saved: [b.id, UUID()], spaces: [a, b, c]) == [b.id, c.id])+ }++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/220"))+ func aBlankSpaceWithoutItsWindowGoes() {+ let w1 = UUID(), w2 = UUID()+ let kept = BlankWindow.space(window: w1, at: date).space+ let lost = BlankWindow.space(window: w2, at: date).space+ let shown = BlankWindow.space(window: w2, at: date).space // another space claims w2's window+ var normal = kept; normal.id = UUID(); normal.standaloneWindowID = nil+ let windows = [WindowSession(id: w1, focusedSpaceID: kept.id), WindowSession(id: w2, focusedSpaceID: shown.id),+ WindowSession(focusedSpaceID: normal.id)]+ #expect(BlankWindow.orphans(spaces: [kept, lost, shown, normal], windows: windows) == [lost.id])+ #expect(BlankWindow.orphans(spaces: [kept, normal], windows: []) == [kept.id])+ }++ /// sidebar.json with a Blank Window's space: it loads and saves with its window id, outside+ /// spaceOrder (CLAUDE.md rule 4).+ @Test(.bug("https://github.com/VictorKildahl/cra/issues/220"))+ func sidebarWithABlankWindowLoadsAsRecorded() throws {+ let (loaded, recorded) = try ModelFixtureTests.load("sidebar-blank-window.json", as: SidebarDocument.self)+ #expect(loaded == recorded)+ #expect(try ModelFixtureTests.roundTrips(loaded))+ #expect(loaded.spaces.map(\.standaloneWindowID) == [nil, UUID(uuidString: "D0000000-0000-0000-0000-000000000002")])+ #expect(BlankWindow.spaceOrder(saved: loaded.spaceOrder, spaces: loaded.spaces) == [loaded.spaces[0].id])+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/input/sidebar-blank-window.json b/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/input/sidebar-blank-window.jsonnew file mode 100644index 0000000..6244e8c--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/input/sidebar-blank-window.json@@ -0,0 +1,39 @@+{+ "version": 1,+ "spaceOrder": ["A0000000-0000-0000-0000-000000000001"],+ "spaces": [+ {+ "id": "A0000000-0000-0000-0000-000000000001", "title": "Personal", "emoji": "🌱",+ "theme": {"colors": ["#1C242B", "#3A3660"], "intensity": 0.85, "noise": 0.18, "appearance": "dark"},+ "favoritesContainerID": "C0000000-0000-0000-0000-000000000001",+ "pinnedContainerID": "C0000000-0000-0000-0000-000000000002",+ "todayContainerID": "C0000000-0000-0000-0000-000000000003",+ "createdAt": "2026-11-06T08:00:00Z"+ },+ {+ "id": "B0000000-0000-0000-0000-000000000001", "title": "This Window", "emoji": "",+ "theme": {"colors": ["#313146", "#534B5D"], "intensity": 0.9, "noise": 0.08, "appearance": "dark"},+ "favoritesContainerID": "C0000000-0000-0000-0000-000000000011",+ "pinnedContainerID": "C0000000-0000-0000-0000-000000000012",+ "todayContainerID": "C0000000-0000-0000-0000-000000000013",+ "createdAt": "2026-11-06T09:00:00Z",+ "standaloneWindowID": "D0000000-0000-0000-0000-000000000002"+ }+ ],+ "items": [+ {"id": "C0000000-0000-0000-0000-000000000001", "children": [], "isUnread": false, "createdAt": "2026-11-06T08:00:00Z",+ "data": {"container": {"_0": {"favorites": {"spaceID": "A0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "C0000000-0000-0000-0000-000000000002", "children": [], "isUnread": false, "createdAt": "2026-11-06T08:00:00Z",+ "data": {"container": {"_0": {"pinned": {"spaceID": "A0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "C0000000-0000-0000-0000-000000000003", "children": [], "isUnread": false, "createdAt": "2026-11-06T08:00:00Z",+ "data": {"container": {"_0": {"today": {"spaceID": "A0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "C0000000-0000-0000-0000-000000000011", "children": [], "isUnread": false, "createdAt": "2026-11-06T09:00:00Z",+ "data": {"container": {"_0": {"favorites": {"spaceID": "B0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "C0000000-0000-0000-0000-000000000012", "children": [], "isUnread": false, "createdAt": "2026-11-06T09:00:00Z",+ "data": {"container": {"_0": {"pinned": {"spaceID": "B0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "C0000000-0000-0000-0000-000000000013", "children": ["E0000000-0000-0000-0000-000000000001"], "isUnread": false, "createdAt": "2026-11-06T09:00:00Z",+ "data": {"container": {"_0": {"today": {"spaceID": "B0000000-0000-0000-0000-000000000001"}}}}},+ {"id": "E0000000-0000-0000-0000-000000000001", "parentID": "C0000000-0000-0000-0000-000000000013", "children": [], "isUnread": false,+ "createdAt": "2026-11-06T09:00:00Z", "data": {"tab": {"_0": {"url": "https://example.com/", "savedTitle": "Example Domain"}}}}+ ]+}diff --git a/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/recorded/sidebar-blank-window.json b/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/recorded/sidebar-blank-window.jsonnew file mode 100644index 0000000..12aabab--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/Fixtures/Model/recorded/sidebar-blank-window.json@@ -0,0 +1,173 @@+{+ "items" : [+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T08:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "favorites" : {+ "spaceID" : "A0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000001",+ "isUnread" : false+ },+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T08:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "pinned" : {+ "spaceID" : "A0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000002",+ "isUnread" : false+ },+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T08:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "today" : {+ "spaceID" : "A0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000003",+ "isUnread" : false+ },+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T09:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "favorites" : {+ "spaceID" : "B0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000011",+ "isUnread" : false+ },+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T09:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "pinned" : {+ "spaceID" : "B0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000012",+ "isUnread" : false+ },+ {+ "children" : [+ "E0000000-0000-0000-0000-000000000001"+ ],+ "createdAt" : "2026-11-06T09:00:00Z",+ "data" : {+ "container" : {+ "_0" : {+ "today" : {+ "spaceID" : "B0000000-0000-0000-0000-000000000001"+ }+ }+ }+ },+ "id" : "C0000000-0000-0000-0000-000000000013",+ "isUnread" : false+ },+ {+ "children" : [++ ],+ "createdAt" : "2026-11-06T09:00:00Z",+ "data" : {+ "tab" : {+ "_0" : {+ "faviconKey" : "example.com",+ "muted" : false,+ "savedTitle" : "Example Domain",+ "savedURL" : "https:\/\/example.com\/",+ "url" : "https:\/\/example.com\/"+ }+ }+ },+ "id" : "E0000000-0000-0000-0000-000000000001",+ "isUnread" : false,+ "parentID" : "C0000000-0000-0000-0000-000000000013"+ }+ ],+ "spaceOrder" : [+ "A0000000-0000-0000-0000-000000000001"+ ],+ "spaces" : [+ {+ "createdAt" : "2026-11-06T08:00:00Z",+ "emoji" : "🌱",+ "favoritesContainerID" : "C0000000-0000-0000-0000-000000000001",+ "id" : "A0000000-0000-0000-0000-000000000001",+ "pinnedContainerID" : "C0000000-0000-0000-0000-000000000002",+ "theme" : {+ "appearance" : "dark",+ "colors" : [+ "#1C242B",+ "#3A3660"+ ],+ "intensity" : 0.85,+ "noise" : 0.18,+ "solid" : false,+ "vibrant" : false+ },+ "title" : "Personal",+ "todayContainerID" : "C0000000-0000-0000-0000-000000000003"+ },+ {+ "createdAt" : "2026-11-06T09:00:00Z",+ "emoji" : "",+ "favoritesContainerID" : "C0000000-0000-0000-0000-000000000011",+ "id" : "B0000000-0000-0000-0000-000000000001",+ "pinnedContainerID" : "C0000000-0000-0000-0000-000000000012",+ "standaloneWindowID" : "D0000000-0000-0000-0000-000000000002",+ "theme" : {+ "appearance" : "dark",+ "colors" : [+ "#313146",+ "#534B5D"+ ],+ "intensity" : 0.9,+ "noise" : 0.08,+ "solid" : false,+ "vibrant" : false+ },+ "title" : "This Window",+ "todayContainerID" : "C0000000-0000-0000-0000-000000000013"+ }+ ],+ "version" : 1+}\ No newline at end of filediff --git a/Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift b/Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swiftnew file mode 100644index 0000000..cb3a7f5--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift@@ -0,0 +1,43 @@+import CoreGraphics+import CraCore+import Testing++/// A tab dragged out of every window opens in a Blank Window where it was dropped (Arc 1.172, #219).+struct TabTearOffTests {+ // Victor's built-in display: 1728 × 1117, the menu bar takes the top 33 pt.+ let visible = CGRect(x: 0, y: 0, width: 1728, height: 1084)++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/219"))+ func onlyATabLetGoOutsideEveryWindowTearsOff() {+ #expect(TabTearOff.tearsOff(isTab: true, incognito: false, dropAccepted: false, overAppWindow: false))+ // Dropped on a sidebar, or let go over a Cra window (its page, its toolbar): no new window.+ #expect(!TabTearOff.tearsOff(isTab: true, incognito: false, dropAccepted: true, overAppWindow: false))+ #expect(!TabTearOff.tearsOff(isTab: true, incognito: false, dropAccepted: false, overAppWindow: true))+ // Folders and splits stay; incognito pages can't load in a Blank Window.+ #expect(!TabTearOff.tearsOff(isTab: false, incognito: false, dropAccepted: false, overAppWindow: false))+ #expect(!TabTearOff.tearsOff(isTab: true, incognito: true, dropAccepted: false, overAppWindow: false))+ }++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/219"))+ func nearTheTopLeftTheWindowStopsTwentyPointsInside() {+ // Arc: a 1000 × 760 window's tab let go at (350, 300) from the top left opened at+ // (20, 53) from the top left: 20 pt inside the visible frame on both sides.+ let f = TabTearOff.frame(size: CGSize(width: 1000, height: 760), droppedAt: CGPoint(x: 350, y: 1117 - 300), visible: visible)+ #expect(f == CGRect(x: 20, y: 1117 - 53 - 760, width: 1000, height: 760))+ }++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/219"))+ func inTheOpenTheWindowCentresOnThePointer() {+ let f = TabTearOff.frame(size: CGSize(width: 700, height: 500), droppedAt: CGPoint(x: 900, y: 500), visible: visible)+ #expect(f == CGRect(x: 550, y: 250, width: 700, height: 500))+ // Bottom right: held inside too.+ let g = TabTearOff.frame(size: CGSize(width: 700, height: 500), droppedAt: CGPoint(x: 1720, y: 5), visible: visible)+ #expect(g == CGRect(x: 1728 - 20 - 700, y: 20, width: 700, height: 500))+ }++ @Test(.bug("https://github.com/VictorKildahl/cra/issues/219"))+ func aWindowLargerThanTheScreenShrinksToFit() {+ let f = TabTearOff.frame(size: CGSize(width: 2560, height: 1440), droppedAt: CGPoint(x: 900, y: 500), visible: visible)+ #expect(f == CGRect(x: 20, y: 20, width: 1688, height: 1044))+ }+}diff --git a/Sources/Cra/App/AppDelegate.swift b/Sources/Cra/App/AppDelegate.swiftindex 65cb06d..1837353 100644--- a/Sources/Cra/App/AppDelegate.swift+++ b/Sources/Cra/App/AppDelegate.swift@@ -31,7 +31,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {/// these reserved). Everything else goes to the page first. Copy URL is reserved like Arc:/// Google Docs takes ⇧⌘C for its word count (GitHub #194).static let reservedActions: Set<String> = Set([- "newTab", "newWindow", "newIncognitoWindow", "closeTab", "closeWindow", "reopenClosedTab", "editURL", "toggleSidebar", "toggleToolbar",+ "newTab", "newWindow", "newBlankWindow", "newIncognitoWindow", "closeTab", "closeWindow", "reopenClosedTab", "editURL", "toggleSidebar", "toggleToolbar","nextTab", "previousTab", "recentTab", "recentTabBackward", "nextSpace", "previousSpace", "devTools", "jsConsole", "inspectElement","viewArchive", "openLibrary", "settings", "clearToday", "newLittleWindow", "promoteLittleWindow","addSplitView", "closeSplitPane", "copyURL", "copyURLMarkdown",@@ -415,11 +415,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {}/// The window links from other apps, the Library and Little Windows go to: the- /// normal window in use last, never an incognito one.+ /// normal window in use last, never an incognito or Blank Window.@discardableResultfunc useNormalWindow() -> MainWindowController {- if main.isIncognito, let normal = mainWindows.first(where: { $0.windowID == store.lastNormalWindowID })- ?? mainWindows.first(where: { !$0.isIncognito }) {+ if main.isStandalone, let normal = mainWindows.first(where: { $0.windowID == store.lastNormalWindowID })+ ?? mainWindows.first(where: { !$0.isStandalone }) {store.activeWindowID = normal.windowID}return main@@ -430,10 +430,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {@discardableResultfunc useNormalWindow(forSpace spaceID: UUID) -> MainWindowController {let last = useNormalWindow()- guard !last.isIncognito else { return last }+ guard !last.isStandalone else { return last }var seen = Set<UUID>()let normal = NSApp.orderedWindows.compactMap { w in mainWindows.first { $0.window === w } }- .filter { !$0.isIncognito && seen.insert($0.windowID).inserted }+ .filter { !$0.isStandalone && seen.insert($0.windowID).inserted }.map { (id: $0.windowID, space: store.focusedSpaceID(window: $0.windowID)) }store.activeWindowID = SpaceWindow.window(for: spaceID, windows: normal, lastUsed: last.windowID)return main@@ -441,10 +441,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {/// Arc's New Window (⌘N): another window on the space in use, cascaded from the/// current one, with the command bar up. With every window closed it brings the- /// hidden one back instead. New Incognito Window (⇧⌘N) always opens a new one.- /// With `url` (a page's Open Link in New Window) the window opens on that page instead.- func openNewWindow(incognito: Bool = false, url: String? = nil) {- if !incognito, let hidden = mainWindows.first(where: { !$0.isIncognito }),+ /// hidden one back instead. New Incognito Window (⇧⌘N) and Blank Window (⌃⌘N) always open+ /// a new one. With `url` (a page's Open Link in New Window) the window opens on that page instead.+ func openNewWindow(incognito: Bool = false, blank: Bool = false, url: String? = nil) {+ if !incognito, !blank, let hidden = mainWindows.first(where: { !$0.isStandalone }),!mainWindows.contains(where: { $0.window?.isVisible == true || $0.window?.isMiniaturized == true }) {hidden.showWindow(nil)NSApp.activate(ignoringOtherApps: true)@@ -460,13 +460,35 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {frame = NSStringFromRect(f)}let session = incognito ? store.addIncognitoWindow(frame: frame)+ : blank ? store.addBlankWindow(frame: frame): store.addWindow(spaceID: store.focusedSpaceID(window: store.lastNormalWindowID), frame: frame)+ let c = showNewWindow(session)+ if let url { store.createTab(url: url, select: true, window: c.windowID) } else { c.openCommandBar(.newTab) }+ }++ @discardableResult+ private func showNewWindow(_ session: WindowSession) -> MainWindowController {let c = MainWindowController(app: self, session: session)mainWindows.append(c)store.activeWindowID = c.windowIDc.showWindow(nil)NSApp.activate(ignoringOtherApps: true)- if let url { store.createTab(url: url, select: true, window: c.windowID) } else { c.openCommandBar(.newTab) }+ return c+ }++ /// A tab dragged out of every Cra window and let go (GitHub #219): as in Arc, it moves into+ /// a new Blank Window placed where it was dropped, with its page as it was (no reload).+ /// `screenPoint` is where the pointer let go; the window takes the size of the one it came from.+ func tearOffTab(_ id: UUID, at screenPoint: NSPoint, from source: MainWindowController) {+ guard store.item(id)?.isTab == true, !store.isIncognito(item: id) else { return }+ let size = source.window?.frame.size ?? NSSize(width: 1200, height: 800)+ let screen = NSScreen.screens.first { NSMouseInRect(screenPoint, $0.frame, false) } ?? source.window?.screen ?? NSScreen.main+ let frame = TabTearOff.frame(size: size, droppedAt: screenPoint, visible: screen?.visibleFrame ?? .zero)+ let session = store.addBlankWindow(frame: NSStringFromRect(frame))+ store.moveToBlankWindow(id, window: session.id)+ let c = showNewWindow(session)+ // Handed over now, not left for whichever window is in use next to claim it.+ if let rt = source.browsers.release(id) { c.takePage(rt) }}/// A page's context menu: Arc's Open Link in New Window, Little Arc (Little Window here)@@ -483,10 +505,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {}/// Closing one of several windows ends it; the last normal one stays around hidden,- /// so a Dock click brings the browser back as it was. Incognito windows always end,- /// and with the last of them the off-the-record profile goes too.+ /// so a Dock click brings the browser back as it was. Incognito and Blank Windows always end+ /// (a Blank Window's tabs with it, as in Arc), and with the last incognito window the+ /// off-the-record profile goes too.func mainWindowWillClose(_ c: MainWindowController) {- guard !isRelaunching, c.isIncognito || mainWindows.contains(where: { $0 !== c && !$0.isIncognito }) else { return }+ guard !isRelaunching, c.isStandalone || mainWindows.contains(where: { $0 !== c && !$0.isStandalone }) else { return }mainWindows.removeAll { $0 === c }c.tearDown()store.removeWindow(c.windowID)@@ -914,6 +937,44 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {}return}+ // browserWindows=<label>: each browser window's kind, space, tabs (URLs), open tab and frame (#219, #220).+ if let label = dict["browserWindows"] {+ for m in mainWindows {+ let space = m.focusedSpace+ let tabs = (store.tabs(under: space.pinnedContainerID) + store.tabs(under: space.todayContainerID)).compactMap { $0.tab?.url }+ let open = store.selectedTabID(window: m.windowID).flatMap { store.item($0)?.tab?.url } ?? "-"+ NSLog("Cra browser windows %@: kind=%@ space=%@ listed=%d tabs=[%@] open=%@ page=%d frame=%@", label,+ m.isBlank ? "blank" : m.isIncognito ? "incognito" : "normal", space.title,+ store.orderedSpaces.contains { $0.id == space.id } ? 1 : 0, tabs.joined(separator: " "), open,+ store.selectedTabID(window: m.windowID).flatMap { m.browsers.runtime(for: $0) } != nil ? 1 : 0,+ m.window.map { NSStringFromRect($0.frame) } ?? "-")+ // cra.log (which a relaunch keeps) gets no addresses or names: kinds and counts.+ CraLog.note("browser windows \(label): kind=\(m.isBlank ? "blank" : m.isIncognito ? "incognito" : "normal") "+ + "listed=\(store.orderedSpaces.contains { $0.id == space.id } ? 1 : 0) tabs=\(tabs.count) open=\(open == "-" ? 0 : 1)")+ }+ return+ }+ // dragEnd=<text>&at=x,y: the window's tab whose URL holds the text dragged and let go there+ // (from the screen's top left) with nothing taking it, as a drag out of the sidebar ends+ // (#219). Without at: a point of the screen no Cra window covers.+ if let text = dict["dragEnd"], let screen = main.window?.screen ?? NSScreen.main {+ let space = main.focusedSpace+ let tab = (store.tabs(under: space.pinnedContainerID) + store.tabs(under: space.todayContainerID))+ .first { $0.tab?.url.contains(text) == true }+ guard let tab else { CraLog.note("dragEnd: no tab with \(text)"); return }+ var point: NSPoint?+ if let g = dict["at"]?.split(separator: ",").compactMap({ Double($0) }), g.count == 2 {+ point = NSPoint(x: screen.frame.minX + g[0], y: screen.frame.maxY - g[1])+ } else {+ let v = screen.visibleFrame.insetBy(dx: 40, dy: 40)+ point = [NSPoint(x: v.maxX, y: v.minY), NSPoint(x: v.minX, y: v.minY), NSPoint(x: v.maxX, y: v.maxY), NSPoint(x: v.minX, y: v.maxY)]+ .first { !SpaceListView.isOverAppWindow($0) }+ }+ guard let point else { CraLog.note("dragEnd: no point outside Cra's windows"); return }+ CraLog.note("dragEnd: let go at \(NSStringFromPoint(point))")+ main.testDragEnded(tab.id, at: point)+ return+ }if dict["windows"] != nil {for w in NSApp.windows {let line = "Cra windows: \(w.windowController.map { String(describing: type(of: $0)) } ?? "-") '\(w.title)' frame=\(NSStringFromRect(w.frame)) parent=\(w.parent.map { NSStringFromRect($0.frame) } ?? "-") visible=\(w.isVisible) key=\(w.isKeyWindow) mask=\(w.styleMask.rawValue) class=\(NSStringFromClass(type(of: w))) children=\(w.childWindows?.count ?? 0) contentView=\(w.contentView.map { NSStringFromClass(type(of: $0)) } ?? "-")"@@ -970,7 +1031,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {case "toggleDeveloperMode":let on = store.selectedTab?.tab.map { store.settings.isDeveloperMode(url: $0.url) } ?? falseitem.title = on ? "Turn off Developer Mode for this Site" : "Turn on Developer Mode for this Site"- case "pinTab": item.title = store.selectedTabID.map { store.isPinned($0) ? "Unpin Tab" : "Pin Tab" } ?? "Pin/Unpin Tab"+ case "pinTab":+ item.title = store.selectedTabID.map { store.isPinned($0) ? "Unpin Tab" : "Pin Tab" } ?? "Pin/Unpin Tab"+ return !main.isBlank // a Blank Window has no pinned section (Arc)case "setDefaultBrowser":SystemIntegration.shared.refresh()return !SystemIntegration.shared.isDefaultBrowser@@ -981,7 +1044,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {case "closeSplitPane", "separateFromSplit", "flipSplitOrientation":return store.selectedTabID.flatMap { store.splitContaining($0) } != nilcase "addSplitView": return store.selectedTabID != nil- case "editSpace", "deleteSpace", "nextSpace", "previousSpace", "manageSpaces": return !main.isIncognito+ case "editSpace", "deleteSpace", "nextSpace", "previousSpace", "manageSpaces", "changeProfile": return !main.isStandalone+ // A Blank Window has no favorites or pinned section to put a tab in (Arc).+ case "favoriteTab", "newFolder", "newGitHubLiveFolder", "resetTab": return !main.isBlankcase "closeLittleWindows": return !littleWindows.isEmptycase let id? where id.hasPrefix("moveTabToSpace"):guard let n = Int(id.dropFirst(14)), n >= 1, n <= store.spaceOrder.count else { return false }@@ -1103,22 +1168,24 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {case "newTab": main.openCommandBar(.newTab)case "newWindow": openNewWindow()case "newIncognitoWindow": openNewWindow(incognito: true)+ case "newBlankWindow": openNewWindow(blank: true)case "editURL": main.openCommandBar(.editURL)case "newFolder":+ guard !main.isBlank else { break }let f = store.createFolder(named: "New Folder", in: store.focusedSpace.pinnedContainerID, index: 0)main.sidebarUI.renamingID = f.idcase "newGitHubLiveFolder":- guard !main.isIncognito else { break }+ guard !main.isStandalone else { break }let sid = store.focusedSpace.idlet isNew = store.liveFolder(.github, inSpace: sid) == nilguard let f = store.createLiveFolder(.github, inSpace: sid) else { break }store.setExpanded(f.id, true)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 "editSpace": if !main.isStandalone { main.showSpaceEditor(space: store.focusedSpace) }+ case "changeProfile": if !main.isStandalone { main.showChangeProfileDialog(forSpace: store.focusedSpace.id) }+ case "deleteSpace": if !main.isStandalone { confirmDeleteSpace(store.focusedSpace) }+ case "manageSpaces": if !main.isStandalone { main.showManageSpaces() }case "closeTab":// Arc: "Close current tab or window".if current != nil { main.closeCurrentTab() } else { main.window?.performClose(nil) }@@ -1172,9 +1239,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {case "viewDownloads": main.showLibrary(.downloads)case "goBack": main.currentBrowser?.goBack()case "goForward": main.currentBrowser?.goForward()- case "pinTab": if let c = current { store.togglePinned(c) }+ case "pinTab": if let c = current, !main.isBlank { store.togglePinned(c) }case "favoriteTab":- if let c = current { store.isFavorite(c) ? store.removeFromFavorites(c) : store.addToFavorites(c) }+ if let c = current, !main.isBlank { store.isFavorite(c) ? store.removeFromFavorites(c) : store.addToFavorites(c) }// A pane has no row of its own: its split's name is edited.case "renameTab": main.sidebarUI.renamingID = current.map { store.splitContaining($0)?.id ?? $0 }case "duplicateTab": if let c = current { store.duplicateTab(c) }@@ -1325,7 +1392,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {menubar.addItem(submenu: appMenu, title: "Cra")let file = NSMenu(title: "File")- for id in ["newTab", "newWindow", "newIncognitoWindow", "newLittleWindow", "reopenClosedTab", "editURL", "newFolder", "newSpace"] { file.addItem(item(id)) }+ for id in ["newTab", "newWindow", "newBlankWindow", "newIncognitoWindow", "newLittleWindow", "reopenClosedTab", "editURL", "newFolder", "newSpace"] { file.addItem(item(id)) }file.addItem(.separator())file.addItem(item("closeWindow")); file.addItem(item("closeTab"))file.addItem(.separator())diff --git a/Sources/Cra/App/KeyBindings.swift b/Sources/Cra/App/KeyBindings.swiftindex f0647af..341ef4e 100644--- a/Sources/Cra/App/KeyBindings.swift+++ b/Sources/Cra/App/KeyBindings.swift@@ -126,6 +126,9 @@ final class KeyBindingRegistry {// FileKeyAction(id: "newTab", name: "New Tab…", section: .file, shortcuts: [Shortcut("t", cmd)], triggers: ["new tab"]),KeyAction(id: "newWindow", name: "New Window", section: .file, shortcuts: [Shortcut("n", cmd)], inCommandBar: false),+ // Arc: File ▸ Blank Window ⌃⌘N, a window with a sidebar of its own (#220).+ KeyAction(id: "newBlankWindow", name: "Blank Window", section: .file, shortcuts: [Shortcut("n", [.command, .control])],+ triggers: ["blank window", "this window"]),KeyAction(id: "newIncognitoWindow", name: "New Incognito Window", section: .file, shortcuts: [Shortcut("n", cmdShift)],triggers: ["incognito", "private"]),// Arc: File ▸ New Little Arc Window ⌥⌘N.diff --git a/Sources/Cra/Services/BrowserManager.swift b/Sources/Cra/Services/BrowserManager.swiftindex 19e2153..07d4ba3 100644--- a/Sources/Cra/Services/BrowserManager.swift+++ b/Sources/Cra/Services/BrowserManager.swift@@ -155,12 +155,12 @@ final class BrowserManager: NSObject, @preconcurrency CraBrowserDelegate {/// Take over a live browser from elsewhere (a Little Window being promoted/// to a tab): it keeps its history, scroll position and page state.@discardableResult- func adopt(_ browser: CraBrowser, for tabID: UUID) -> TabRuntime {+ func adopt(_ browser: CraBrowser, for tabID: UUID, from origin: String = "a Little Window's") -> TabRuntime {if let host = browser.hostWindow, let parent = host.parent { parent.removeChildWindow(host) }browser.containerView.removeFromSuperview()browser.delegate = selflet rt = register(browser: browser, tabID: tabID)- log(tabID, "takes over a Little Window's page")+ log(tabID, "takes over \(origin) page")store.updateTab(tabID, url: browser.currentURL, title: browser.currentTitle)return rt}diff --git a/Sources/Cra/Services/SidebarStore.swift b/Sources/Cra/Services/SidebarStore.swiftindex ca8893e..77d362c 100644--- a/Sources/Cra/Services/SidebarStore.swift+++ b/Sources/Cra/Services/SidebarStore.swift@@ -38,13 +38,15 @@ final class SidebarStore {/// The browser window that menu commands, new tabs and the command bar act on:/// the one the user is in (AppDelegate follows the key window).@ObservationIgnored var activeWindowID = UUID() {- didSet { if !window(activeWindowID).isIncognito { lastNormalWindowID = activeWindowID } }+ didSet { if !isStandalone(window: activeWindowID) { lastNormalWindowID = activeWindowID } }}/// The normal window in use last: where links from other apps and the Library go- /// while an incognito window is in front.+ /// while an incognito or Blank Window is in front.@ObservationIgnored private(set) var lastNormalWindowID = UUID()/// Spaces of incognito windows. Not in `spaceOrder`, never saved.private(set) var incognitoSpaceIDs: Set<UUID> = []+ /// Spaces of Blank Windows (BlankWindow, #220): saved with the window, in no space list.+ private(set) var blankSpaceIDs: Set<UUID> = []/// Per window, the tab shown before the selected one: a close goes back to it (CloseSuccessor)./// Not saved: after a relaunch it has no page, so Arc wouldn't go back to it either.@ObservationIgnored private var previousTab: [UUID: UUID] = [:]@@ -71,11 +73,13 @@ final class SidebarStore {init(clock: Scheduler? = nil) {self.clock = clock ?? LiveScheduler.sharedlet doc = sidebarFile.load(or: SidebarDocument.fresh)- for s in doc.spaces { spaces[s.id] = s }+ for s in doc.spaces {+ spaces[s.id] = s+ if s.standaloneWindowID != nil { blankSpaceIDs.insert(s.id) }+ }profiles = doc.profiles ?? []profileFavorites = doc.profileFavorites ?? []- spaceOrder = doc.spaceOrder.filter { spaces[$0] != nil }- for s in doc.spaces where !spaceOrder.contains(s.id) { spaceOrder.append(s.id) }+ spaceOrder = BlankWindow.spaceOrder(saved: doc.spaceOrder, spaces: doc.spaces)for it in doc.items { items[it.id] = it }archive = archiveFile.load(or: { [] })archiveChanged = false@@ -85,13 +89,18 @@ final class SidebarStore {settings = loadedfor h in historyFile.load(or: { [] }) { history[h.url] = h }ranking = rankingFile.load(or: { RankingData() })+ // A Blank Window's space without its window goes; repair drops what was in it.+ for sid in BlankWindow.orphans(spaces: Array(spaces.values), windows: prefs.windows) {+ spaces[sid] = nil+ blankSpaceIDs.remove(sid)+ }repair()if prefs.windows.isEmpty { prefs.windows = [WindowSession()] }for i in prefs.windows.indices where prefs.windows[i].focusedSpaceID.flatMap({ spaces[$0] }) == nil {prefs.windows[i].focusedSpaceID = spaceOrder.first}activeWindowID = prefs.windows[0].id- lastNormalWindowID = activeWindowID+ lastNormalWindowID = prefs.windows.first { !isStandalone(window: $0.id) }?.id ?? activeWindowIDsplitSharedFavorites(doc.favoritesContainerID)// Lists as the setting has them, also in a file an older Cra or a hand edit wrote.settings.sharedFavorites ? shareFavorites() : unshareFavorites()@@ -117,7 +126,8 @@ final class SidebarStore {if let p = space.profileID, !profiles.contains(where: { $0.id == p }) { space.profileID = nil }spaces[id] = space}- if spaces.isEmpty {+ // No space a window can list (none, or only Blank Windows' own).+ if spaceOrder.isEmpty {let doc = SidebarDocument.fresh()for s in doc.spaces { spaces[s.id] = s }spaceOrder = doc.spaceOrder@@ -262,30 +272,102 @@ final class SidebarStore {return out}- /// A new window on `spaceID` with nothing open yet.+ /// A new window on `spaceID` with nothing open yet (never on another window's own space).func addWindow(spaceID: UUID, frame: String?) -> WindowSession {- let w = WindowSession(focusedSpaceID: spaceID, frame: frame)+ let w = WindowSession(focusedSpaceID: isStandalone(space: spaceID) ? spaceOrder.first : spaceID, frame: frame)prefs.windows.append(w)return w}- /// The last window is never removed: closing it only hides it. An incognito- /// window's tabs go with it (not to the Library).+ /// The last window is never removed: closing it only hides it. An incognito or Blank+ /// Window's tabs go with it (not to the Library): Arc drops a Blank Window's sidebar.func removeWindow(_ id: UUID) {guard prefs.windows.count > 1, let gone = prefs.windows.first(where: { $0.id == id }) else { return }+ let own = isStandalone(window: id) ? gone.focusedSpaceID : nilprefs.windows.removeAll { $0.id == id }pinnedPeeks[id] = nil- if activeWindowID == id { activeWindowID = prefs.windows.first { !$0.isIncognito }?.id ?? prefs.windows[0].id }- if gone.isIncognito, let sid = gone.focusedSpaceID, let space = spaces[sid] {+ if activeWindowID == id { activeWindowID = prefs.windows.first { !isStandalone(window: $0.id) }?.id ?? prefs.windows[0].id }+ if let sid = own, let space = spaces[sid] {var ids = Set<UUID>()collectSubtree(of: space, into: &ids)for i in ids { items[i] = nil }spaces[sid] = nilincognitoSpaceIDs.remove(sid)- revision &+= 1+ blankSpaceIDs.remove(sid)+ touch()+ }+ }++ /// Arc's Blank Window (⌃⌘N, #220): a window in the normal profile with a sidebar of its+ /// own, "This Window", that none of the spaces' tabs show in. Saved and restored with it.+ func addBlankWindow(frame: String?) -> WindowSession {+ var w = WindowSession(frame: frame)+ let (space, containers) = BlankWindow.space(window: w.id, at: clock.now)+ for c in containers { items[c.id] = c }+ spaces[space.id] = space+ blankSpaceIDs.insert(space.id)+ w.focusedSpaceID = space.id+ prefs.windows.append(w)+ touch()+ return w+ }++ /// A torn-off tab (#219) moves into a Blank Window's tabs and opens there; the window it left+ /// loses it, as in Arc (no other tab opens in its place).+ func moveToBlankWindow(_ id: UUID, window: UUID) {+ let sid = focusedSpaceID(window: window)+ guard isBlank(space: sid), let space = spaces[sid], items[id]?.isTab == true else { return }+ moveItem(id, to: space.todayContainerID, index: 0)+ guard items[id]?.parentID == space.todayContainerID else { return }+ tookTab(id, into: window, open: true)+ }++ /// A tab that came into a window's list from another window (a tear-off, or a drop on its+ /// sidebar): windows that had it open in another space let it go, and it opens here if it+ /// was open there (Arc showed a dropped tab in the window it was dropped on) or `open` says+ /// so. Windows on the same space keep it open (#4).+ func tookTab(_ id: UUID, into window: UUID, open: Bool = false) {+ guard let sid = spaceID(ofItem: id), sid == focusedSpaceID(window: window) else { return }+ var wasOpen = open+ for w in prefs.windows where w.id != window {+ for (s, tab) in w.selectedTabPerSpace where tab == id && s != sid {+ wasOpen = wasOpen || w.focusedSpaceID == s+ updateWindow(w.id) { $0.selectedTabPerSpace[s] = nil }+ }}+ if wasOpen { selectTab(id, window: window) }}+ /// A Blank Window's "Move to…" (Arc's header button): its tabs go to the top of a space's+ /// Today and the window becomes a normal window on that space, its open tab still open.+ func moveBlankWindow(_ window: UUID, toSpace sid: UUID) {+ let own = focusedSpaceID(window: window)+ guard isBlank(space: own), let blank = spaces[own], let target = spaces[sid], !isStandalone(space: sid) else { return }+ let open = self.window(window).selectedTabPerSpace[own]+ moveItems(children(of: blank.todayContainerID).map(\.id), to: target.todayContainerID, index: 0)+ updateWindow(window) {+ $0.focusedSpaceID = sid+ $0.selectedTabPerSpace[own] = nil+ if let open, items[open] != nil { $0.selectedTabPerSpace[sid] = open }+ }+ var ids = Set<UUID>()+ collectSubtree(of: blank, into: &ids)+ for i in ids { items[i] = nil }+ spaces[own] = nil+ blankSpaceIDs.remove(own)+ touch()+ }++ func isBlank(space id: UUID?) -> Bool { id.map(blankSpaceIDs.contains) ?? false }+ /// A space only its own window shows: an incognito or Blank Window's.+ func isStandalone(space id: UUID?) -> Bool { isIncognito(space: id) || isBlank(space: id) }+ func isBlank(window id: UUID?) -> Bool {+ guard let w = prefs.windows.first(where: { $0.id == (id ?? activeWindowID) }), let sid = w.focusedSpaceID else { return false }+ return spaces[sid]?.standaloneWindowID == w.id+ }+ /// A window showing only a space of its own (incognito or Blank): no space list, no paging.+ func isStandalone(window id: UUID?) -> Bool { window(id).isIncognito || isBlank(window: id) }+/// Arc's New Incognito Window: a window with a space of its own whose tabs load/// in an off-the-record profile and are never written anywhere.func addIncognitoWindow(frame: String?) -> WindowSession {@@ -305,22 +387,22 @@ final class SidebarStore {func isIncognito(space id: UUID?) -> Bool { id.map(incognitoSpaceIDs.contains) ?? false }func isIncognito(item id: UUID) -> Bool { isIncognito(space: spaceID(ofItem: id)) }- /// The spaces a window pages between: an incognito window has only its own.+ /// The spaces a window pages between: an incognito or Blank Window has only its own.func pagedSpaces(window id: UUID?) -> [Space] {let w = window(id)- if w.isIncognito, let s = w.focusedSpaceID.flatMap({ spaces[$0] }) { return [s] }+ if isStandalone(window: w.id), let s = w.focusedSpaceID.flatMap({ spaces[$0] }) { return [s] }return orderedSpaces}- /// The tabs a window may show and the command bar may offer there: its own- /// incognito tabs, or every normal tab.+ /// The tabs a window may show and the command bar may offer there: an incognito or Blank+ /// Window's own tabs, or every tab of the spaces.func profileTabs(window id: UUID?) -> [SidebarItem] {let sid = focusedSpaceID(window: id)- if isIncognito(space: sid), let s = spaces[sid] {+ if isStandalone(space: sid), let s = spaces[sid] {return tabs(under: s.favoritesContainerID) + tabs(under: s.pinnedContainerID) + tabs(under: s.todayContainerID)}// Not the favorites of a profile no space uses (#154): nothing shows them.- return allTabs().filter { !isIncognito(item: $0.id) && spaceID(ofItem: $0.id) != nil }+ return allTabs().filter { spaceID(ofItem: $0.id).map { !isStandalone(space: $0) } ?? false }}private func collectSubtree(of space: Space, into ids: inout Set<UUID>) {@@ -334,9 +416,9 @@ final class SidebarStore {// MARK: Lookupvar orderedSpaces: [Space] { spaceOrder.compactMap { spaces[$0] } }- /// Arc's single-space mode: one space and the header turned off. Incognito windows keep theirs.+ /// Arc's single-space mode: one space and the header turned off. Incognito and Blank Windows keep theirs.func hidesSpaceHeader(_ id: UUID) -> Bool {- !settings.showSpaceHeaderOnSingleSpace && spaceOrder.count == 1 && !isIncognito(space: id)+ !settings.showSpaceHeaderOnSingleSpace && spaceOrder.count == 1 && !isStandalone(space: id)}func focusedSpaceID(window id: UUID?) -> UUID {window(id).focusedSpaceID.flatMap { spaces[$0] != nil ? $0 : nil } ?? spaceOrder.first!@@ -478,9 +560,9 @@ final class SidebarStore {func selectTab(_ id: UUID?, window: UUID? = nil) {var w = self.window(window).id- // A normal tab picked while an incognito window is in front (a link from another- // app, the Library) opens in the last normal window.- if window == nil, let id, self.window(w).isIncognito, !isIncognito(item: id) { w = lastNormalWindowID }+ // A space's tab picked while an incognito or Blank Window is in front (a link from+ // another app, the Library) opens in the last normal window.+ if window == nil, let id, isStandalone(window: w), spaceID(ofItem: id) != focusedSpaceID(window: w) { w = lastNormalWindowID }let focused = focusedSpaceID(window: w)guard let id, let it = items[id], it.isTab else {updateWindow(w) { $0.selectedTabPerSpace[focused] = nil }@@ -488,8 +570,8 @@ final class SidebarStore {return}let sid = spaceID(ofItem: id, window: w) ?? focused- // Incognito pages stay in their own window; normal tabs never open in one.- guard self.window(w).isIncognito ? sid == focused : !isIncognito(space: sid) else { return }+ // Incognito and Blank Windows show only their own tabs, and only there.+ guard isStandalone(window: w) ? sid == focused : !isStandalone(space: sid) else { return }updateWindow(w) {$0.focusedSpaceID = sid$0.selectedTabPerSpace[sid] = id@@ -669,7 +751,8 @@ final class SidebarStore {func touchAfterImport() { touch() }- /// What goes to disk: everything but incognito windows' spaces and tabs.+ /// What goes to disk: everything but incognito windows' spaces and tabs. Blank Windows'+ /// spaces go too, outside `spaceOrder`.var document: SidebarDocument {var hidden = Set<UUID>()for sid in incognitoSpaceIDs { if let s = spaces[sid] { collectSubtree(of: s, into: &hidden) } }@@ -679,7 +762,8 @@ final class SidebarStore {if let t = storedThemes[s.id] { s.theme = t }return s}- return SidebarDocument(version: 1, spaceOrder: spaceOrder, spaces: saved,+ let blank = blankSpaceIDs.compactMap { spaces[$0] }.sorted { $0.createdAt < $1.createdAt }+ return SidebarDocument(version: 1, spaceOrder: spaceOrder, spaces: saved + blank,items: hidden.isEmpty ? Array(items.values) : items.values.filter { !hidden.contains($0.id) },profiles: profiles, profileFavorites: profileFavorites.isEmpty ? nil : profileFavorites)}@@ -720,6 +804,10 @@ final class SidebarStore {guard var it = items[id], items[newParent] != nil, id != newParent, !isDescendant(newParent, of: id) else { return }// A page can't change profile: nothing moves into or out of an incognito window.guard isIncognito(item: id) == isIncognito(item: newParent) else { return }+ // A Blank Window holds tabs only: nothing goes into its (hidden) favorites or pinned section.+ if isBlank(space: spaceID(ofItem: newParent)) {+ guard case .today? = rootContainerKind(newParent) else { return }+ }// Only tabs live inside a split; dropping onto a split adds a pane.if items[newParent]?.isSplit == true {if it.isTab { addToSplit(newParent, tabID: id, at: index) }@@ -1023,7 +1111,7 @@ final class SidebarStore {// A pane brings its whole split: Arc's top apps hold a split as one tile (AppItem.childItems).let id = splitContaining(id)?.id ?? idguard let it = items[id], it.isTab || it.isSplit else { return }- guard let space = spaces[spaceID ?? self.spaceID(ofItem: id) ?? focusedSpaceID] else { return }+ guard let space = spaces[spaceID ?? self.spaceID(ofItem: id) ?? focusedSpaceID], !isBlank(space: space.id) else { return }// A new favorite takes the tile color when every existing one shares it.let colors = Set(favoriteTabs(in: space).map { $0.tab?.tileColor })moveItem(id, to: space.favoritesContainerID, index: index)@@ -1455,7 +1543,7 @@ final class SidebarStore {@discardableResultfunc createLiveFolder(_ source: LiveFolderSource, inSpace sid: UUID) -> SidebarItem? {if let existing = liveFolder(source, inSpace: sid) { return existing }- guard let space = spaces[sid], !isIncognito(space: sid) else { return nil }+ guard let space = spaces[sid], !isStandalone(space: sid) else { return nil }let folder = createFolder(named: "Pull Requests", in: space.pinnedContainerID, index: 0)items[folder.id]?.liveFolder = LiveFolderData()touch()@@ -1850,7 +1938,7 @@ final class SidebarStore {spaces[id] = spacespaceOrder.append(id)if settings.sharedFavorites { shareFavorites() }- if focus, !window().isIncognito { updateWindow(nil) { $0.focusedSpaceID = id } }+ if focus, !isStandalone(window: nil) { updateWindow(nil) { $0.focusedSpaceID = id } }touch()return spaces[id] ?? space}@@ -2036,7 +2124,7 @@ final class SidebarStore {/// (MainWindowController.refresh).func focusSpace(_ id: UUID, window: UUID? = nil) {let w = self.window(window).id- guard spaces[id] != nil, id != focusedSpaceID(window: w), !self.window(w).isIncognito, !isIncognito(space: id) else { return }+ guard spaces[id] != nil, id != focusedSpaceID(window: w), !isStandalone(window: w), !isStandalone(space: id) else { return }updateWindow(w) { $0.focusedSpaceID = id }revision &+= 1}diff --git a/Sources/Cra/UI/Sidebar/List/SidebarView.swift b/Sources/Cra/UI/Sidebar/List/SidebarView.swiftindex 848af98..7956244 100644--- a/Sources/Cra/UI/Sidebar/List/SidebarView.swift+++ b/Sources/Cra/UI/Sidebar/List/SidebarView.swift@@ -686,8 +686,9 @@ final class SpaceDockView: NSView {incognito = store.window(ui.windowID).isIncognitolet f = store.focusedSpaceID(window: ui.windowID)focused = f- // Arc's single-space mode drops the lone space icon along with the header.- spaces = incognito || store.hidesSpaceHeader(f) ? [] : store.orderedSpaces+ // Arc's single-space mode drops the lone space icon along with the header; incognito and+ // Blank Windows show no space icons (Arc 1.172 keeps the + in a Blank Window).+ spaces = store.isStandalone(window: ui.windowID) || store.hidesSpaceHeader(f) ? [] : store.orderedSpaces} onChange: { [weak self] inTask { @MainActor inguard let self, !self.syncQueued else { return }diff --git a/Sources/Cra/UI/Sidebar/List/SpaceColumnView.swift b/Sources/Cra/UI/Sidebar/List/SpaceColumnView.swiftindex ff2fb41..ea41def 100644--- a/Sources/Cra/UI/Sidebar/List/SpaceColumnView.swift+++ b/Sources/Cra/UI/Sidebar/List/SpaceColumnView.swift@@ -79,10 +79,13 @@ final class SpaceColumnView: NSView {let set = { (v: NSView, f: NSRect) in if v.frame != f { animated ? (v.animator().frame = f) : (v.frame = f) } }set(favorites, NSRect(x: 8 + favoritesShift, y: 0, width: w - 16, height: fh))let tiles = favorites.tilesBottom(forWidth: w - 16)- let base = tiles ?? -8+ // A Blank Window (Arc 1.172 captures, 6 Nov): its header sits 5 pt higher than a space's+ // with no favorites, and its tabs 1.5 pt closer under it.+ let blank = store.isBlank(space: spaceID)+ let base = tiles ?? (blank ? -13 : -8)set(header, NSRect(x: 8, y: base + 8, width: w - 16, height: header.isHidden ? 0 : 36))// The list's line sits 11.5 pt into it (3 pt inset, then halfway down the 18 pt divider).- let top = base + (!header.isHidden ? 43 : tiles == nil ? 4 : 7)+ let top = base + (!header.isHidden ? (blank ? 41.5 : 43) : tiles == nil ? 4 : 7)set(list, NSRect(x: 0, y: top, width: w, height: max(0, bounds.height - top)))}}@@ -95,6 +98,14 @@ final class SpaceColumnView: NSView {/// right-click open the same space menu at the pointer. Collapsed, the chevron points right. Arc keeps/// it in the icon's place while collapsed; Cra shows the icon at rest and the chevron only on hover/// (X DM, 4 Nov), except for a space without an icon, where the chevron is all that shows the state.+/// A Blank Window's header, Arc 1.172 2x captures (6 Nov): the name's glyphs 16.5 pt from the+/// window's edge, "Move to…" (grey, 11 pt medium, 49 pt wide) ending 25.5 pt from the sidebar's+/// edge. The offsets are fitted on Cra's own captures of the same points.+enum BlankHeader {+ static let titleX: CGFloat = 16.5 - 10 + 1.5+ static let moveToEnd: CGFloat = 25.5 - 10.5+}+final class SpaceHeaderView: NSView, NSTextFieldDelegate {private let spaceID: UUIDprivate let store: SidebarStore@@ -114,6 +125,12 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {/// Rename Space…: the name turns into a field and the ••• into Arc's "Done".private let done = NSTextField.sidebarLabel(size: 10, weight: .semibold)private var renameField: NSTextField?+ /// A Blank Window's header (Arc 1.172, #220): "This Window" with no icon or chevron, and+ /// "Move to…" at its end while the pointer is over the sidebar, which sends the window's tabs+ /// to a space.+ private var blank = false+ private let moveTo = NSTextField.sidebarLabel(size: 11, weight: .medium)+ private var columnHovering = false { didSet { if columnHovering != oldValue { refresh() } } }private var hovering = false { didSet { if hovering != oldValue { refresh() } } }/// Arc keeps the hover look while the space menu is open.private var menuOpen = false { didSet { if menuOpen != oldValue { refresh() } } }@@ -140,10 +157,27 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {done.stringValue = "Done"done.isHidden = truesymbol.imageScaling = .scaleNone- for v in [emoji, symbol, title, chevronBox, more, done] { addSubview(v) }+ moveTo.stringValue = "Move to…"+ moveTo.isHidden = true+ for v in [emoji, symbol, title, chevronBox, more, done, moveTo] { addSubview(v) }sync()}+ private var columnTracking: NSTrackingArea?+ private weak var trackedColumn: NSView?+ /// "Move to…" follows the pointer over the whole column, not just the header.+ override func viewDidMoveToSuperview() {+ super.viewDidMoveToSuperview()+ if let t = columnTracking { trackedColumn?.removeTrackingArea(t) }+ columnTracking = nil+ guard let column = superview else { return }+ trackedColumn = column+ let t = NSTrackingArea(rect: .zero, options: [.mouseEnteredAndExited, .activeAlways, .inVisibleRect], owner: self,+ userInfo: ["column": true])+ column.addTrackingArea(t)+ columnTracking = t+ }+required init?(coder: NSCoder) { fatalError() }override var isFlipped: Bool { true }@@ -158,6 +192,7 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {emoji.stringValue = space.emojisymbol.image = space.symbol.flatMap { SidebarSymbols.image($0, size: 13, weight: .medium) }title.stringValue = space.title+ blank = space.standaloneWindowID != nilcolors = SidebarColors(space.theme.palette)collapsed = store.isPinnedCollapsed(spaceID)hide = store.hidesSpaceHeader(spaceID)@@ -190,8 +225,16 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {symbol.alphaValue = showsChevron ? 0 : 1symbol.contentTintColor = colors.textSecondarymore.colors = colors- more.isHidden = !lit || renameField != nil+ more.isHidden = !lit || renameField != nil || blankdone.isHidden = renameField == nil+ moveTo.textColor = colors.textTertiary+ moveTo.isHidden = !blank || !(columnHovering || hovering || menuOpen)+ if blank {+ chevron.alphaValue = 0+ layer?.backgroundColor = .clear+ needsLayout = true+ return+ }// Arc's dark header fill is white 0.10, a little lighter than its rows' (1 Nov).let fill = colors.isDark ? NSColor.white.withAlphaComponent(0.1) : colors.hoverFilllayer?.backgroundColor = (lit ? fill : .clear).cgColor@@ -230,8 +273,12 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {let dw = ceil(done.attributedStringValue.size().width) + 2 * SidebarText.insetlet dh = done.intrinsicContentSize.heightdone.frame = NSRect(x: w - 5.5 - dw + SidebarText.inset, y: (h - dh) / 2, width: dw, height: dh)- let x: CGFloat = 36- let end = renameField != nil ? done.frame.minX - 6 : (more.isHidden ? w - 8.5 : w - 18.5 - 13 - 2)+ let mw = ceil(moveTo.attributedStringValue.size().width) + 2 * SidebarText.inset+ let mh = moveTo.intrinsicContentSize.height+ moveTo.frame = NSRect(x: w - BlankHeader.moveToEnd - mw + SidebarText.inset, y: (h - mh) / 2, width: mw, height: mh)+ let x: CGFloat = blank ? BlankHeader.titleX : 36+ let end = blank ? (moveTo.isHidden ? w - 8.5 : moveTo.frame.minX - 6)+ : renameField != nil ? done.frame.minX - 6 : (more.isHidden ? w - 8.5 : w - 18.5 - 13 - 2)let th = title.intrinsicContentSize.heightlet tw = min(ceil(title.attributedStringValue.size().width), max(0, end - x))title.frame = NSRect(x: x - SidebarText.inset, y: (h - th) / 2, width: tw + 2 * SidebarText.inset, height: th)@@ -247,12 +294,21 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {addTrackingArea(NSTrackingArea(rect: .zero, options: [.mouseEnteredAndExited, .activeAlways, .inVisibleRect], owner: self, userInfo: nil))}- override func mouseEntered(with event: NSEvent) { hovering = true }- override func mouseExited(with event: NSEvent) { hovering = false }+ override func mouseEntered(with event: NSEvent) {+ if event.trackingArea === columnTracking { columnHovering = true } else { hovering = true }+ }+ override func mouseExited(with event: NSEvent) {+ if event.trackingArea === columnTracking { columnHovering = false } else { hovering = false }+ }override func mouseDown(with event: NSEvent) {}override func mouseUp(with event: NSEvent) {let p = convert(event.locationInWindow, from: nil)guard bounds.contains(p) else { return }+ // A Blank Window has nothing pinned to collapse; its one button is "Move to…".+ if blank {+ if !moveTo.isHidden, moveTo.frame.insetBy(dx: -6, dy: -6).contains(p) { showMenu(event) }+ return+ }if renameField != nil {if done.frame.insetBy(dx: -6, dy: -6).contains(p) { commitRename() }return@@ -284,8 +340,23 @@ final class SpaceHeaderView: NSView, NSTextFieldDelegate {if let w = window { hovering = bounds.contains(convert(w.mouseLocationOutsideOfEventStream, from: nil)) }}+ /// "Move to…": the spaces, in the sidebar's order, each taking this window's tabs (#220).+ private func moveToMenu() -> NSMenu {+ let m = NSMenu()+ for space in store.orderedSpaces {+ let item = BlockMenuItem(title: space.emoji.isEmpty ? space.title : "\(space.emoji) \(space.title)") { [store, ui, spaceID] in+ guard store.isBlank(space: spaceID) else { return }+ store.moveBlankWindow(ui.windowID, toSpace: space.id)+ }+ if let sym = space.symbol { item.image = SidebarSymbols.image(sym, size: 13, weight: .medium) }+ m.addItem(item)+ }+ return m+ }+private func makeSpaceMenu() -> NSMenu? {- SpaceMenu.make(spaceID: spaceID, store: store, ui: ui, actions: actions, anchor: self) { [weak self] in self?.beginRename() }+ if blank { return moveToMenu() }+ return SpaceMenu.make(spaceID: spaceID, store: store, ui: ui, actions: actions, anchor: self) { [weak self] in self?.beginRename() }}// MARK: Rename (Arc: isEditingSpaceHeader, "Sidebar space header done button")@@ -476,7 +547,11 @@ final class FavoritesGridView: NSView {return true}strip.onTargetChange = { [weak self] _ in self?.onHeightChange(true) }- strip.accepts = { [weak self] id in self?.isFavorite(id) != true }+ // A Blank Window has no favorites (Arc, #220).+ strip.accepts = { [weak self] id in+ guard let self else { return false }+ return !self.isFavorite(id) && !self.store.isBlank(space: self.spaceID)+ }card.accepts = strip.acceptscard.onDrop = strip.onDropcard.onDismiss = { [weak self] in@@ -519,7 +594,7 @@ final class FavoritesGridView: NSView {}}favoritesID = space.favoritesContainerID- dismissed = store.isIncognito(space: spaceID) || store.isFavoritesEmptyStateDismissed(space.favoritesContainerID)+ dismissed = store.isStandalone(space: spaceID) || store.isFavoritesEmptyStateDismissed(space.favoritesContainerID)// A favorite split is one tile with a cell per pane (Arc: AppItem.childItems).for item in store.children(of: space.favoritesContainerID) where item.isTab || item.isSplit {let panes = item.isSplit ? store.children(of: item.id).filter(\.isTab) : [item]@@ -703,7 +778,7 @@ final class FavoritesGridView: NSView {let data = info.draggingPasteboard.data(forType: .craSidebarItem),let id = (try? JSONDecoder().decode(SidebarDragItem.self, from: data))?.id,let item = store.item(id), item.isTab || item.isSplit,- store.isIncognito(item: id) == store.isIncognito(space: spaceID) else { return nil }+ store.isIncognito(item: id) == store.isIncognito(space: spaceID), !store.isBlank(space: spaceID) else { return nil }let w = bounds.widthlet top = extensionGrid(forWidth: w).favoritesOffsetlet p = convert(info.draggingLocation, from: nil)diff --git a/Sources/Cra/UI/Sidebar/List/SpaceListView.swift b/Sources/Cra/UI/Sidebar/List/SpaceListView.swiftindex 8651bce..949016c 100644--- a/Sources/Cra/UI/Sidebar/List/SpaceListView.swift+++ b/Sources/Cra/UI/Sidebar/List/SpaceListView.swift@@ -326,8 +326,10 @@ final class SpaceListView: NSView, NSDraggingSource {}}- let pinnedKids = store.item(space.pinnedContainerID)?.children ?? []- let pinnedItems = store.listedPinnedItems(in: space, window: window)+ // A Blank Window's sidebar is its tabs only: no pinned section, no line (Arc, #220).+ let blank = store.isBlank(space: spaceID)+ let pinnedKids = blank ? [] : store.item(space.pinnedContainerID)?.children ?? []+ let pinnedItems = blank ? [] : store.listedPinnedItems(in: space, window: window)for item in pinnedItems {add(item, depth: 0, pinned: true, parent: space.pinnedContainerID, index: pinnedKids.firstIndex(of: item.id) ?? 0)}@@ -335,14 +337,14 @@ final class SpaceListView: NSView, NSDraggingSource {// With nothing pinned the list takes no room; a drag opens a real target. Not when// collapsed: the placeholder would claim an empty list and open under the pointer,// taking drops meant for the top of Today.- if pinnedKids.isEmpty && drop != nil {+ if pinnedKids.isEmpty && drop != nil && !blank {out.append(Row(key: .placeholder, content: .placeholder(active: section == .pinned)))}let pinnedCount = out.countlet todayKids = store.item(space.todayContainerID)?.children ?? []- let tidy: DividerTidy = store.tidyingSpaces.contains(spaceID) ? .running+ let tidy: DividerTidy = blank ? .none : store.tidyingSpaces.contains(spaceID) ? .running: TidyTabsService.shared.offers(spaceID, store: store) ? .offered : .none- out.append(Row(key: .divider, content: .divider(hasToday: !todayKids.isEmpty, tidy: tidy)))+ out.append(Row(key: .divider, content: .divider(hasToday: !todayKids.isEmpty && !blank, tidy: tidy)))let atTop = store.settings.newTabButtonAtTopif atTop && showsNewTab { out.append(Row(key: .newTab, content: .newTab(active: placeholder))) }for item in store.children(of: space.todayContainerID) {@@ -898,8 +900,30 @@ final class SpaceListView: NSView, NSDraggingSource {context == .withinApplication ? [.move, .copy, .generic, .private] : []}+ /// Outside every Cra window a tab doesn't slide back to its row: let go, it opens there (#219).+ func draggingSession(_ session: NSDraggingSession, movedTo screenPoint: NSPoint) {+ let back = Self.isOverAppWindow(screenPoint)+ if session.animatesToStartingPositionsOnCancelOrFail != back { session.animatesToStartingPositionsOnCancelOrFail = back }+ }++ /// Whether the window under a screen point, any app's, is one of Cra's.+ static func isOverAppWindow(_ point: NSPoint) -> Bool {+ let n = NSWindow.windowNumber(at: point, belowWindowWithWindowNumber: 0)+ return n > 0 && NSApp.window(withWindowNumber: n) != nil+ }+func draggingSession(_ session: NSDraggingSession, endedAt screenPoint: NSPoint, operation: NSDragOperation) {+ dragEnded(ui.draggingID, at: screenPoint, operation: operation)+ }++ /// A row's drag is over (`cra://debug?dragEnd` ends one the same way).+ func dragEnded(_ dragged: UUID?, at screenPoint: NSPoint, operation: NSDragOperation) {autoscroller.stop()+ // Let go outside every Cra window where nothing took it: Arc opens the tab in a Blank Window there.+ if let id = dragged, TabTearOff.tearsOff(isTab: store.item(id)?.isTab == true, incognito: store.isIncognito(item: id),+ dropAccepted: !operation.isEmpty, overAppWindow: Self.isOverAppWindow(screenPoint)) {+ actions.tearOffTab(id, screenPoint)+ }ui.draggingID = nil// The drag switched spaces; picks don't outlive leaving their space.if store.focusedSpaceID(window: ui.windowID) != spaceID { ui.clearPicks() }@@ -949,6 +973,12 @@ final class SpaceListView: NSView, NSDraggingSource {let drop = ui.listDrop ?? resolve(dragged: id, at: point)ui.listDrop = nilapplyDrop(drop)+ // From another window's space (a Blank Window's, or across windows and spaces): the tab+ // leaves the window that showed it and opens here; this window comes forward, so its page+ // moves in at once.+ let before = store.selectedTabID(window: ui.windowID)+ for t in ui.group(for: id, in: store) where store.item(t)?.isTab == true { store.tookTab(t, into: ui.windowID) }+ if store.selectedTabID(window: ui.windowID) != before { window?.makeKeyAndOrderFront(nil) }// A click whose pointer slipped 3 pt became a drag; let go on its own row it is still a// click, so the tab opens (GitHub #7: "a single click on a tab sometimes did nothing").if drop.target == nil, store.item(id)?.isTab == true, ui.multiSelection.count <= 1,@@ -1030,7 +1060,7 @@ final class SpaceListView: NSView, NSDraggingSource {}} else {// Between sections or past the last row: the divider splits pinned from today.- if p.y < (pinnedFrame.maxY + todayFrame.minY) / 2 {+ if p.y < (pinnedFrame.maxY + todayFrame.minY) / 2, !store.isBlank(space: spaceID) {target = .insert(parent: space.pinnedContainerID, index: p.y < pinnedFrame.minY ? 0 : store.children(of: space.pinnedContainerID).count)} else {// The New Tab row may lead Today, so its first tab, not the section, marks the top.diff --git a/Sources/Cra/UI/SidebarUIState.swift b/Sources/Cra/UI/SidebarUIState.swiftindex b0a2d7a..831d87c 100644--- a/Sources/Cra/UI/SidebarUIState.swift+++ b/Sources/Cra/UI/SidebarUIState.swift@@ -186,6 +186,9 @@ enum SplitDropTarget: Equatable {final class SidebarActions {var openCommandBar: (CommandBarMode) -> Void = { _ in }var closeTab: (UUID) -> Void = { _ in }+ /// A tab dragged out of every Cra window and let go there (screen point): Arc opens it in a+ /// Blank Window where it was dropped (GitHub #219).+ var tearOffTab: (UUID, NSPoint) -> Void = { _, _ in }var goBack: () -> Void = {}var goForward: () -> Void = {}var reload: () -> Void = {}diff --git a/Sources/Cra/UI/Windows/MainWindowController.swift b/Sources/Cra/UI/Windows/MainWindowController.swiftindex 4605f6b..38aec2a 100644--- a/Sources/Cra/UI/Windows/MainWindowController.swift+++ b/Sources/Cra/UI/Windows/MainWindowController.swift@@ -66,6 +66,10 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMlet windowID: UUID/// Pages load in the off-the-record profile; nothing is saved (WindowSession.isIncognito).let isIncognito: Bool+ /// Arc's Blank Window (#220): a sidebar of its own, "This Window", in the normal profile.+ var isBlank: Bool { store.isBlank(window: windowID) }+ /// Shows only a space of its own (incognito or Blank): no other spaces, no space switching.+ var isStandalone: Bool { isIncognito || isBlank }var focusedSpaceID: UUID { store.focusedSpaceID(window: windowID) }var focusedSpace: Space { store.focusedSpace(window: windowID) }var selectedTabID: UUID? { store.selectedTabID(window: windowID) }@@ -252,6 +256,10 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMsidebarActions.titleBarDoubleClick = { [weak self] in (self?.window as? CraWindow)?.performTitleDoubleClickAction() }sidebarActions.openCommandBar = { [weak self] mode in self?.openCommandBar(mode) }sidebarActions.closeTab = { [weak self] id in self?.closeTab(id) }+ sidebarActions.tearOffTab = { [weak self] id, point in+ guard let self else { return }+ self.app.tearOffTab(id, at: point, from: self)+ }sidebarActions.goBack = { [weak self] in self?.currentBrowser?.goBack() }sidebarActions.goForward = { [weak self] in self?.currentBrowser?.goForward() }sidebarActions.reload = { [weak self] in@@ -491,6 +499,17 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM/// The browser window the user is in (AppDelegate follows the key window).private var isActiveWindow: Bool { store.activeWindowID == windowID }+ /// `cra://debug?dragEnd`: a drag of a row of this window's list let go at a screen point+ /// with nothing taking it, as a drag out of the sidebar ends (#219).+ func testDragEnded(_ id: UUID, at screenPoint: NSPoint) {+ func list(in v: NSView) -> SpaceListView? {+ if let l = v as? SpaceListView, l.spaceID == focusedSpaceID { return l }+ return v.subviews.lazy.compactMap { list(in: $0) }.first+ }+ guard let l = window?.contentView.flatMap(list(in:)) else { CraLog.note("dragEnd: no list"); return }+ l.dragEnded(id, at: screenPoint, operation: [])+ }+/// The tab's page belongs to another window that has it open: the window in use takes it,/// others keep it where it is. Windows restored at launch (none has the page yet, and/// `app.mainWindows` is still empty) leave it to the window in use, else the first one.@@ -2065,7 +2084,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMself.swipeY += event.scrollingDeltaYguard max(abs(self.swipeX), abs(self.swipeY)) > 6 else { return event }// One space still swipes into the Library.- guard abs(self.swipeX) > abs(self.swipeY) * 1.2, !self.isIncognito,+ guard abs(self.swipeX) > abs(self.swipeY) * 1.2, !self.isStandalone,self.store.spaceOrder.count > 1 || !self.shell.floatingSidebar,// At the Spaces page's end a swipe back along the cards scrolls them.!(self.sidebarUI.libraryPage == .spaces && self.swipeX > 0) else {@@ -2271,7 +2290,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMprivate func wheelSwitchesSpace(_ event: NSEvent) -> Bool {let host = shell.sidebarHostguard shell.sidebarVisible || shell.floatingSidebar, event.window != nil, event.window === host.window,- host.bounds.contains(host.convert(event.locationInWindow, from: nil)), !isIncognito else { return false }+ host.bounds.contains(host.convert(event.locationInWindow, from: nil)), !isStandalone else { return false }let dx = event.scrollingDeltaX// On the Spaces page the cards scroll first; once they can't scroll that way the wheel pages,// which leaves the Library when it heads for the next space, and over the rail it leaves at@@ -2978,7 +2997,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMguard let window else { return }let panel = NSPanel(contentRect: NSRect(x: 0, y: 0, width: 651, height: 600), styleMask: [.titled], backing: .buffered, defer: false)// 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 initialProfile = space == nil && !isStandalone ? SpaceProfiles.forNewSpace(from: store.focusedSpace, profiles: store.profiles) : nillet store = self.storelet view = SpaceEditorView(existing: space, profiles: store.profiles, initialProfile: initialProfile, onSave: { [weak panel] title, icon, theme, profile, newName inlet id: UUID@@ -3091,7 +3110,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM/// A page handed over by a window that is closing.func takePage(_ rt: TabRuntime) {- browsers.adopt(rt.browser, for: rt.tabID)+ browsers.adopt(rt.browser, for: rt.tabID, from: "another window's")refresh()}diff --git a/Tests/Scenarios/blank-window.scenario b/Tests/Scenarios/blank-window.scenarionew file mode 100644index 0000000..bfbc2aa--- /dev/null+++ b/Tests/Scenarios/blank-window.scenario@@ -0,0 +1,36 @@+# promise: #219 #220+# A tab dragged out of every window and let go (#219) moves into a new Blank Window, as in Arc+# 1.172: that window lists only it, under "This Window", in no space list; the page moves with+# its state (no second load) and the window it left shows no tab. File ▸ Blank Window (⌃⌘N, #220)+# opens an empty one, and a relaunch brings both back with their tabs.+budget rss=700 stalls50=10+cra://debug?windowSize=1000x700+cra://open?url=${PAGE}?n=stays+expect-log loaded 127\.0\.0\.1 \(HTTP 200\)+cra://open?url=${PAGE}?n=torn+wait 3+cra://debug?cdp=Runtime.evaluate¶ms={"expression":"window.mark='kept-'+location.search.slice(3)"}+expect-log Cra cdp Runtime.evaluate .*"value":"kept-torn"+cra://debug?browserWindows=before+expect-log Cra browser windows before: kind=normal .*listed=1 .*open=\S*n=torn page=1+cra://debug?dragEnd=n=torn+expect-log dragEnd: let go at+wait 2+cra://debug?browserWindows=torn+expect-log Cra browser windows torn: kind=blank space=This Window listed=0 tabs=\[\S*n=torn\] open=\S*n=torn page=1+expect-log Cra browser windows torn: kind=normal .*listed=1 tabs=\[\S*n=stays\] open=- page=0+expect-log takes over another window's page+# The page in the new window is the same page: what it held is still there.+cra://debug?cdp=Runtime.evaluate¶ms={"expression":"String(window.mark)"}+expect-log Cra cdp Runtime.evaluate .*"value":"kept-torn"+cra://action/newBlankWindow+wait 2+cra://debug?browserWindows=new+expect-log Cra browser windows new: kind=blank space=This Window listed=0 tabs=\[\] open=- page=0+relaunch+wait 4+cra://debug?browserWindows=relaunched+# The relaunched Cra's lines reach cra.log only, which names no pages: kinds and counts.+expect-log browser windows relaunched: kind=blank listed=0 tabs=1 open=1+expect-log browser windows relaunched: kind=blank listed=0 tabs=0 open=0+expect-log browser windows relaunched: kind=normal listed=1 tabs=1 open=0diff --git a/Tests/StoreTests.swift b/Tests/StoreTests.swiftindex 22ca530..fead639 100644--- a/Tests/StoreTests.swift+++ b/Tests/StoreTests.swift@@ -48,6 +48,9 @@ enum StoreTests {dropOnPinnedTabSplits()reopenClosedTabs()windowsShareTheSidebar()+ blankWindows()+ blankWindowWithoutItsWindow()+ tornOffTabMovesToABlankWindow()print("Store: \(checks) checks passed")}@@ -1269,6 +1272,127 @@ enum StoreTests {expect(store.integrityProblems().isEmpty, "and the sidebar stays sound")}+ // promise: #220+ /// Arc's Blank Window (⌃⌘N): a sidebar of its own in the normal profile, in no space list,+ /// saved and restored with the window, and gone with its tabs when the window closes.+ @MainActor+ private static func blankWindows() {+ let store = AppComposition(clock: ManualScheduler()).store+ let home = store.createSpace(title: "Blank Home", emoji: "🏠").id+ let main = store.activeWindowID+ let spaceTab = store.createTab(url: "https://example.com/space-tab", in: home, window: main)+ let blank = store.addBlankWindow(frame: nil).id+ let own = store.focusedSpaceID(window: blank)+ expect(store.isBlank(window: blank) && store.isStandalone(window: blank) && !store.window(blank).isIncognito,+ "a Blank Window is neither a normal window nor incognito")+ expect(store.space(own)?.title == "This Window" && !store.orderedSpaces.contains { $0.id == own }+ && store.pagedSpaces(window: blank).map(\.id) == [own], "its sidebar, This Window, is in no space list")+ let tab = store.createTab(url: "https://example.com/blank-tab", window: blank)+ expect(store.spaceID(ofItem: tab.id) == own && !store.isIncognito(item: tab.id) && store.profilePath(item: tab.id) == nil,+ "a tab opened there is the window's own, in the Default profile")+ expect(store.profileTabs(window: blank).map(\.id) == [tab.id] && !store.profileTabs(window: main).contains { $0.id == tab.id },+ "its command bar offers only its tabs, and other windows' never offer them")+ store.selectTab(spaceTab.id, window: blank)+ store.focusSpace(home, window: blank)+ expect(store.selectedTabID(window: blank) == tab.id && store.focusedSpaceID(window: blank) == own,+ "a space's tab doesn't open in it, and it doesn't switch to a space")+ let blankSpace = store.space(own)!+ store.moveItem(tab.id, to: blankSpace.pinnedContainerID, index: 0)+ store.addToFavorites(tab.id)+ expect(store.item(tab.id)?.parentID == blankSpace.todayContainerID, "nothing goes into favorites or pinned there")+ store.activeWindowID = blank+ expect(store.lastNormalWindowID == main, "links from other apps keep going to the normal window")+ store.activeWindowID = main++ store.saveAll()+ let reloaded = AppComposition(clock: ManualScheduler()).store+ expect(reloaded.isBlank(window: blank) && reloaded.selectedTabID(window: blank) == tab.id+ && !reloaded.orderedSpaces.contains { $0.id == own }, "a relaunch brings it back with its tabs, still out of the space list")+ expect(reloaded.integrityProblems().isEmpty, "the reloaded sidebar is sound")++ let archived = store.archive.count+ store.removeWindow(blank)+ expect(store.item(tab.id) == nil && store.space(own) == nil && store.archive.count == archived,+ "closing it takes its tabs, as in Arc (nothing goes to the Archive)")+ expect(store.item(spaceTab.id) != nil && store.integrityProblems().isEmpty, "and leaves the spaces as they were")+ store.saveAll()+ }++ // promise: #220+ /// A Blank Window's space whose window is missing from windows.json goes at launch rather+ /// than turning into a space of the sidebar.+ @MainActor+ private static func blankWindowWithoutItsWindow() {+ let store = AppComposition(clock: ManualScheduler()).store+ let blank = store.addBlankWindow(frame: nil).id+ let own = store.focusedSpaceID(window: blank)+ let tab = store.createTab(url: "https://example.com/orphan-blank", window: blank)+ store.prefs.windows.removeAll { $0.id == blank }+ store.saveAll()+ let reloaded = AppComposition(clock: ManualScheduler()).store+ expect(reloaded.space(own) == nil && reloaded.item(tab.id) == nil && !reloaded.spaceOrder.contains(own),+ "an orphaned Blank Window space goes with its tabs")+ expect(reloaded.integrityProblems().isEmpty, "and the sidebar stays sound")+ }++ // promise: #219+ /// A tab dragged out of every window moves into a new Blank Window (Arc 1.172): it leaves its+ /// space, opens there, and the window it left shows no tab. "Move to…" sends it to a space.+ @MainActor+ private static func tornOffTabMovesToABlankWindow() {+ let store = AppComposition(clock: ManualScheduler()).store+ let home = store.createSpace(title: "Tear Home", emoji: "🏠").id+ let main = store.activeWindowID+ let stays = store.createTab(url: "https://example.com/stays", in: home, window: main)+ let torn = store.createTab(url: "https://example.com/torn", in: home, window: main)+ let pinned = store.createTab(url: "https://example.com/pinned", in: home, pinned: true, select: false, window: main)+ expect(store.selectedTabID(window: main) == torn.id, "the dragged tab is open")+ let blank = store.addBlankWindow(frame: nil).id+ let own = store.focusedSpaceID(window: blank)+ store.moveToBlankWindow(torn.id, window: blank)+ expect(store.spaceID(ofItem: torn.id) == own && store.selectedTabID(window: blank) == torn.id,+ "the tab moves into the new window and opens there")+ expect(!store.tabs(under: store.space(home)!.todayContainerID).contains { $0.id == torn.id }+ && store.selectedTabID(window: main) == nil, "it leaves its space, and its old window shows no tab")+ let second = store.addBlankWindow(frame: nil).id+ store.moveToBlankWindow(pinned.id, window: second)+ expect(store.spaceID(ofItem: pinned.id) == store.focusedSpaceID(window: second) && !store.isPinned(pinned.id),+ "a pinned tab tears off too, out of the pinned section")+ let folder = store.createFolder(named: "Stays put", in: store.space(home)!.pinnedContainerID, index: 0)+ store.moveToBlankWindow(folder.id, window: second)+ expect(store.spaceID(ofItem: folder.id) == home, "a folder doesn't")++ // Dropped on a Blank Window's sidebar from a window that has it open: it leaves that+ // window and opens in the Blank Window (Arc).+ store.selectTab(stays.id, window: main)+ store.moveItem(stays.id, to: store.space(store.focusedSpaceID(window: second))!.todayContainerID, index: 0)+ store.tookTab(stays.id, into: second)+ expect(store.selectedTabID(window: main) == nil && store.selectedTabID(window: second) == stays.id,+ "a tab dropped into a Blank Window from another window opens there and leaves the other window")++ // And back onto the normal window's list: it leaves the Blank Window and opens there.+ store.moveItem(stays.id, to: store.space(home)!.todayContainerID, index: 0)+ store.tookTab(stays.id, into: main)+ expect(store.selectedTabID(window: second) == nil && store.selectedTabID(window: main) == stays.id,+ "dragged back onto another window's sidebar, it moves into that window")+ // Two windows on one space both keep a tab open (#4): a drop within the space takes it from neither.+ let third = store.addWindow(spaceID: home, frame: nil).id+ store.selectTab(stays.id, window: third)+ store.tookTab(stays.id, into: third)+ expect(store.selectedTabID(window: main) == stays.id && store.selectedTabID(window: third) == stays.id,+ "a window on the same space keeps it open")+ store.removeWindow(third)++ store.moveBlankWindow(blank, toSpace: home)+ expect(!store.isBlank(window: blank) && store.focusedSpaceID(window: blank) == home && store.selectedTabID(window: blank) == torn.id+ && store.children(of: store.space(home)!.todayContainerID).first?.id == torn.id && store.space(own) == nil,+ "Move to… puts the window's tabs at the top of the space and the window on it")+ expect(store.item(stays.id) != nil && store.integrityProblems().isEmpty, "and the sidebar stays sound")+ store.removeWindow(second)+ store.removeWindow(blank)+ store.saveAll()+ }+private static func expect(_ condition: @autoclosure () -> Bool, _ message: String) {guard condition() else {FileHandle.standardError.write(Data("FAIL: \(message)\n".utf8))diff --git a/Tests/promises.lock b/Tests/promises.lockindex 103df8d..4b21cf6 100644--- a/Tests/promises.lock+++ b/Tests/promises.lock@@ -332,3 +332,16 @@#213 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::aClickOpensAClosedFolderEvenWithItsOpenTabInSight 70f9e64eb96b#215 Tests/StoreTests.swift::arcLiveFolderImportsLive a5c462b3a9c7#218 Tests/Scenarios/extension-popup-download.scenario ffb6285b0eee+#219 Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift::aWindowLargerThanTheScreenShrinksToFit bb6acd6907ac+#219 Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift::inTheOpenTheWindowCentresOnThePointer e47f49e23b09+#219 Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift::nearTheTopLeftTheWindowStopsTwentyPointsInside 8d9c09f68118+#219 Packages/CraCore/Tests/CraCoreTests/TabTearOffTests.swift::onlyATabLetGoOutsideEveryWindowTearsOff 9ce1b7ae29d3+#219 Tests/Scenarios/blank-window.scenario 03b91e82bef5+#219 Tests/StoreTests.swift::tornOffTabMovesToABlankWindow 099430668766+#220 Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift::aBlankSpaceWithoutItsWindowGoes 9471ebe5290e+#220 Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift::aBlankWindowsSpaceIsThisWindowAndBelongsToIt 308c89d42e0c+#220 Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift::noSpaceListShowsABlankWindowsSpace 2f45bf4e2cdd+#220 Packages/CraCore/Tests/CraCoreTests/BlankWindowTests.swift::sidebarWithABlankWindowLoadsAsRecorded 4076c30ec95c+#220 Tests/Scenarios/blank-window.scenario 03b91e82bef5+#220 Tests/StoreTests.swift::blankWindowWithoutItsWindow 0de383e3d544+#220 Tests/StoreTests.swift::blankWindows 2703cb42812adiff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.mdindex 5a2390e..f429897 100644--- a/docs/arc-reverse-engineering.md+++ b/docs/arc-reverse-engineering.md@@ -3315,3 +3315,30 @@ Read from the arm64 slice's Swift field metadata (`__swift5_fieldmd`, case and fputs Search first for a selection, turns Lens's "Search image with Google" into "Search Google for Image", addsOpen Link in Little Window and Capture Image… (ContentCapture.liftedLayout), and opens New Window / Incognito /Inspect in Cra's own windows and DevTools. Kept on purpose: Open Link in Background Tab under New Tab (#183).++## Blank Window and dragging a tab out (Arc 1.172, 6 Nov 2026, #219 #220, offline Arc on a fake home, AX + 2x window captures)++- [O static] Window styles in StorableWindows.json: `standard { sidebarContext: global | standalone }`, `little`, and the+ kinds `standard | global | incognito | littleArc | blank`. A Blank Window is `standard` with a `standalone` sidebar:+ StorableSidebar.json keeps `{standalone: <window id>}` beside `global`, holding one space of its own (Default+ profile, `customInfo` empty, no pinned container, no top apps). Strings: `newBlankWindow`, `onCreateNewBlankWindow`,+ "Creates a new blank window.", "Title for Explore tabs in a standalone-sidebar window."; AX id+ `standaloneBrowserWindow-<id>`.+- [O] File ▸ Blank Window ⌃⌘N (AX mods 4), between New Window and New Incognito Window. It opens cascaded from the+ window in use with the command bar up. Sidebar: "This Window" (13 pt semibold, glyphs 16.5 pt in, cap top 51.5 pt+ from the window's top with the toolbar on), then New Tab (text 20 pt in, top 90 pt): no favorites or empty card, no+ pinned section, no line, no space icons; the Library button and + stay. Colours (window captures, dark, inactive):+ sidebar #313246 → #363247, the empty page area #4F4B5D → #584A5D.+- [O] With the pointer over its sidebar the header shows "Move to…" (grey #7A7A86, glyphs 153.5–202.5 pt of a 228 pt+ sidebar) in place of the space's •••. [U] What its menu offers: not opened (the button is hover-only and AX+ presses didn't open it).+- [O] Closing a Blank Window drops its standalone container and its tabs: nothing went to StorableArchive.json.+- [O] A sidebar tab dragged out and let go over another app (real HID drags, slow steps; a fast cliclick drag reads as+ a click, a press on a non-key window drags the window): the tab leaves the global sidebar and opens alone in a new+ Blank Window the size of the window it came from; that window then showed no tab (the drag had selected it). Let go+ at (350, 300) from the top left with a 1000 × 760 window, the new one sat at (20, 53): 20 pt inside the visible frame+ on both sides. [U] Placement in the open (both later tries read as clicks); Cra centres on the pointer, which fits.+- [O] A tab dropped on a Blank Window's sidebar moved there out of the global sidebar.+- Cra: BlankWindow (Space.standaloneWindowID, saved in sidebar.json outside spaceOrder), SidebarStore.addBlankWindow /+ isStandalone, TabTearOff (decision + frame), SpaceListView.dragEnded, AppDelegate.tearOffTab. "Move to…" lists the+ spaces; picking one moves the window's tabs to the top of its Today and puts the window on it (Cra's choice, see [U]).diff --git a/docs/development.md b/docs/development.mdindex 4d0214e..bf193f3 100644--- a/docs/development.md+++ b/docs/development.md@@ -168,6 +168,12 @@ without Apple Intelligence would. `cra://debug?tidy=1` runs Tidy on the window'shovering the divider, `cra://debug?undoTidy=1` is ⌘Z's undo and `cra://debug?settingsPane=max`opens Settings on a pane.+`cra://debug?dragEnd=<text>` ends a drag of the window's tab whose URL holds the text, let go+with nothing taking it, the way a drag out of the sidebar ends: outside every Cra window it opens+in a new Blank Window (`&at=x,y` picks the point, from the screen's top left).+`cra://debug?browserWindows=<label>` logs each browser window's kind (normal, blank, incognito),+space, tabs, open tab and frame; cra.log gets the kinds and counts only.+`cra://debug?menuAt=315,24` opens the menu a click at that window point would open (thedeveloper-mode ⌄ here), and `&button=right` the context menu, a tab row's for instance.`&target=little` aims at the newest Little Window instead (its profile chip, for one).