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.
Pinned tabs and closing as in Arc: slash, back by the favicon, home name, close buttons, splits, Peek (#139) (#149)
Victor Kildahlc378b0c951bb
diff --git a/Packages/CraCore/Sources/CraCore/PinnedNavigation.swift b/Packages/CraCore/Sources/CraCore/PinnedNavigation.swiftnew file mode 100644index 0000000..8a9c7f2--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/PinnedNavigation.swift@@ -0,0 +1,18 @@+import Foundation++/// Arc 1.171 keeps a pinned tab on its site (PinnedTabNavigationProfile, recorded live, GitHub #139):+/// an address typed into it (⌘L) on another host opens as a new Today tab; the same host loads in place.+/// pin.lvh.me → away.lvh.me opened a new tab, so it compares hosts, not sites.+public enum PinnedNavigation {+ public static func typedURLOpensNewTab(_ typed: String, from current: String) -> Bool {+ guard let to = URL(string: typed)?.host?.lowercased() else { return false }+ return to != URL(string: current)?.host?.lowercased()+ }++ /// A link that opens Peek (Settings ▸ Tabs ▸ Links) leads to another host: pin.lvh.me →+ /// away.lvh.me peeked in Arc, though both are one site.+ public static func linkLeavesHost(_ link: String, from page: String) -> Bool {+ guard let to = URL(string: link)?.host?.lowercased(), !to.isEmpty else { return false }+ return to != URL(string: page)?.host?.lowercased()+ }+}diff --git a/Packages/CraCore/Sources/CraCore/SidebarClose.swift b/Packages/CraCore/Sources/CraCore/SidebarClose.swiftnew file mode 100644index 0000000..5d860a6--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/SidebarClose.swift@@ -0,0 +1,53 @@+import Foundation++/// The close button on a sidebar row and what ⌘W does, as in Arc 1.171+/// (TabCellState.closeButtonConfiguration; recorded live and in Arc's code, GitHub #139).+///+/// "Keep" is Arc's `deselect`: the tab unloads, goes back to its pinned page and stays in the+/// sidebar (a minus). "Archive" is `close`: the item leaves the sidebar for the archive (an ✕).+public enum SidebarClose {+ public enum Action: Equatable, Sendable {+ case keep+ case archive+ }++ public struct Button: Equatable, Sendable {+ public let action: Action+ /// The tooltip, with "(⌘W)" when the row is the open one (ArcTooltipLabel turns it into keycaps).+ public let help: String+ public var minus: Bool { action == .keep }++ public init(action: Action, help: String) {+ self.action = action+ self.help = help+ }+ }++ /// A tab's row. A Today tab archives. A pinned tab keeps its place while it is the open tab,+ /// while it is away from its pinned page, or while it shows under a closed folder; otherwise+ /// (in the background on its own page, loaded or not) it archives.+ public static func tab(pinned: Bool, current: Bool, navigatedAway: Bool, peeked: Bool) -> Button {+ let keep = pinned && (current || navigatedAway || peeked)+ return Button(action: keep ? .keep : .archive,+ help: (keep ? "Close and Keep Pinned" : "Archive this tab") + (current ? " (⌘W)" : ""))+ }++ /// Where a split row's buttons go: a pinned split, or a Today split in the background, has+ /// one at the row's end for the whole split; an open Today split has an ✕ on every pane+ /// (each archives its pane, the split falls apart into the other).+ public enum SplitButtons: Equatable, Sendable {+ case row(Button)+ case perPane(Button)+ }++ public static func split(pinned: Bool, current: Bool) -> SplitButtons {+ if !pinned && current { return .perPane(Button(action: .archive, help: "Archive this item")) }+ let keep = pinned && current+ return .row(Button(action: keep ? .keep : .archive,+ help: (keep ? "Close this item" : "Archive this item") + (current ? " (⌘W)" : "")))+ }++ /// ⌘W on the open tab, or on every picked tab when it is one of them: if any is a Today tab+ /// they are all archived, pinned ones and favorites too; otherwise they all keep their place.+ public static func commandW(anyToday: Bool) -> Action { anyToday ? .archive : .keep }+}diff --git a/Packages/CraCore/Sources/CraCore/SidebarModel.swift b/Packages/CraCore/Sources/CraCore/SidebarModel.swiftindex 08db282..e371d65 100644--- a/Packages/CraCore/Sources/CraCore/SidebarModel.swift+++ b/Packages/CraCore/Sources/CraCore/SidebarModel.swift@@ -77,9 +77,33 @@ public struct TabData: Codable, Equatable {/// The page's toolbar colour as last reported (TabRuntime.themeColor). A slept or restored/// tab's toolbar keeps it while the page loads again, as Arc's does.public var themeColor: String?+ /// A pinned tab's own page title (Arc: resetTabTitle), last reported while the tab was on it.+ /// Going back to the pinned page shows it again before the page loads (GitHub #139).+ public var homeTitle: String?public var iconKey: String? { customIconKey ?? faviconKey }+ /// A title the page reported. On a pinned tab's own page it is also the home's name.+ public mutating func noteTitle(_ title: String, pinned: Bool) {+ savedTitle = title+ if pinned, url == savedURL, !title.isEmpty { homeTitle = title }+ }++ /// The current page becomes the home (pinning it, Replace Pinned URL with Current).+ public mutating func makeCurrentPageHome() {+ savedURL = url+ homeTitle = savedTitle.isEmpty ? nil : savedTitle+ }++ /// Back to the pinned page (Arc: resetTab): its name and favicon come back with it, not the+ /// last page's. A home whose title was never seen keeps the last one until its page reports.+ public mutating func returnHome() {+ guard url != savedURL else { return }+ url = savedURL+ if let homeTitle { savedTitle = homeTitle }+ if let key = FaviconKey.key(for: savedURL) { faviconKey = key }+ }+public init(url: String, title: String = "") {self.url = urlself.savedURL = url@@ -87,16 +111,15 @@ public struct TabData: Codable, Equatable {self.faviconKey = URL(string: url)?.host}- /// The line under the tab's title in the sidebar. A live folder's pull request shows its- /// author. Arc 1.170 shows the host under every tab of a site in developer mode (GitHub #88),- /// and under a pinned tab only once it has left the pinned site (navigating within the same- /// host shows nothing).- public func sidebarSubtitle(navigatedAway: Bool, developerMode: Bool) -> String? {+ /// The line under the tab's title in the sidebar. Arc 1.171 (TabCellState.subtitle) has only+ /// two: the host and port of a site in developer mode (GitHub #88), else a live folder pull+ /// request's author. A pinned tab that left its page shows Arc's slash, never its host (#139).+ public func sidebarSubtitle(developerMode: Bool) -> String? {+ if developerMode, let u = URL(string: url), let host = u.host?.replacingOccurrences(of: "www.", with: "") {+ return u.port.map { "\(host):\($0)" } ?? host+ }if let liveSubtitle, URL(string: url)?.host == "github.com" { return liveSubtitle }- guard let host = URL(string: url)?.host?.replacingOccurrences(of: "www.", with: "") else { return nil }- if developerMode { return host }- guard navigatedAway, let saved = URL(string: savedURL)?.host, host != saved.replacingOccurrences(of: "www.", with: "") else { return nil }- return host+ return nil}}@@ -680,5 +703,6 @@ extension TabData {liveSubtitle = try c.decodeIfPresent(String.self, forKey: .liveSubtitle)liveGoneAt = try c.decodeIfPresent(Date.self, forKey: .liveGoneAt)themeColor = try c.decodeIfPresent(String.self, forKey: .themeColor)+ homeTitle = try c.decodeIfPresent(String.self, forKey: .homeTitle)}}diff --git a/Packages/CraCore/Tests/CraCoreTests/PinnedNavigationTests.swift b/Packages/CraCore/Tests/CraCoreTests/PinnedNavigationTests.swiftnew file mode 100644index 0000000..3a43ca5--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/PinnedNavigationTests.swift@@ -0,0 +1,18 @@+import CraCore+import Testing++struct PinnedNavigationTests {+ @Test func anotherHostOpensANewTab() {+ #expect(PinnedNavigation.typedURLOpensNewTab("http://away.lvh.me:47139/a.html", from: "http://pin.lvh.me:47139/c.html"))+ #expect(!PinnedNavigation.typedURLOpensNewTab("http://pin.lvh.me:47139/away1.html", from: "http://pin.lvh.me:47139/c.html"))+ #expect(!PinnedNavigation.typedURLOpensNewTab("https://GitHub.com/o/r", from: "https://github.com/"), "hosts compare without case")+ #expect(PinnedNavigation.typedURLOpensNewTab("https://www.google.com/search?q=x", from: "https://github.com/"), "a search leaves the site")+ #expect(!PinnedNavigation.typedURLOpensNewTab("not a url", from: "https://github.com/"))+ }++ @Test func peekFollowsTheHost() {+ #expect(PinnedNavigation.linkLeavesHost("http://away.lvh.me:47139/away2.html", from: "http://pin.lvh.me:47139/c.html"))+ #expect(!PinnedNavigation.linkLeavesHost("http://pin.lvh.me:47139/away1.html", from: "http://pin.lvh.me:47139/c.html"))+ #expect(!PinnedNavigation.linkLeavesHost("mailto:[email protected]", from: "https://github.com/"))+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/SidebarCloseTests.swift b/Packages/CraCore/Tests/CraCoreTests/SidebarCloseTests.swiftnew file mode 100644index 0000000..82f1cc4--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/SidebarCloseTests.swift@@ -0,0 +1,30 @@+import CraCore+import Testing++/// GitHub #139: Arc 1.171's close buttons, as recorded in an offline Arc.+struct SidebarCloseTests {+ @Test func tabRows() {+ let open = SidebarClose.tab(pinned: true, current: true, navigatedAway: false, peeked: false)+ #expect(open.minus && open.help == "Close and Keep Pinned (⌘W)")+ let away = SidebarClose.tab(pinned: true, current: false, navigatedAway: true, peeked: false)+ #expect(away.minus && away.help == "Close and Keep Pinned", "away from its page, in the background")+ let peeked = SidebarClose.tab(pinned: true, current: false, navigatedAway: false, peeked: true)+ #expect(peeked.minus, "shown under a closed folder")+ let resting = SidebarClose.tab(pinned: true, current: false, navigatedAway: false, peeked: false)+ #expect(!resting.minus && resting.help == "Archive this tab", "loaded or not, on its own page")+ #expect(SidebarClose.tab(pinned: false, current: true, navigatedAway: false, peeked: false).help == "Archive this tab (⌘W)")+ #expect(SidebarClose.tab(pinned: false, current: false, navigatedAway: true, peeked: true).help == "Archive this tab")+ }++ @Test func splitRows() {+ #expect(SidebarClose.split(pinned: true, current: true) == .row(.init(action: .keep, help: "Close this item (⌘W)")))+ #expect(SidebarClose.split(pinned: true, current: false) == .row(.init(action: .archive, help: "Archive this item")))+ #expect(SidebarClose.split(pinned: false, current: false) == .row(.init(action: .archive, help: "Archive this item")))+ #expect(SidebarClose.split(pinned: false, current: true) == .perPane(.init(action: .archive, help: "Archive this item")))+ }++ @Test func commandW() {+ #expect(SidebarClose.commandW(anyToday: true) == .archive)+ #expect(SidebarClose.commandW(anyToday: false) == .keep)+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/SidebarModelTests.swift b/Packages/CraCore/Tests/CraCoreTests/SidebarModelTests.swiftindex 2307320..5f607ff 100644--- a/Packages/CraCore/Tests/CraCoreTests/SidebarModelTests.swift+++ b/Packages/CraCore/Tests/CraCoreTests/SidebarModelTests.swift@@ -45,21 +45,55 @@ struct SidebarModelTests {#expect(tab.iconKey == "picked")}- /// The line under a tab's title (GitHub #88): a developer-mode site shows its host on every- /// tab, a pinned tab shows it once it has left its site, a pull request shows its author.+ /// The line under a tab's title (GitHub #88, #139): Arc's TabCellState.subtitle is a+ /// developer-mode site's host (and port), else a pull request's author. Leaving a pinned+ /// page shows none.@Test func sidebarSubtitle() {var tab = TabData(url: "https://www.youtube.com/watch?v=1", title: "Video")- #expect(tab.sidebarSubtitle(navigatedAway: false, developerMode: false) == nil)- #expect(tab.sidebarSubtitle(navigatedAway: false, developerMode: true) == "youtube.com", "developer mode: the host, without www.")- tab.savedURL = "https://youtube.com/"- #expect(tab.sidebarSubtitle(navigatedAway: true, developerMode: false) == nil, "still on the pinned site")+ #expect(tab.sidebarSubtitle(developerMode: false) == nil)+ #expect(tab.sidebarSubtitle(developerMode: true) == "youtube.com", "developer mode: the host, without www.")tab.savedURL = "https://example.com/"- #expect(tab.sidebarSubtitle(navigatedAway: true, developerMode: false) == "youtube.com", "left the pinned site")- #expect(tab.sidebarSubtitle(navigatedAway: false, developerMode: false) == nil)+ #expect(tab.sidebarSubtitle(developerMode: false) == nil, "a pinned tab that left its site shows no host")+ #expect(TabData(url: "http://127.0.0.1:8080/a").sidebarSubtitle(developerMode: true) == "127.0.0.1:8080", "with its port")var pull = TabData(url: "https://github.com/o/r/pull/1")pull.liveSubtitle = "octocat"- #expect(pull.sidebarSubtitle(navigatedAway: false, developerMode: true) == "octocat", "a pull request's author wins")- #expect(TabData(url: "notes").sidebarSubtitle(navigatedAway: false, developerMode: true) == nil, "no host, no line")+ #expect(pull.sidebarSubtitle(developerMode: false) == "octocat")+ #expect(pull.sidebarSubtitle(developerMode: true) == "github.com", "developer mode comes first in Arc")+ #expect(TabData(url: "notes").sidebarSubtitle(developerMode: true) == nil, "no host, no line")+ }++ /// GitHub #139: a pinned tab that goes back to its page shows that page's name and favicon,+ /// not the last page's, before it loads again.+ @Test func returningHomeShowsTheHomesNameAndIcon() throws {+ var tab = TabData(url: "https://github.com/", title: "")+ tab.noteTitle("GitHub", pinned: true)+ #expect(tab.homeTitle == "GitHub")+ tab.url = "https://gist.github.com/o/1"+ tab.faviconKey = "gist.github.com"+ tab.noteTitle("Developer bar: Console", pinned: true)+ #expect(tab.homeTitle == "GitHub", "a page away from home is not the home")+ tab.returnHome()+ #expect(tab.url == "https://github.com/" && tab.savedTitle == "GitHub" && tab.faviconKey == "github.com")++ var today = TabData(url: "https://example.com/", title: "")+ today.noteTitle("Example", pinned: false)+ #expect(today.homeTitle == nil, "only pinned tabs keep a home name")++ var unseen = TabData(url: "https://a.com/", title: "A")+ unseen.url = "https://a.com/b"+ unseen.savedTitle = "B"+ unseen.returnHome()+ #expect(unseen.savedTitle == "B", "a home never seen keeps the last name until its page reports")++ var pinning = TabData(url: "https://b.com/", title: "Bee")+ pinning.url = "https://c.com/"+ pinning.savedTitle = "Sea"+ pinning.makeCurrentPageHome()+ #expect(pinning.savedURL == "https://c.com/" && pinning.homeTitle == "Sea")++ let data = try JSONEncoder().encode(tab)+ #expect(try JSONDecoder().decode(TabData.self, from: data).homeTitle == "GitHub")+ #expect(try !String(decoding: JSONEncoder().encode(today), as: UTF8.self).contains("homeTitle"), "not written when unknown")}@Test func containerKindsRoundTripAndNeedAKind() throws {diff --git a/Sources/Cra/App/AppDelegate.swift b/Sources/Cra/App/AppDelegate.swiftindex 3088586..62bbe64 100644--- a/Sources/Cra/App/AppDelegate.swift+++ b/Sources/Cra/App/AppDelegate.swift@@ -458,15 +458,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {}/// Arc's Peek: a Little Window over `parent` that closes when a click lands past it.- func openPeek(url: String, over parent: MainWindowController) {+ func openPeek(url: String, over parent: MainWindowController, fromTab tabID: UUID? = nil) {for p in littleWindows where p.peekParent === parent { p.closeWindow() }let w = LittleWindowController(app: self, url: url, peekOver: parent)littleWindows.append(w)+ // Arc badges the tab the Peek came from with the peeked page's favicon (modalIcon).+ parent.sidebarUI.peekBadge = tabID.map { .init(tabID: $0, iconKey: FaviconKey.key(for: url)) }w.showAsPeek()}func removeLittleWindow(_ w: LittleWindowController) {littleWindows.removeAll { $0 === w }+ if let parent = w.peekParent, !littleWindows.contains(where: { $0.peekParent === parent }) { parent.sidebarUI.peekBadge = nil }}func closeLittleWindows() {diff --git a/Sources/Cra/Services/SidebarStore.swift b/Sources/Cra/Services/SidebarStore.swiftindex 9e80184..9de7ab9 100644--- a/Sources/Cra/Services/SidebarStore.swift+++ b/Sources/Cra/Services/SidebarStore.swift@@ -465,7 +465,7 @@ final class SidebarStore {if let key = FaviconKey.key(for: url) { t.faviconKey = key }}// A live folder's tab keeps the pull request's title (Arc shows that, not the page's).- if let title, !(t.liveItemURL.map { t.url.hasPrefix($0) } ?? false) { t.savedTitle = title }+ if let title, !(t.liveItemURL.map { t.url.hasPrefix($0) } ?? false) { t.noteTitle(title, pinned: isPinned(id)) }// Pages report titles and addresses over and over while they load, and every write to// `items` re-renders the sidebar's lists: only real changes are written.guard t != it.tab else { return }@@ -515,7 +515,7 @@ final class SidebarStore {/// Pinned tabs have a home URL. Reset returns there (Arc: resetTab).func resetPinnedTab(_ id: UUID) -> String? {guard var it = items[id], var t = it.tab, isPinned(id) else { return nil }- t.url = t.savedURL+ t.returnHome()it.data = .tab(t)items[id] = it// Closed, it no longer shows under a closed folder (Arc).@@ -528,7 +528,7 @@ final class SidebarStore {/// Make the current page the pinned home (Arc: replacePinnedTab).func setPinnedHomeToCurrent(_ id: UUID) {guard var it = items[id], var t = it.tab else { return }- t.savedURL = t.url+ t.makeCurrentPageHome()it.data = .tab(t)items[id] = ittouch()@@ -544,6 +544,7 @@ final class SidebarStore {t.savedTitle = ""t.faviconKey = FaviconKey.key(for: url)}+ if t.savedURL != url { t.homeTitle = nil }t.savedURL = urlit.data = .tab(t)items[id] = it@@ -668,7 +669,7 @@ final class SidebarStore {// Moving into a pinned section makes the current page the home.let kind = rootContainerKind(newParent)switch kind {- case .pinned, .favorites: t.savedURL = t.url+ case .pinned, .favorites: t.makeCurrentPageHome()default: break}it.data = .tab(t)@@ -678,7 +679,7 @@ final class SidebarStore {// A pinned split keeps each pane's page as that pane's home.for c in it.children {guard var pane = items[c], var t = pane.tab else { continue }- t.savedURL = t.url+ t.makeCurrentPageHome()pane.data = .tab(t)items[c] = pane}diff --git a/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift b/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swiftindex 113591d..f5f3b20 100644--- a/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift+++ b/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift@@ -544,12 +544,26 @@ final class FocusRingLayer: CALayer {private let yellow = CAShapeLayer()private let dashes = CAShapeLayer()private var radius = CraMetrics.rowCorner+ /// Arc's ring round the open tab of a site in developer mode (TabHighlightView,+ /// TabHighlightState.developerTab, GitHub #139): systemYellow under black dashes at 80 %, a+ /// radius of 11, and dashes cut to the edge's length (1/60, 1/80 or 1/100 of it by width).+ private(set) var developer = falseconvenience init(radius: CGFloat) {self.init()self.radius = radius}+ convenience init(developer: Bool) {+ self.init()+ guard developer else { return }+ self.developer = true+ radius = 11+ yellow.strokeColor = NSColor.systemYellow.cgColor+ dashes.strokeColor = NSColor.black.cgColor+ dashes.opacity = 0.8+ }+override init() {super.init()for l in [yellow, dashes] {@@ -567,11 +581,38 @@ final class FocusRingLayer: CALayer {override func layoutSublayers() {super.layoutSublayers()- let path = CGPath(roundedRect: bounds.insetBy(dx: 1, dy: 1), cornerWidth: radius - 1, cornerHeight: radius - 1, transform: nil)+ let rect = bounds.insetBy(dx: 1, dy: 1)+ let r = developer ? min(radius, rect.width / 2, rect.height / 2) : radius - 1+ let path = CGPath(roundedRect: rect, cornerWidth: r, cornerHeight: r, transform: nil)for l in [yellow, dashes] {l.frame = boundsl.path = path}+ if developer, rect.width > 0 {+ let edge = 2 * rect.width + 2 * rect.height - 8 * r + 2 * .pi * r+ let d = edge / (rect.width < 210 ? 60 : rect.width < 346 ? 80 : 100)+ dashes.lineDashPattern = [NSNumber(value: Double(d)), NSNumber(value: Double(d))]+ }+ }+}++/// Arc's SlashView: between a pinned tab's favicon and its name once the tab has left its+/// pinned page (GitHub #139). A 2 pt round-capped stroke corner to corner of a 4 × 15 pt box,+/// in TabCellSlash (black or white at 30 %).+final class SidebarSlashView: NSView {+ static let size = NSSize(width: 4, height: 15)+ var color: NSColor = .gray { didSet { if color != oldValue { needsDisplay = true } } }++ override func hitTest(_ point: NSPoint) -> NSView? { nil }++ override func draw(_ dirtyRect: NSRect) {+ let p = NSBezierPath()+ p.move(to: NSPoint(x: 1, y: 1))+ p.line(to: NSPoint(x: bounds.width - 1, y: bounds.height - 1))+ p.lineWidth = 2+ p.lineCapStyle = .round+ color.setStroke()+ p.stroke()}}@@ -607,7 +648,12 @@ class SidebarRowView: NSView {/// filled rows keep a 5 pt gap (GitHub #10: Cra filled all 40 pt and rows touched).private let fillLayer = CALayer()static let fillInset: CGFloat = 2- var fillRect: CGRect { bounds.insetBy(dx: 0, dy: Self.fillInset) }+ /// Arc starts a nested row's fill after its indent, so the gutter by a folder's tabs stays+ /// empty (GitHub #139). The fill, shadow, drop badge and focus ring all follow it.+ var fillLeading: CGFloat { 0 }+ var fillRect: CGRect {+ CGRect(x: fillLeading, y: Self.fillInset, width: max(0, bounds.width - fillLeading), height: max(0, bounds.height - 2 * Self.fillInset))+ }init(key: SpaceListView.RowKey, list: SpaceListView, colors: SidebarColors) {self.key = key@@ -652,6 +698,26 @@ class SidebarRowView: NSView {fillLayer.backgroundColor = fill.cgColor}+ /// Arc's bounce when a close button keeps the item (TabCellView, `deselect`): the row jumps to+ /// 90 % and springs back in ~0.24 s without overshoot (critically damped, recorded at 100 fps).+ func bounce() {+ guard let layer else { return }+ let a = layer.anchorPoint+ let c = CGPoint(x: bounds.width * (0.5 - a.x), y: bounds.height * (0.5 - a.y))+ var t = CATransform3DMakeTranslation(c.x, c.y, 0)+ t = CATransform3DScale(t, 0.9, 0.9, 1)+ t = CATransform3DTranslate(t, -c.x, -c.y, 0)+ let spring = CASpringAnimation(keyPath: "sublayerTransform")+ spring.fromValue = NSValue(caTransform3D: t)+ spring.toValue = NSValue(caTransform3D: CATransform3DIdentity)+ // Critically damped; tuned against a Cra recording to Arc's curve (half way at ~0.12 s).+ spring.mass = 1+ spring.stiffness = 119+ spring.damping = 21.8+ spring.duration = spring.settlingDuration+ layer.add(spring, forKey: "bounce")+ }+/// The open row's soft shadow under its fill, on light themes only.func setLifted(_ selected: Bool) {let lifted = selected && !colors.isDark && decor.combine == nil@@ -804,8 +870,16 @@ struct TabRowModel: Equatable {var muted: Boolvar unread: Boolvar navigatedAway: Bool- var closeGroup: Intvar focusRing: Bool+ /// The page's site is in developer mode: Arc rings the open tab (TabHighlightState.developerTab).+ var developerMode: Bool+ /// Shown under a closed folder (FolderPeek): its close button keeps it pinned.+ var peeked: Bool+ /// The pinned page's favicon (Arc: resetTabIcon), shown on the icon while it would go back there.+ var homeIcon: NSImage?+ var homeFlipIcon: Bool+ /// The favicon of a Peek opened from this tab (Arc: modalIcon), in the close button's place.+ var peekIcon: NSImage?}final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {@@ -816,12 +890,26 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {private var renameField: NSTextField?private var accessories: [NSView] = []private var focusRing: FocusRingLayer?+ private let slash = SidebarSlashView(frame: NSRect(origin: .zero, size: SidebarSlashView.size))+ /// The pointer is on the favicon of a pinned tab away from its page (Arc's icon region):+ /// a click there goes back, and the line under the name says so.+ private var overIcon = false+ /// ⌘ is down while `overIcon`: a click separates the page from the pinned tab instead.+ private var separating = false+ private var flagsMonitor: Any?+ /// Arc's regional hover background for a tab that can go back: the icon's square or the body.+ private let regionLayer = CALayer()override init(key: SpaceListView.RowKey, list: SpaceListView, colors: SidebarColors) {super.init(key: key, list: list, colors: colors)addSubview(favicon)+ addSubview(slash)addSubview(titleLabel)addSubview(subtitleLabel)+ regionLayer.cornerRadius = CraMetrics.rowCorner+ regionLayer.cornerCurve = .continuous+ regionLayer.actions = ["backgroundColor": NSNull(), "position": NSNull(), "bounds": NSNull(), "hidden": NSNull()]+ layer?.insertSublayer(regionLayer, at: 1)setAccessibilityElement(true)setAccessibilityRole(.button)}@@ -831,26 +919,29 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {func apply(_ m: TabRowModel) {guard m != model else { return }// A subtitle coming or going moves the title (developer mode on a live tab, GitHub #88).- if (m.subtitle == nil) != (model?.subtitle == nil) { needsLayout = true }+ if (m.subtitle == nil) != (model?.subtitle == nil) || m.depth != model?.depth || m.navigatedAway != model?.navigatedAway {+ needsLayout = true+ }model = m- if m.githubMark { favicon.showGitHubMark(colors: colors) } else { favicon.show(m.icon, flip: m.flipIcon, colors: colors) }+ if overIcon, !canReset { overIcon = false; stopWatchingFlags(); needsLayout = true }+ refreshIcon()+ slash.color = (colors.isDark ? NSColor.white : .black).withAlphaComponent(0.3)titleLabel.stringValue = m.titletitleLabel.textColor = colors.textPrimary- subtitleLabel.stringValue = m.subtitle ?? ""- subtitleLabel.textColor = colors.textTertiary- subtitleLabel.isHidden = m.subtitle == nil+ refreshSubtitle()setAccessibilityLabel(m.title)if m.editing != (renameField != nil) { m.editing ? beginRename(m.renameText) : endRename() }- if m.focusRing != (focusRing != nil) {- if m.focusRing {- let r = FocusRingLayer()- r.frame = bounds+ // The keyboard's ring wins over developer mode's; they differ in tone and dash length.+ let ring: Bool? = m.focusRing ? false : (m.developerMode && m.selected ? true : nil)+ if ring != focusRing.map(\.developer) {+ focusRing?.removeFromSuperlayer()+ focusRing = nil+ if let developer = ring {+ let r = FocusRingLayer(developer: developer)+ r.frame = fillRectr.zPosition = 10layer?.addSublayer(r)focusRing = r- } else {- focusRing?.removeFromSuperlayer()- focusRing = nil}}rebuildAccessories()@@ -863,22 +954,124 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {if let m = model { model = nil; apply(m) }}+ override var fillLeading: CGFloat { CGFloat(model?.depth ?? 0) * CraMetrics.indent }+override func baseFill() -> NSColor {guard let m = model else { return .clear }- return m.highlighted ? colors.selectedFill : (isHovered ? colors.hoverFill : .clear)+ if m.highlighted { return colors.selectedFill }+ // A tab that can go back fills only the hovered region (regionLayer), as Arc does.+ return isHovered && !canReset ? colors.hoverFill : .clear}override func refreshBackground() {super.refreshBackground()setLifted(model?.highlighted == true)+ refreshRegion()}override func hoverChanged() {super.hoverChanged()+ if !isHovered { setOverIcon(false) }+ refreshIcon()rebuildAccessories()}- /// Recording dot, mute or playing sound, unread dot, and on hover "back to pinned page" and close. Made once+ override func hoverMoved(to point: NSPoint) { setOverIcon(canReset && iconRegion.contains(point)) }++ private var canReset: Bool { model.map { $0.navigatedAway && !$0.editing } ?? false }+ /// Arc's icon region (TabCellView.BackgroundRegion.icon): the 36 pt square at the fill's left.+ private var iconRegion: NSRect {+ NSRect(x: fillLeading, y: 0, width: Self.iconRegionWidth, height: bounds.height)+ }+ private static let iconRegionWidth: CGFloat = 36+ /// The body region starts this far into the fill (it overlaps the icon's square by 6 pt).+ private static let bodyRegionInset: CGFloat = 30++ private func setOverIcon(_ on: Bool) {+ guard on != overIcon else { return }+ overIcon = on+ if on { watchFlags() } else { stopWatchingFlags() }+ refreshIcon()+ refreshSubtitle()+ rebuildAccessories()+ refreshBackground()+ needsLayout = true+ }++ private func watchFlags() {+ separating = NSEvent.modifierFlags.contains(.command)+ guard flagsMonitor == nil else { return }+ flagsMonitor = NSEvent.addLocalMonitorForEvents(matching: .flagsChanged) { [weak self] event in+ if let self, self.overIcon {+ let cmd = event.modifierFlags.contains(.command)+ if cmd != self.separating {+ self.separating = cmd+ self.refreshIcon()+ self.refreshSubtitle()+ }+ }+ return event+ }+ }++ private func stopWatchingFlags() {+ separating = false+ if let m = flagsMonitor { NSEvent.removeMonitor(m) }+ flagsMonitor = nil+ }++ override func viewWillMove(toWindow newWindow: NSWindow?) {+ super.viewWillMove(toWindow: newWindow)+ if newWindow == nil { stopWatchingFlags() }+ }++ /// On the icon the pinned page's favicon stands in (⌘: the page's own, which separates);+ /// the slash hides on the icon and, on a background row, on the body too.+ private func refreshIcon() {+ guard let m = model else { return }+ if overIcon && !separating {+ favicon.show(m.homeIcon, flip: m.homeFlipIcon, colors: colors)+ } else if m.githubMark {+ favicon.showGitHubMark(colors: colors)+ } else {+ favicon.show(m.icon, flip: m.flipIcon, colors: colors)+ }+ slash.isHidden = !m.navigatedAway || overIcon || (isHovered && !m.highlighted)+ }++ private func refreshRegion() {+ guard let m = model, canReset, isHovered else { regionLayer.isHidden = true; return }+ let fill = fillRect+ if overIcon {+ // Over the open row's white fill only the icon's left corners round.+ regionLayer.frame = CGRect(x: fill.minX, y: fill.minY, width: Self.iconRegionWidth, height: fill.height)+ regionLayer.maskedCorners = m.highlighted ? [.layerMinXMinYCorner, .layerMinXMaxYCorner]+ : [.layerMinXMinYCorner, .layerMinXMaxYCorner, .layerMaxXMinYCorner, .layerMaxXMaxYCorner]+ } else if !m.highlighted {+ regionLayer.frame = CGRect(x: fill.minX + Self.bodyRegionInset, y: fill.minY,+ width: max(0, fill.width - Self.bodyRegionInset), height: fill.height)+ regionLayer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner, .layerMaxXMinYCorner, .layerMaxXMaxYCorner]+ } else {+ regionLayer.isHidden = true+ return+ }+ regionLayer.backgroundColor = colors.hoverFill.cgColor+ regionLayer.isHidden = false+ }++ /// Arc's hover subtitle (HoverSubtitleState.reset, ⌘: resetAndSeparate) stands in for the+ /// line under the title while the pointer is on the icon.+ private var shownSubtitle: String? {+ overIcon ? (separating ? "Separate From Pinned Tab" : "Back to Pinned URL") : model?.subtitle+ }++ private func refreshSubtitle() {+ subtitleLabel.stringValue = shownSubtitle ?? ""+ subtitleLabel.textColor = colors.textTertiary+ subtitleLabel.isHidden = shownSubtitle == nil || renameField != nil+ }++ /// Recording dot, mute or playing sound, unread dot, and on hover close. Made once/// per row and shown or hidden: hover moves from row to row on every frame of a scroll.private lazy var captureDot: NSView = {let dot = NSView(frame: NSRect(x: 0, y: 0, width: 16, height: 16))@@ -903,23 +1096,21 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {private static let soundSymbol = "speaker.wave.3"private static let soundGlyphWidth: CGFloat = 17.5private var showsSound = false+ private lazy var peekBadge = SidebarFaviconView()private lazy var unreadDot: NSView = {let dot = NSView(frame: NSRect(x: 0, y: 0, width: 6, height: 6))dot.wantsLayer = truedot.layer?.cornerRadius = 3return dot}()- private lazy var resetButton = SidebarGlyphButton(symbol: "arrow.uturn.backward", size: 22, iconSize: 13, help: "Back to pinned page", colors: colors) { [weak self] in- guard let self, let id = self.model?.id else { return }- self.list?.actions.resetPinnedTab(id)- }private lazy var closeButton: SidebarGlyphButton = {let b = SidebarGlyphButton(symbol: "xmark", size: Self.closeSize, iconSize: 13, help: "", colors: colors) {}b.setCloseMark(minus: false, help: "")return b}()- private static let closeSize: CGFloat = 22- private var closeKind = ""+ /// Arc's close button: a 24 pt square (TabCellView, GitHub #139).+ private static let closeSize: CGFloat = 24+ private var closeKind: SidebarClose.Button?private func rebuildAccessories() {guard let m = model, list != nil else { return }@@ -935,30 +1126,31 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {}soundButton.isHidden = !soundif sound != showsSound { showsSound = sound; needsLayout = true }+ if let peek = m.peekIcon, !isHovered {+ peekBadge.show(peek, flip: false, colors: colors)+ shown.append(peekBadge)+ }if m.unread && !m.selected && !isHovered {unreadDot.layer?.backgroundColor = colors.textPrimary.withAlphaComponent(0.55).cgColorshown.append(unreadDot)}- if isHovered && !m.editing {- if m.navigatedAway { resetButton.colors = colors; shown.append(resetButton) }- // Arc: the open pinned tab shows a minus (it unloads and stays pinned); any other pinned- // tab an ✕ that archives it out of the pinned section; Today tabs an ✕ that archives.- let kind = m.closeGroup > 1 ? "group\(m.closeGroup)" : (m.pinned && m.selected ? "keep" : (m.pinned ? "archivePinned" : "archive"))- if kind != closeKind {- closeKind = kind- switch kind {- case "keep":- closeButton.setCloseMark(minus: true, help: "Close and Keep Pinned (⌘W)")- closeButton.action = { [weak self] in self?.list?.closeTabs([id]) }- case "archivePinned":- closeButton.setCloseMark(minus: false, help: "Archive this tab")- closeButton.action = { [weak self] in self?.list?.store.archiveTab(id, reason: .manual) }- default:- closeButton.setCloseMark(minus: false, help: m.closeGroup > 1 ? "Close \(m.closeGroup) Tabs (⌘W)" : "Archive (⌘W)")- closeButton.action = { [weak self] in- guard let list = self?.list else { return }- list.closeTabs(list.closeGroup(for: id))+ // Arc hides the button while the pointer is on the icon of a tab it can take back.+ if isHovered && !m.editing && !overIcon {+ // SidebarClose: a minus keeps the tab pinned (it unloads and goes back to its page), an+ // ✕ archives it. Either acts on this row only, picked tabs or not; ⌘W takes them all.+ let button = SidebarClose.tab(pinned: m.pinned, current: m.selected, navigatedAway: m.navigatedAway, peeked: m.peeked)+ if button != closeKind {+ closeKind = button+ closeButton.setCloseMark(minus: button.minus, help: button.help)+ closeButton.action = { [weak self] in+ guard let self, let list = self.list else { return }+ if button.minus {+ self.bounce()+ list.actions.closeTab(id)+ } else {+ list.store.archiveTab(id, reason: .manual)}+ list.ui.multiSelection.remove(id)}}closeButton.colors = colors@@ -978,9 +1170,17 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {super.layout()guard let m = model else { return }let h = bounds.height- var x = 8 + CGFloat(m.depth) * CraMetrics.indent+ var x = CraMetrics.rowLeading + CGFloat(m.depth) * CraMetrics.indentfavicon.frame = NSRect(x: x, y: (h - CraMetrics.favicon) / 2, width: CraMetrics.favicon, height: CraMetrics.favicon)- x += CraMetrics.favicon + 11+ if m.navigatedAway {+ // Arc: 4 pt, the slash, then the name 5 pt on (2 pt later than without it).+ x += CraMetrics.favicon + 4+ let s = SidebarSlashView.size+ slash.frame = NSRect(x: x, y: ((h - s.height) / 2).rounded(), width: s.width, height: s.height)+ x += s.width + 5+ } else {+ x += CraMetrics.favicon + 11+ }if showsSound {let s = soundButton.sizesoundButton.frame = NSRect(x: x - (s.width - Self.soundGlyphWidth) / 2, y: (h - s.height) / 2, width: s.width, height: s.height)@@ -992,13 +1192,13 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {// The unread dot is centred where the close button shows on hover, which is also// under a live folder's refresh button (FolderRowView, Arc lines them up too).let s = v.frame.size- let slot = v === unreadDot ? Self.closeSize : s.width+ let slot = v === unreadDot || v === peekBadge ? Self.closeSize : s.widthv.frame = NSRect(x: right - slot / 2 - s.width / 2, y: (h - s.height) / 2, width: s.width, height: s.height)right = v.frame.minX - 11}let textWidth = max(0, right - 4 - 11 - x)let th = titleLabel.intrinsicContentSize.height- if m.subtitle != nil {+ if shownSubtitle != nil {let sh = subtitleLabel.intrinsicContentSize.heightlet top = (h - th - 1 - sh) / 2titleLabel.frame = NSRect(x: x - SidebarText.inset, y: top, width: textWidth + 2 * SidebarText.inset, height: th)@@ -1011,6 +1211,7 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {f.frame = NSRect(x: x - SidebarText.inset, y: (h - fh) / 2, width: max(0, bounds.width - 6 - x + SidebarText.inset), height: fh)}focusRing?.frame = fillRect+ refreshRegion()}// MARK: Rename@@ -1042,7 +1243,7 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {if let w = window, let editor = f.currentEditor(), w.firstResponder === editor { w.makeFirstResponder(nil) }f.removeFromSuperview()titleLabel.isHidden = false- subtitleLabel.isHidden = model?.subtitle == nil+ refreshSubtitle()}private func commitRename() {@@ -1067,6 +1268,19 @@ final class TabRowView: SidebarRowView, ArcTooltipTarget, NSTextFieldDelegate {guard let m = model, let list else { return }// A click on the row (not the field) ends a rename, so it can never get stuck.if m.editing { commitRename() }+ // Arc: the favicon of a pinned tab away from its page takes it back there and opens it;+ // with ⌘ the page moves out to a new Today tab first (GitHub #139).+ if canReset, iconRegion.contains(point) {+ setOverIcon(false)+ if event.modifierFlags.contains(.command) {+ list.actions.separatePinnedTab(m.id)+ } else {+ list.actions.resetPinnedTab(m.id)+ list.ui.clearPicks(anchor: m.id)+ list.store.selectTab(m.id, window: list.ui.windowID)+ }+ return+ }list.clickTab(m.id, event: event)}@@ -1155,6 +1369,7 @@ final class FolderRowView: SidebarRowView, NSTextFieldDelegate {if let m = model { model = nil; apply(m) }}+ override var fillLeading: CGFloat { CGFloat(model?.depth ?? 0) * CraMetrics.indent }override func baseFill() -> NSColor { isHovered ? colors.hoverFill : .clear }override func hoverChanged() {@@ -1209,7 +1424,7 @@ final class FolderRowView: SidebarRowView, NSTextFieldDelegate {super.layout()guard let m = model else { return }let h = bounds.height- var x = 8 + CGFloat(m.depth) * CraMetrics.indent+ var x = CraMetrics.rowLeading + CGFloat(m.depth) * CraMetrics.indentglyph.frame = NSRect(x: x, y: (h - 20) / 2, width: CraMetrics.favicon, height: 20)x += CraMetrics.favicon + 11var right = bounds.width@@ -1305,18 +1520,27 @@ struct SplitRowModel: Equatable {var cells: [Cell]}-/// Arc's split cell (SplitViewCellView): the panes side by side, hairlines between them.+/// Arc's split cell (SplitViewCellView): the panes side by side, hairlines between them, each+/// pane a pill while the split is open. Its close buttons follow SidebarClose.split: one at the+/// row's end for a pinned split or a Today split in the background, one in every pane of an+/// open Today split (GitHub #139).final class SplitRowView: SidebarRowView {private(set) var model: SplitRowModel?private var cells: [SplitCellView] = []private var separators: [NSView] = []private var focusRing: FocusRingLayer?+ private lazy var closeButton: SidebarGlyphButton = {+ let b = SidebarGlyphButton(symbol: "xmark", size: SplitRowMetrics.button, iconSize: 13, help: "", colors: colors) {}+ b.setCloseMark(minus: false, help: "")+ b.isHidden = true+ addSubview(b)+ return b+ }()+ private var shownButtons: SidebarClose.SplitButtons?func apply(_ m: SplitRowModel) {guard m != model else { return }- let closeChanged = m.selected != model?.selected || m.today != model?.todaymodel = m- defer { if closeChanged { for c in cells where c.hovering { c.refreshClose() } } }if cells.map(\.cellID) != m.cells.map(\.id) {cells.forEach { $0.removeFromSuperview() }separators.forEach { $0.removeFromSuperview() }@@ -1329,8 +1553,11 @@ final class SplitRowView: SidebarRowView {cells.forEach { addSubview($0) }separators.forEach { addSubview($0) }}- for (c, cm) in zip(cells, m.cells) { c.apply(cm, colors: colors) }- for s in separators { s.layer?.backgroundColor = colors.separator.cgColor }+ for (c, cm) in zip(cells, m.cells) { c.apply(cm, colors: colors, pill: m.highlighted) }+ for s in separators {+ s.layer?.backgroundColor = colors.separator.cgColor+ s.isHidden = m.highlighted+ }if m.focusRing != (focusRing != nil) {if m.focusRing {let r = FocusRingLayer()@@ -1342,6 +1569,7 @@ final class SplitRowView: SidebarRowView {focusRing = nil}}+ refreshButtons()refreshBackground()needsLayout = true}@@ -1352,6 +1580,8 @@ final class SplitRowView: SidebarRowView {if let m = model { model = nil; apply(m) }}+ override var fillLeading: CGFloat { CGFloat(model?.depth ?? 0) * CraMetrics.indent }+override func baseFill() -> NSColor {guard let m = model else { return .clear }return m.highlighted ? colors.selectedFill : (isHovered ? colors.hoverFill : .clear)@@ -1365,26 +1595,65 @@ final class SplitRowView: SidebarRowView {override func hoverChanged() {super.hoverChanged()if !isHovered { cells.forEach { $0.hovering = false } }+ refreshButtons()}override func hoverMoved(to point: NSPoint) {for c in cells { c.hovering = c.frame.contains(point) }}+ /// The buttons show while the row is hovered, as on a tab's row.+ private func refreshButtons() {+ guard let m = model, let list else { return }+ let buttons: SidebarClose.SplitButtons? = isHovered ? SidebarClose.split(pinned: !m.today, current: m.selected) : nil+ guard buttons != shownButtons else { return }+ shownButtons = buttons+ let panes = m.cells.map(\.id)+ if case .row(let b)? = buttons {+ closeButton.setCloseMark(minus: b.minus, help: b.help)+ closeButton.colors = colors+ closeButton.action = { [weak self, weak list] in+ guard let self, let list else { return }+ // Keep: the whole split unloads and stays pinned; archive: the whole split goes.+ if b.minus {+ self.bounce()+ if let first = panes.first { list.actions.closeTab(first) }+ } else {+ for p in panes { list.store.archiveTab(p, reason: .manual) }+ }+ }+ closeButton.isHidden = false+ } else {+ closeButton.isHidden = true+ }+ let perPane: SidebarClose.Button?+ if case .perPane(let b)? = buttons { perPane = b } else { perPane = nil }+ for c in cells { c.setClose(perPane) }+ needsLayout = true+ }+override func layout() {super.layout()- guard let m = model, !cells.isEmpty else { return }- let x0 = CGFloat(m.depth) * CraMetrics.indent+ guard model != nil, !cells.isEmpty else { return }+ let fill = fillRect+ let gap = SplitRowMetrics.cellGaplet n = CGFloat(cells.count)- let w = (bounds.width - x0 - (n - 1)) / n- var x = x0+ let w = (fill.width - 2 * SplitRowMetrics.cellInset - (n - 1) * gap) / n+ let button = closeButton.isHidden ? nil+ : NSRect(x: fill.maxX - SplitRowMetrics.buttonInset - SplitRowMetrics.button, y: (bounds.height - SplitRowMetrics.button) / 2,+ width: SplitRowMetrics.button, height: SplitRowMetrics.button)+ if let button { closeButton.frame = button }+ var x = fill.minX + SplitRowMetrics.cellInsetfor (i, c) in cells.enumerated() {if i > 0 {- separators[i - 1].frame = NSRect(x: x, y: SplitRowMetrics.separatorInset, width: 1, height: bounds.height - 2 * SplitRowMetrics.separatorInset)- x += 1+ separators[i - 1].frame = NSRect(x: x - gap / 2 - 0.5, y: SplitRowMetrics.separatorInset, width: 1,+ height: bounds.height - 2 * SplitRowMetrics.separatorInset)}- c.frame = NSRect(x: x, y: 0, width: w, height: bounds.height)- x += w+ var cw = w+ // The row's button takes the end of the last pane (Arc shortens its pill to 5 pt before it).+ if let button, i == cells.count - 1 { cw = max(0, button.minX - SplitRowMetrics.cellToButton - x) }+ c.frame = NSRect(x: x, y: fill.minY, width: cw, height: fill.height)+ x += w + gap}focusRing?.frame = fillRect}@@ -1409,8 +1678,21 @@ final class SplitRowView: SidebarRowView {override func tooltipTarget(at point: NSPoint) -> (any ArcTooltipTarget)? { cell(at: point) }}+/// Arc 1.171, measured at 1x (GitHub #139): panes 4 pt inside the fill and 4 pt apart, buttons 24 pt.enum SplitRowMetrics {static let separatorInset: CGFloat = 9+ static let cellInset: CGFloat = 4+ static let cellGap: CGFloat = 4+ static let button: CGFloat = 24+ /// The row's button ends this far before the fill's end; a pane's 2 pt before the pane's.+ static let buttonInset: CGFloat = 6+ static let paneButtonInset: CGFloat = 2+ static let cellToButton: CGFloat = 5+ /// An open split's pane pill: 4 pt inside the fill top and bottom.+ static let pillInset: CGFloat = 4+ static let pillRadius: CGFloat = 7+ /// The favicon sits this far into its pane.+ static let favicon: CGFloat = 6}/// One pane inside the split row (Arc: SplitViewCellChildItemView).@@ -1419,14 +1701,20 @@ final class SplitCellView: NSView, ArcTooltipTarget {private weak var row: SplitRowView?private let favicon = SidebarFaviconView()private let titleLabel = NSTextField.sidebarLabel(size: 14)+ private let pill = CALayer()private var close: SidebarGlyphButton?private var title = ""- var hovering = false { didSet { if hovering != oldValue { refreshClose() } } }+ var hovering = falseinit(cellID: UUID, row: SplitRowView) {self.cellID = cellIDself.row = rowsuper.init(frame: .zero)+ wantsLayer = true+ pill.cornerRadius = SplitRowMetrics.pillRadius+ pill.cornerCurve = .continuous+ pill.actions = ["backgroundColor": NSNull(), "position": NSNull(), "bounds": NSNull(), "hidden": NSNull()]+ layer?.addSublayer(pill)addSubview(favicon)addSubview(titleLabel)}@@ -1441,29 +1729,30 @@ final class SplitCellView: NSView, ArcTooltipTarget {return nil}- func apply(_ m: SplitRowModel.Cell, colors: SidebarColors) {+ func apply(_ m: SplitRowModel.Cell, colors: SidebarColors, pill shown: Bool) {title = m.titlefavicon.show(m.icon, flip: m.flipIcon, colors: colors)titleLabel.stringValue = m.titletitleLabel.textColor = colors.textPrimaryclose?.colors = colors+ // Arc's open split: each pane a pill a shade darker than the white fill (224 on 241).+ pill.backgroundColor = (colors.isDark ? NSColor.white : .black).withAlphaComponent(0.07).cgColor+ pill.isHidden = !shownneedsLayout = true}- func refreshClose() {+ /// An open Today split's ✕ in this pane, or none.+ func setClose(_ button: SidebarClose.Button?) {close?.removeFromSuperview()close = nil- guard hovering, let row, let list = row.list else { needsLayout = true; return }+ guard let button, let row, let list = row.list else { needsLayout = true; return }let id = cellID- // Arc 1.171: an open pinned split shows a minus (the whole split closes and stays pinned),- // like an open pinned tab; otherwise the ✕ takes this pane out.- let keep = row.model.map { !$0.today && $0.selected } ?? false- let b = SidebarGlyphButton(symbol: "xmark", size: 20, iconSize: 11, help: keep ? "Close and Keep Pinned (⌘W)" : "Close pane",+ let b = SidebarGlyphButton(symbol: "xmark", size: SplitRowMetrics.button, iconSize: 13, help: button.help,optionHelp: "Separate from Split View", colors: row.colors) { [weak list] in// Option-click un-splits instead of closing (Arc flag option-click-split-tab-close-button-to-unsplit).- if NSEvent.modifierFlags.contains(.option) { list?.store.separateFromSplit(id) } else if keep { list?.actions.closeTab(id) } else { list?.actions.closePane(id) }+ if NSEvent.modifierFlags.contains(.option) { list?.store.separateFromSplit(id) } else { list?.actions.closePane(id) }}- if keep { b.setCloseMark(minus: true, help: "Close and Keep Pinned (⌘W)") }+ b.setCloseMark(minus: false, help: button.help)addSubview(b)close = bneedsLayout = true@@ -1472,16 +1761,21 @@ final class SplitCellView: NSView, ArcTooltipTarget {override func layout() {super.layout()let h = bounds.height- favicon.frame = NSRect(x: 8, y: (h - CraMetrics.favicon) / 2, width: CraMetrics.favicon, height: CraMetrics.favicon)- var right = bounds.width - 4+ CATransaction.begin()+ CATransaction.setDisableActions(true)+ pill.frame = bounds.insetBy(dx: 0, dy: SplitRowMetrics.pillInset)+ CATransaction.commit()+ let fx = SplitRowMetrics.favicon+ favicon.frame = NSRect(x: fx, y: (h - CraMetrics.favicon) / 2, width: CraMetrics.favicon, height: CraMetrics.favicon)+ var right = bounds.widthif let close {- right -= 20- close.frame = NSRect(x: right, y: (h - 20) / 2, width: 20, height: 20)- right -= 8+ let s = SplitRowMetrics.button+ close.frame = NSRect(x: right - SplitRowMetrics.paneButtonInset - s, y: (h - s) / 2, width: s, height: s)+ right = close.frame.minX}let th = titleLabel.intrinsicContentSize.height- let x = 8 + CraMetrics.favicon + 8- titleLabel.frame = NSRect(x: x - SidebarText.inset, y: (h - th) / 2, width: max(0, right - 2 - 8 - x) + 2 * SidebarText.inset, height: th)+ let x = fx + CraMetrics.favicon + 11+ titleLabel.frame = NSRect(x: x - SidebarText.inset, y: (h - th) / 2, width: max(0, right - 4 - x) + 2 * SidebarText.inset, height: th)}var text: String { title }@@ -1520,7 +1814,7 @@ final class LiveStatusRowView: SidebarRowView {required init?(coder: NSCoder) { fatalError() }- static func leading(depth: Int) -> CGFloat { 8 + CGFloat(depth) * CraMetrics.indent + CraMetrics.favicon + 11 }+ static func leading(depth: Int) -> CGFloat { CraMetrics.rowLeading + CGFloat(depth) * CraMetrics.indent + CraMetrics.favicon + 11 }static func height(_ m: LiveStatusModel, width: CGFloat) -> CGFloat {let w = max(1, width - leading(depth: m.depth) - 10)@@ -1549,6 +1843,7 @@ final class LiveStatusRowView: SidebarRowView {}override func baseFill() -> NSColor { model?.url != nil && isHovered ? colors.hoverFill : .clear }+ override var fillLeading: CGFloat { CGFloat(model?.depth ?? 0) * CraMetrics.indent }override func hoverChanged() {super.hoverChanged()@@ -1679,9 +1974,9 @@ final class NewTabRowView: SidebarRowView {override func layout() {super.layout()let h = bounds.height- plus.frame = NSRect(x: 8, y: 0, width: CraMetrics.favicon, height: h)+ plus.frame = NSRect(x: CraMetrics.rowLeading, y: 0, width: CraMetrics.favicon, height: h)let th = label.intrinsicContentSize.height- let x = 8 + CraMetrics.favicon + 9+ let x = CraMetrics.rowLeading + CraMetrics.favicon + 9let w = max(0, bounds.width - 10 - x) + 2 * SidebarText.insetguard !preview.isHidden else {label.frame = NSRect(x: x - SidebarText.inset, y: (h - th) / 2, width: w, height: th)@@ -1786,13 +2081,14 @@ final class DividerRowView: SidebarRowView {override func layout() {super.layout()- var right = bounds.width - 20+ // Arc 1.171 at 1x (GitHub #139): the line runs 18 pt in from both edges; "Clear" ends 20 pt in.+ var right = bounds.width - 18if let clear {let s = clear.fittingSize- clear.frame = NSRect(x: right - s.width, y: (bounds.height - s.height) / 2, width: s.width, height: s.height)- right -= s.width + 8+ clear.frame = NSRect(x: bounds.width - 20 - s.width, y: (bounds.height - s.height) / 2, width: s.width, height: s.height)+ right = clear.frame.minX - 8}- line.frame = NSRect(x: 20, y: (bounds.height - 1) / 2, width: max(0, right - 20), height: 1)+ line.frame = NSRect(x: 18, y: (bounds.height - 1) / 2, width: max(0, right - 18), height: 1)}private final class ClearButton: NSView {diff --git a/Sources/Cra/UI/Sidebar/List/SpaceListView.swift b/Sources/Cra/UI/Sidebar/List/SpaceListView.swiftindex b02ec4c..58df4ee 100644--- a/Sources/Cra/UI/Sidebar/List/SpaceListView.swift+++ b/Sources/Cra/UI/Sidebar/List/SpaceListView.swift@@ -244,7 +244,7 @@ final class SpaceListView: NSView, NSDraggingSource {return d}- func add(_ item: SidebarItem, depth: Int, pinned: Bool, parent: UUID, index: Int) {+ func add(_ item: SidebarItem, depth: Int, pinned: Bool, parent: UUID, index: Int, peeked: Bool = false) {var row = Row(key: .item(item.id), content: .newTab(active: false), decor: decor(item.id), itemID: item.id, parent: parent, index: index, depth: depth)if item.isFolder {let expanded = store.isExpanded(item.id)@@ -263,7 +263,7 @@ final class SpaceListView: NSView, NSDraggingSource {// Arc keeps the open tab of a closed folder in sight, one level in (FolderPeek).for t in peeked {let index = t.parentID.flatMap { store.item($0)?.children.firstIndex(of: t.id) } ?? 0- add(t, depth: depth + 1, pinned: pinned, parent: t.parentID ?? item.id, index: index)+ add(t, depth: depth + 1, pinned: pinned, parent: t.parentID ?? item.id, index: index, peeked: true)}return}@@ -278,7 +278,9 @@ final class SpaceListView: NSView, NSDraggingSource {let selected = store.isSelected(item.id, window: window)let navigatedAway = pinned && tab.url != tab.savedURL && !tab.savedURL.isEmptylet (img, flip) = icon(tab.iconKey)- let subtitle = tab.sidebarSubtitle(navigatedAway: navigatedAway, developerMode: store.settings.isDeveloperMode(url: tab.url))+ let (homeImg, homeFlip) = navigatedAway ? icon(tab.customIconKey ?? FaviconKey.key(for: tab.savedURL)) : (img, flip)+ let developerMode = store.settings.isDeveloperMode(url: tab.url)+ let subtitle = tab.sidebarSubtitle(developerMode: developerMode)row.content = .tab(TabRowModel(id: item.id, depth: depth, pinned: pinned, title: item.displayTitle, customTitle: item.title != nil,renameText: item.title ?? item.displayTitle, subtitle: subtitle,@@ -287,8 +289,9 @@ final class SpaceListView: NSView, NSDraggingSource {highlighted: picks.isEmpty ? selected && !placeholder : picks.contains(item.id),capturing: capturing.contains(item.id), audible: audible.contains(item.id), muted: tab.muted, unread: item.isUnread,navigatedAway: navigatedAway,- closeGroup: picks.contains(item.id) && picks.count > 1 ? picks.count : 1,- focusRing: focusID == item.id))+ focusRing: focusID == item.id, developerMode: developerMode, peeked: peeked,+ homeIcon: homeImg, homeFlipIcon: homeFlip,+ peekIcon: ui.peekBadge?.tabID == item.id ? icon(ui.peekBadge?.iconKey).0 : nil))out.append(row)} else if item.isSplit {let children = store.children(of: item.id).filter(\.isTab)@@ -505,14 +508,14 @@ final class SpaceListView: NSView, NSDraggingSource {/// (reported on X, 2 Nov 2026, with the pinned tabs collapsed).private func layoutRows() {let width = rowsWidth- let inner = max(0, width - 20)+ let inner = max(0, width - 2 * CraMetrics.rowInset)var y: CGFloat = 3let pinnedTop = yvar afterLine = falsefor i in 0..<rows.count {let isDivider = rows[i].key == .dividerif i == pinnedCount {- pinnedFrame = NSRect(x: 10, y: pinnedTop, width: inner, height: y - pinnedTop)+ pinnedFrame = NSRect(x: CraMetrics.rowInset, y: pinnedTop, width: inner, height: y - pinnedTop)}if isDivider {afterLine = rows[i].content == .divider(hasToday: true)@@ -524,11 +527,11 @@ final class SpaceListView: NSView, NSDraggingSource {if !(afterLine && i == pinnedCount + 1) { y += CraMetrics.rowSpacing }let h: CGFloatif case .liveStatus(let m) = rows[i].content { h = LiveStatusRowView.height(m, width: inner) } else { h = CraMetrics.rowHeight }- rows[i].frame = NSRect(x: 10, y: y, width: inner, height: h)+ rows[i].frame = NSRect(x: CraMetrics.rowInset, y: y, width: inner, height: h)y += h}let todayTop = rows.indices.contains(pinnedCount) ? rows[pinnedCount].frame.maxY : y- todayFrame = NSRect(x: 10, y: todayTop, width: inner, height: max(0, y - todayTop))+ todayFrame = NSRect(x: CraMetrics.rowInset, y: todayTop, width: inner, height: max(0, y - todayTop))contentBottom = ylet height = max(y + 121, scrollView.contentView.bounds.height)let docWidth = legacyScrollerShown ? scrollView.contentView.frame.width : width@@ -1043,7 +1046,7 @@ final class SpaceListView: NSView, NSDraggingSource {// An empty pinned list shows its own placeholder instead of a line.guard let y else { return drop }let depth = items.first { $0.itemID == parent }.map { $0.depth + 1 } ?? 0- drop.line = .init(y: y, minX: todayFrame.minX + 8 + CGFloat(depth) * CraMetrics.indent, maxX: todayFrame.maxX - 6)+ drop.line = .init(y: y, minX: todayFrame.minX + CraMetrics.rowLeading + CGFloat(depth) * CraMetrics.indent, maxX: todayFrame.maxX - 6)drop.rowAbove = items.last { $0.frame.maxY <= y + 1 }?.itemIDdrop.rowBelow = items.first { $0.frame.minY >= y - 1 }?.itemIDreturn dropdiff --git a/Sources/Cra/UI/Sidebar/SidebarListDrop.swift b/Sources/Cra/UI/Sidebar/SidebarListDrop.swiftindex 3e0ce8b..2968b5c 100644--- a/Sources/Cra/UI/Sidebar/SidebarListDrop.swift+++ b/Sources/Cra/UI/Sidebar/SidebarListDrop.swift@@ -181,13 +181,13 @@ final class CombineDropPreview: NSView {let icon = SidebarFaviconView()icon.show(favicons.image(forKey: item.tab?.iconKey), flip: favicons.glyphIsDark(forKey: item.tab?.iconKey) == palette.isDark, colors: colors)let h = bounds.height- icon.frame = NSRect(x: 8, y: (h - CraMetrics.favicon) / 2, width: CraMetrics.favicon, height: CraMetrics.favicon)+ icon.frame = NSRect(x: SplitRowMetrics.cellInset + SplitRowMetrics.favicon, y: (h - CraMetrics.favicon) / 2, width: CraMetrics.favicon, height: CraMetrics.favicon)v.addSubview(icon)let label = NSTextField.sidebarLabel(size: 14)label.stringValue = item.displayTitlelabel.textColor = colors.textPrimary// HStack(spacing: 8) after 8 pt, Spacer(minLength: 2), 4 pt trailing.- let x = 8 + CraMetrics.favicon + 8+ let x = SplitRowMetrics.cellInset + SplitRowMetrics.favicon + CraMetrics.favicon + 11label.frame = NSRect(x: x - SidebarText.inset, y: (h - 17) / 2, width: max(0, width - x - 14) + 2 * SidebarText.inset, height: 17)v.addSubview(label)return v@@ -236,7 +236,7 @@ final class CombineDropPreview: NSView {// MARK: Folderprivate func buildFolder() {- let x0 = 8 + CGFloat(depth) * CraMetrics.indent+ let x0 = CraMetrics.rowLeading + CGFloat(depth) * CraMetrics.indentlet h = bounds.heightlet tones = palette.folderColors(nil)// The folder: its outline over its fill, popping from 40%.diff --git a/Sources/Cra/UI/SidebarUIState.swift b/Sources/Cra/UI/SidebarUIState.swiftindex 5f2e8c2..5407e53 100644--- a/Sources/Cra/UI/SidebarUIState.swift+++ b/Sources/Cra/UI/SidebarUIState.swift@@ -118,6 +118,12 @@ final class SidebarUIState {}/// Tabs picked with ⌘/⇧-click; closing acts on all of them.var multiSelection: Set<UUID> = []+ /// The tab an open Peek came from and the peeked page's favicon, which its row shows.+ var peekBadge: PeekBadge?+ struct PeekBadge: Equatable {+ let tabID: UUID+ let iconKey: String?+ }/// Where the next ⇧-click range starts.var selectionAnchor: UUID?/// A sidebar drag over the space's list and what releasing it would do.@@ -198,6 +204,7 @@ final class SidebarActions {var closeLibrary: () -> Void = {}var restoreArchived: (UUID) -> Void = { _ in }var resetPinnedTab: (UUID) -> Void = { _ in }+ var separatePinnedTab: (UUID) -> Void = { _ in }var editPinnedURL: (UUID) -> Void = { _ in }var openURL: (String) -> Void = { _ in }var performAction: (String) -> Void = { _ in }diff --git a/Sources/Cra/UI/Theme.swift b/Sources/Cra/UI/Theme.swiftindex 21f9154..33ab551 100644--- a/Sources/Cra/UI/Theme.swift+++ b/Sources/Cra/UI/Theme.swift@@ -491,7 +491,12 @@ enum CraMetrics {static let rowSpacing: CGFloat = 1static let rowCorner: CGFloat = 10static let favicon: CGFloat = 16- static let indent: CGFloat = 18+ /// A nested row's step in (Arc 1.171, measured at 1x: favicon 26 → 42, text 45 → 61; GitHub #139).+ static let indent: CGFloat = 16+ /// Arc 1.171 at 1x (GitHub #139): a row's fill starts 8 pt in from the sidebar's edge and its+ /// favicon 10 pt into the fill (18 pt in), the same on the right (fill ends 8 pt short).+ static let rowInset: CGFloat = 8+ static let rowLeading: CGFloat = 10static let contentInset: CGFloat = 10static let contentCornerRadius: CGFloat = 6static let toolbarHeight: CGFloat = 32diff --git a/Sources/Cra/UI/Windows/MainWindowController.swift b/Sources/Cra/UI/Windows/MainWindowController.swiftindex cef17a8..ca28a64 100644--- a/Sources/Cra/UI/Windows/MainWindowController.swift+++ b/Sources/Cra/UI/Windows/MainWindowController.swift@@ -230,6 +230,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMself.closeLibrary()}sidebarActions.resetPinnedTab = { [weak self] id in self?.resetPinnedTab(id) }+ sidebarActions.separatePinnedTab = { [weak self] id in self?.separatePinnedTab(id) }sidebarActions.editPinnedURL = { [weak self] id in self?.editPinnedURL(id) }sidebarActions.openURL = { [weak self] url inguard let self else { return }@@ -1289,15 +1290,16 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM/// pinned tab (any tab with "In every tab" on), or any Shift-clicked link, opens over the/// window and the tab stays put.func browserManagerOpensPeek(url: String, fromTab tabID: UUID, pageURL: String, shiftClick: Bool) -> Bool {- guard !isIncognito, let target = SiteKey.site(of: url) else { return false }+ guard !isIncognito, SiteKey.site(of: url) != nil else { return false }if shiftClick {guard store.settings.peekOnShiftClick else { return false }} else {+ // Another host, not another site: Arc peeks from pin.lvh.me to away.lvh.me (GitHub #139).guard store.settings.peekLinksToOtherSites,store.settings.peekInEveryTab || store.isPinned(tabID),- let here = SiteKey.site(of: pageURL), here != target else { return false }+ PinnedNavigation.linkLeavesHost(url, from: pageURL) else { return false }}- app.openPeek(url: url, over: self)+ app.openPeek(url: url, over: self, fromTab: tabID)return true}@@ -1318,16 +1320,23 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMfunc debugRunInDevTools(_ script: String) { currentBrowser?.executeJavaScript(script, inDevTools: true) }func closeCurrentTab() {- // ⌘W with tabs picked in the sidebar closes all of them.- if !sidebarUI.multiSelection.isEmpty {- let ids = sidebarUI.multiSelection- sidebarUI.clearPicks()- for id in ids where id != selectedTabID { closeTab(id) }- if let open = selectedTabID, ids.contains(open) { closeTab(open) }- return+ // ⌘W with tabs picked in the sidebar takes all of them. As in Arc (SidebarClose.commandW),+ // a Today tab among them archives them all, pinned ones too; otherwise they all keep+ // their place and unload.+ let ids = sidebarUI.multiSelection.isEmpty ? selectedTabID.map { [$0] } ?? [] : Array(sidebarUI.multiSelection)+ guard !ids.isEmpty else { return }+ sidebarUI.clearPicks()+ let action = SidebarClose.commandW(anyToday: ids.contains { !store.isPinned($0) })+ // The open tab goes last so closing it doesn't hop through tabs about to close.+ let open = selectedTabID+ for id in ids.filter({ $0 != open }) + ids.filter({ $0 == open }) {+ if action == .keep || !store.isPinned(id) {+ closeTab(id)+ } else {+ // A pinned split goes as one, as it closes as one.+ for p in store.paneTabIDs(for: id) { store.archiveTab(p, reason: .manual) }+ }}- guard let id = selectedTabID else { return }- closeTab(id)}/// Today tabs are archived. Pinned tabs and favorites stay; they unload@@ -1364,6 +1373,16 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMapp.runtime(for: id)?.browser.loadURL(home)}+ /// Arc's ⌘-click on the favicon of a pinned tab away from its page ("Separate From Pinned+ /// Tab", GitHub #139): the page moves to a new Today tab at the top, the pinned tab goes back+ /// to its page and stays open.+ func separatePinnedTab(_ id: UUID) {+ guard let t = store.item(id)?.tab, store.isPinned(id), t.url != t.savedURL else { return }+ _ = store.createTab(url: t.url, title: t.savedTitle, in: store.spaceID(ofItem: id), select: false, index: 0)+ resetPinnedTab(id)+ store.selectTab(id, window: windowID)+ }+/// Edit Pinned URL… (#54): Arc's dialog with the pinned URL. A page showing the old/// pinned URL loads the new one; one navigated away stays where it is.func editPinnedURL(_ id: UUID) {@@ -2244,7 +2263,10 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserMfunc open(_ url: String) {store.recordQuerySelection(query: query, url: url)let fillsEmptyPane = selectedTab?.isEmptyTab == true- if mode == .editURL || fillsEmptyPane, selectedTabID != nil {+ // A pinned tab keeps to its host: another host's address opens a Today tab (Arc).+ let leavesPinned = !fillsEmptyPane && selectedTabID.map(store.isPinned) == true+ && PinnedNavigation.typedURLOpensNewTab(url, from: selectedTab?.tab?.url ?? "")+ if mode == .editURL || fillsEmptyPane, selectedTabID != nil, !leavesPinned {loadInSelectedTab(url)} else {store.createTab(url: url, window: windowID)diff --git a/Tests/Snapshots/new-tab-row.png b/Tests/Snapshots/new-tab-row.pngindex 6b5e27c..449c198 100644Binary files a/Tests/Snapshots/new-tab-row.png and b/Tests/Snapshots/new-tab-row.png differdiff --git a/Tests/Snapshots/pinned-folder.png b/Tests/Snapshots/pinned-folder.pngindex f62b199..788c546 100644Binary files a/Tests/Snapshots/pinned-folder.png and b/Tests/Snapshots/pinned-folder.png differdiff --git a/Tests/Snapshots/split-row.png b/Tests/Snapshots/split-row.pngindex 28f82a9..11cbd0a 100644Binary files a/Tests/Snapshots/split-row.png and b/Tests/Snapshots/split-row.png differdiff --git a/Tests/Snapshots/today-tab-row.png b/Tests/Snapshots/today-tab-row.pngindex 81f8623..d6081a4 100644Binary files a/Tests/Snapshots/today-tab-row.png and b/Tests/Snapshots/today-tab-row.png differdiff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.mdindex 6d745a6..649694d 100644--- a/docs/arc-reverse-engineering.md+++ b/docs/arc-reverse-engineering.md@@ -150,8 +150,8 @@ Legend: [O] observed in shipped artifact or data file, [I] inference, [U] unknow- [O] Sidebar 328pt wide. Row 1: traffic lights, sidebar toggle right after them (~93pt), nav ← → ↻ right-aligned when atab is selected and the toolbar shows the URL; with no tab the nav moves into the toolbar and the toolbar shows acentered "Search or Enter URL…". Favorites: 4 tiles, ~44pt tall, active tile gets a dashed outline. Space header: emoji +- name, 13pt semibold (re-fitted 1 Nov), secondary color. Rows 40pt pitch, 14pt titles, 16pt favicons, custom-titled/navigated pinned tabs show- the host as an 11pt second line, folders use a blue folder glyph, nested rows indent ~18pt. Bottom row: library icon+ name, 13pt semibold (re-fitted 1 Nov), secondary color. Rows 40pt pitch, 14pt titles, 16pt favicons, a site in developer mode shows its host+ as an 11pt second line (see "A pinned tab away from its page"), folders use a blue folder glyph, nested rows indent 16 pt (measured 3 Nov, #139). Bottom row: library iconleft, tiny space emoji centered (inactive dimmed), + right.- [O] Content: rounded card inset ~8-10pt with the toolbar strip (42pt: lock + monospaced URL, copy link, extensions,capture, DevTools, sidebar toggle) on top; no card at all when no tab is selected.@@ -239,9 +239,9 @@ keyboard-focus indicator, shown on a tab chosen without the mouse, never on clicRe-measured 29 Oct (issue #12, ScreenCaptureKit frames every ~60 ms): an AppleScript selectof a tab in another space switched the space and drew the ring ~0.4 s later, still there2.5 s on; a select within the shown space drew none. Cra rings only a tab switcher pick-that changed space; next/previous tab and ⌘1–9 stay in the space and show no ring. Host subtitles under pinned-tabs appear only when the tab left the pinned host (Phantom at /signin shows none); the-"Ahrefs / ahrefs.com" row in Arc stays unexplained (same host, same URL, loaded).+that changed space; next/previous tab and ⌘1–9 stay in the space and show no ring. Host subtitles: wrongly read+here as "a pinned tab that left its host"; Arc's code (3 Nov, #139) shows the host only for a site in+developer mode, and ahrefs.com is in Victor's StorableDeveloperModeState.json.### DevTools docking (CEF 154 note)@@ -1013,6 +1013,80 @@ of the sidebar strip, pixel runs at x=500 px (2x), y = 160/700/1200/1700/2100.step with the hit-testing, so later clicks landed on other rows. In Cra, `cliclick c:` is too fast forthe row's SwiftUI tap; `dd: w:80 du:` selects.+### A pinned tab away from its page (Arc 1.171, 3 Nov 2026, GitHub #139, field metadata + disassembly)+- [O static] `TabCellView` has no reset button. Its fields include `iconContainerView`, `_slashView`,+ `_regionHoverState: RegionHoverState<BackgroundRegion>?` (region `icon | body`, plus modifier flags) and+ `_hoverSubtitleState: HoverSubtitleState?` (`reset | resetAndSeparate`, strings "Back to Pinned URL" and+ "Separate From Pinned Tab"). `TabCellState` carries `canResetTab`, `resetTabTitle`, `resetTabIcon` and+ `resetItemShortcut`, so Arc keeps the pinned page's own name and icon next to the current page's.+- [O static] `ARCUI.SlashView`: a 4 × 15 pt view, stroked from (1, 1) to (w − 1, h − 1) with a 2 pt line and+ round caps, in the `TabCellSlash` asset (black 30 % light, white 30 % dark, P3), with 4 pt after it.+ [O reporter, 2x screenshot] Favicon, 4 pt, the slash, 5 pt, the name (13 pt after the favicon, not 11).+- [I] Hovering the icon region shows "Back to Pinned URL" as the subtitle, and a click there resets the tab.+ Not checked live: which modifier picks `resetAndSeparate`, and whether the icon region gets its own hover fill+ (`_regionalBackgroundView`).+- [O static] `SidebarUI.TabHighlightState`: `developerTab | tabCapturing | syncedTab`, drawn by+ `TabHighlightView` (in `CellSelectionStateView`). It has two 2 pt layers on the bounds inset by 1 pt with a radius+ of 11. For `developerTab` they are systemYellow under black dashes at 80 % opacity, and each dash is the+ perimeter ÷ 60 / 80 / 100 (width < 210 / < 346 / larger). `tabCapturing` is solid yellow, `syncedTab` is+ rgb(0.901, 0.631, 0.827).+- [O static] `TabCellState.subtitle` (built in `TabCellState.init`, first match wins): the host (+ `:port`)+ when developer mode is on for the page; "Double-click to rename" for the rename-hint item; a GitHub live+ folder item's subtitle; else none. `titleSourceInfo` and leaving the pinned URL never set it. Victor's+ "Ahrefs" row shows ahrefs.com because ahrefs.com is in `StorableDeveloperModeState.json`.+- [O reporter, 2x screenshots] Nested rows: Arc's fill starts after the indent (24 pt for depth 1 against 5 pt+ at the top level), so a folder's gutter stays empty.+- Cra (TabRowView): the slash replaces the trailing ↩ button, and the icon region (the fill's edge to just past the+ slash) shows the hover subtitle and resets on click. `TabData.homeTitle` keeps the pinned page's title, and+ going back restores that title and the home's favicon key. The developer ring is `FocusRingLayer(developer:)` on+ the open tab. Each row's fill starts `depth × 18` pt in (23 pt against Arc's 24). The capturing and synced+ rings are not built.++### Closing and pinned tabs, recorded (Arc 1.171, 3 Nov 2026, GitHub #139)+Offline Arc on a fake home (scratch tools: fake-home generator, `sandbox-exec` allowing only loopback, pages on+`pin.lvh.me` / `away.lvh.me` / `dev.lvh.me` port 47139 served locally; `localhost` is developer mode by itself,+so test pages must not use it). Live HID clicks and hovers at 1x, plus a static pass over TabCellState.+- [O live] Close button per row, shown only while the row is hovered (24 pt square, hover square GrayA4,+ radius 6, 6 pt before the fill's right end; glyph two 14 × 2 pt bars, crossed or flat):++ | Row | Glyph | Tooltip | Click |+ |---|---|---|---|+ | Pinned, open | minus | Close and Keep Pinned ⌘W | unloads, back to its pinned page (name and icon too), the tab before it opens |+ | Pinned, background, away from its page | minus | Close and Keep Pinned | back to its pinned page, unloads; selection stays |+ | Pinned, background, on its page (loaded or not) | ✕ | Archive this tab | archived out of the pinned section |+ | Pinned, shown under a closed folder [O static] | minus | Close and Keep Pinned | as above |+ | Today, open | ✕ | Archive this tab ⌘W | archived; the tab below opens |+ | Today, background (loaded or not) | ✕ | Archive this tab | archived |+ | Picked with others | its own button | singular tooltip | acts on that row only |+ | Favorite tile | none | — | ⌘W deselects it, the tab before it opens |+ | Pinned split, open | one minus at the row's end | Close this item ⌘W | the whole split unloads, stays pinned |+ | Pinned split, background | one ✕ at the row's end | Archive this item | the whole split is archived |+ | Today split, open | an ✕ inside every pane | Archive this item | that pane is archived, the split becomes a tab |+ | Today split, background | one ✕ at the row's end | Archive this item | the whole split is archived |++- [O live] ⌘W on several picked tabs closes them all; [O static] a Today tab among them archives every one,+ otherwise they all deselect. The ⌘W keycaps only show on the open row's tooltip.+- [O live] Split cells: 4 pt inside the fill, 4 pt apart, each favicon 6 pt into its cell. An open split draws+ each pane as a 28 pt pill (4 pt inset top and bottom, radius ~6, 224 on the 241 fill, light theme); a hovered+ pinned split shortens its last pill to end 5 pt before the minus.+- [O live] A pinned tab away from its page: current favicon, slash, current title, nothing under it. Its hover+ splits in two: the icon region (a 36 pt rounded square at the fill's left) and the body (the fill from 30 pt+ in to its end). On the icon: the pinned page's favicon (resetTabIcon) replaces the icon, the slash and the close+ button hide, "Back to Pinned URL" shows under the title; with ⌘ held, the current favicon and "Separate From+ Pinned Tab". On the body of a background row: its own fill, the slash hides, the button shows. On the open row+ the icon square darkens over the white fill (241 → 230), left corners round, right edge straight.+ Click on the icon: the tab goes back to its pinned page (a navigation: Back works) and opens. ⌘-click: the+ current page moves to a new Today tab at the top of Today, the pinned tab goes back and stays open.+- [O live] A typed address (⌘L, Enter) on a pinned tab: another host opens a new Today tab (pin.lvh.me →+ away.lvh.me did, so it is the host, not the site), the same host stays in the pinned tab. A same-host link+ stays; another host's link opens Peek, with the peeked page's favicon as a badge on the pinned row.+- [O live] ⌘W on an open Today split archives only the focused pane (the other becomes a tab). ⌘-click picks a+ tab without opening it; the open tab is part of the selection, so ⌘W takes it too.+- [O live] Developer mode: the host and port under the title on every row of that site, the dashed ring only+ on the open one. Nested rows indent 16 pt (favicon 26 → 42, text 45 → 61) and their fill starts after it.+- [O live, 100 fps] The minus makes the row jump to scale 0.9 at once and spring back to 1 in ~0.24 s without+ overshoot (left edge 10 px in at 1x, back by 1.11 s): a critically damped spring, ω ≈ 14 (stiffness 196, damping 28).+### Backdrop-layer blur for light vibrant themes (25 Oct 2026, final)The system materials could not reproduce Arc's intercept and slope together, so