Skip to content

armgit / cra

Public Imported from GitHub
0

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.

Split panes keep their bars with the toolbar hidden, cards cast Arc's shadow, and the ring shows over DevTools

Victorab1baa36d79d
diff --git a/Packages/CraCore/Sources/CraCore/ToolbarExtensionFit.swift b/Packages/CraCore/Sources/CraCore/ToolbarExtensionFit.swift
index 55817cb..b8de25b 100644
--- a/Packages/CraCore/Sources/CraCore/ToolbarExtensionFit.swift
+++ b/Packages/CraCore/Sources/CraCore/ToolbarExtensionFit.swift
@@ -19,12 +19,12 @@ public enum ToolbarExtensionFit {
}
/// What a narrow toolbar leaves out so the address keeps room, after Arc 1.171's `…HasRoom`
-/// flags (`numberOfExtensionsThatFit`, `refreshHasRoom`, `settingsHasRoom`). Measured live on a
-/// split (GitHub #178, 4 Nov 2026): a 387 pt pane keeps ↻ with the address whole; at 350 pt ↻
-/// is gone, the domain is cut short and the Site Control Center stays; at 215 pt (Arc 1.170,
-/// 24 Oct) the sliders are gone too. So the pins go first, from the front; then ↻ while the
-/// address still doesn't fit whole; the sliders only once the address would be squeezed below
-/// `minimum`.
+/// flags (`numberOfExtensionsThatFit`, `refreshHasRoom`, `settingsHasRoom`). Measured live on
+/// two- and three-pane splits (GitHub #178, 4 Nov 2026): ↻ stays at 387–392 pt panes and is gone
+/// at 350–359 pt, with the domain cut short; the Site Control Center stays down to 325 pt and is
+/// gone at 292 pt (and at 215 pt, Arc 1.170). So the pins go first, from the front; then ↻ while
+/// the address still doesn't fit whole; the sliders only once the address would be squeezed
+/// below `minimum`.
public enum ToolbarRoom {
public struct Plan: Equatable, Sendable {
public var hiddenPins: Int
@@ -36,8 +36,9 @@ public enum ToolbarRoom {
}
}
- /// Between Arc's two narrow observations: room for the link glyph and a few letters.
- public static let minimumAddress: CGFloat = 80
+ /// Cra's address room at Arc's last pane with the sliders (325 pt: 114) and its first without
+ /// (292 pt: 82), split down the middle.
+ public static let minimumAddress: CGFloat = 100
/// `room`: the address's space with every button shown; each hidden button adds its width.
/// `reload` / `settings`: those buttons' widths, nil when the bar has none.
diff --git a/Packages/CraCore/Tests/CraCoreTests/ToolbarExtensionFitTests.swift b/Packages/CraCore/Tests/CraCoreTests/ToolbarExtensionFitTests.swift
index 26c75b4..0af6929 100644
--- a/Packages/CraCore/Tests/CraCoreTests/ToolbarExtensionFitTests.swift
+++ b/Packages/CraCore/Tests/CraCoreTests/ToolbarExtensionFitTests.swift
@@ -53,8 +53,12 @@ struct ToolbarRoomTests {
// A 215 pt pane (Arc 1.170): ← → · options · ✕ and the address only.
#expect(ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: 150, room: 0)
== .init(hidesReload: true, hidesSettings: true))
- #expect(ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: 150, room: 50)
+ #expect(ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: 150, room: 70)
== .init(hidesReload: true))
+ // Arc's 3-pane split: a 325 pt pane keeps the sliders (114 pt of address room in Cra's
+ // bar), a 292 pt one doesn't (82 pt).
+ #expect(!ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: 150, room: 114 - 37).hidesSettings)
+ #expect(ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: 150, room: 82 - 37).hidesSettings)
}
@Test func aShortAddressNeverCostsTheSliders() {
diff --git a/Sources/Cra/UI/PaneToolbarView.swift b/Sources/Cra/UI/PaneToolbarView.swift
index 279d5f9..b6cc132 100644
--- a/Sources/Cra/UI/PaneToolbarView.swift
+++ b/Sources/Cra/UI/PaneToolbarView.swift
@@ -377,6 +377,17 @@ final class PaneToolbarView: NSView {
let pins = trailing.filter { v in m.pinned.contains { buttons["ext:" + $0.id] === v } }
let reload = left.first { $0 === buttons["reload"] }
let settings = trailing.first { $0 === buttons["extensions"] }
+ // The copy glyph goes in every pane at the width where a focused pane loses its sliders
+ // (Arc, 3-pane split): judged on that pane's full set, so all panes of a width agree.
+ var showsCopy = true
+ if m.kind == .normal {
+ let fullLeft: CGFloat = 2.5 + 3 * 37 + 6
+ let fullRight: CGFloat = (m.inSplit ? 4 + 30 + 26 : 6 + 34) + 34 + 6
+ let fullRoom = w - fullLeft - fullRight - 2 * (8 + 6)
+ showsCopy = !ToolbarRoom.plan(pins: [], reload: 37, settings: 34, needed: urlButton.idealWidth(withCopy: true),
+ room: fullRoom).hidesSettings
+ }
+ urlButton.showsCopy = showsCopy
var plan = ToolbarRoom.Plan()
if m.kind == .normal {
let start: CGFloat = 2.5
@@ -676,6 +687,15 @@ final class ToolbarURLButton: NSView, NSTextFieldDelegate {
/// own pill, 24 pt tall, starting 20 pt in with the text 7 pt inside it. Each has its own hover;
/// the pointer picks one where they meet. The developer bar is one piece.
private var split = false
+ /// Arc drops the copy glyph in a narrow pane, at the width where the sliders go (GitHub #178).
+ var showsCopy = true {
+ didSet {
+ guard showsCopy != oldValue else { return }
+ for v in [icon, copyFill, copyTip] as [NSView] { v.isHidden = !showsCopy || (v === copyTip && !split) }
+ needsLayout = true
+ }
+ }
+ private var lead: CGFloat { showsCopy ? Self.pillStart : 0 }
private enum Region { case none, copy, address }
private var region = Region.none { didSet { if region != oldValue { refreshFill() } } }
private let copyFill = NSView()
@@ -718,9 +738,12 @@ final class ToolbarURLButton: NSView, NSTextFieldDelegate {
}
/// The text's natural width plus padding; the bar centres and clips the button to it.
- var idealWidth: CGFloat {
+ var idealWidth: CGFloat { idealWidth(withCopy: showsCopy) }
+
+ func idealWidth(withCopy: Bool) -> CGFloat {
let text = label.attributedStringValue.size().width
- return ceil(split ? Self.textStart + text + Self.pillPad : 10 + iconWidth + 7 + text + 10)
+ let start = Self.textStart - (withCopy ? 0 : Self.pillStart)
+ return ceil(split ? start + text + Self.pillPad : 10 + iconWidth + 7 + text + 10)
}
/// The glyph's own width, as SwiftUI lays an Image out; developer mode boxes it at 14 pt.
@@ -732,7 +755,7 @@ final class ToolbarURLButton: NSView, NSTextFieldDelegate {
self.hover = hover
self.copyHover = copyHover
split = !developer
- copyTip.isHidden = !split
+ copyTip.isHidden = !split || !showsCopy
self.url = url
ink = fg
field?.textColor = fg
@@ -761,13 +784,14 @@ final class ToolbarURLButton: NSView, NSTextFieldDelegate {
if split {
let box = Self.copyBox, y = (h - box) / 2
copyFill.frame = NSRect(x: 0, y: y, width: box, height: box)
- addressFill.frame = NSRect(x: Self.pillStart, y: y, width: max(0, bounds.width - Self.pillStart), height: box)
+ addressFill.frame = NSRect(x: lead, y: y, width: max(0, bounds.width - lead), height: box)
icon.frame = NSRect(x: 0, y: 0, width: box, height: h)
let lh = label.intrinsicContentSize.height
- label.frame = NSRect(x: Self.textStart - SidebarText.inset, y: (h - lh) / 2,
- width: max(0, bounds.width - Self.textStart - Self.pillPad) + 2 * SidebarText.inset, height: lh)
- copyTip.frame = NSRect(x: 0, y: 0, width: Self.pillStart, height: h)
- tip.frame = NSRect(x: Self.pillStart, y: 0, width: max(0, bounds.width - Self.pillStart), height: h)
+ let textStart = lead + Self.textStart - Self.pillStart
+ label.frame = NSRect(x: textStart - SidebarText.inset, y: (h - lh) / 2,
+ width: max(0, bounds.width - textStart - Self.pillPad) + 2 * SidebarText.inset, height: lh)
+ copyTip.frame = NSRect(x: 0, y: 0, width: lead, height: h)
+ tip.frame = NSRect(x: lead, y: 0, width: max(0, bounds.width - lead), height: h)
return
}
tip.frame = bounds
@@ -854,7 +878,7 @@ final class ToolbarURLButton: NSView, NSTextFieldDelegate {
private func region(at event: NSEvent) -> Region {
let p = convert(event.locationInWindow, from: nil)
guard bounds.contains(p) else { return .none }
- return split && p.x < Self.pillStart ? .copy : .address
+ return split && p.x < lead ? .copy : .address
}
override func updateTrackingAreas() {
diff --git a/Sources/Cra/UI/ShellView.swift b/Sources/Cra/UI/ShellView.swift
index 62def24..af92123 100644
--- a/Sources/Cra/UI/ShellView.swift
+++ b/Sources/Cra/UI/ShellView.swift
@@ -115,6 +115,10 @@ final class ShellView: NSView {
/// Settings ▸ "Pages fill the window edge to edge" (GitHub #24): no margin, square cards.
var edgeToEdge = false { didSet { needsLayout = true } }
var showToolbar = true { didSet { needsLayout = true } }
+ /// Whether the cards carry their bars. Arc keeps every pane's bar in a split even with the
+ /// toolbar hidden (View ▸ Show Toolbar is disabled while a split is open, GitHub #178).
+ var panesShowBars: Bool { barsShown(panes: paneCards.count, fullscreen: contentFullscreen) }
+ private func barsShown(panes: Int, fullscreen: Bool) -> Bool { !fullscreen && (showToolbar || panes > 1) }
var hasTab = false { didSet { needsLayout = true } }
var onEdgeHover: ((Bool) -> Void)?
/// Set again each time the window becomes key; only a change rebuilds the backdrop.
@@ -374,7 +378,7 @@ final class ShellView: NSView {
card.pageColor = pageColors[id]
card.toolbarColor = toolbarColors[id]
card.transparent = id == ShellView.noTabID
- card.showToolbar = showToolbar && !contentFullscreen
+ card.showToolbar = barsShown(panes: shownIDs.count, fullscreen: contentFullscreen)
card.onToolbarHeightChange = { [weak self] in self?.needsLayout = true }
contentContainer.addSubview(card, positioned: .below, relativeTo: placeholderHost)
cards.append(card)
@@ -473,7 +477,7 @@ final class ShellView: NSView {
var out: [UUID: NSRect] = [:]
for c in paneCards where c.tabID != ShellView.noTabID {
guard let f = layout.frames[c.tabID] else { continue }
- let th: CGFloat = (showToolbar && !contentFullscreen) ? c.toolbarHeight : 0
+ let th: CGFloat = panesShowBars ? c.toolbarHeight : 0
var web = NSRect(x: f.minX, y: f.minY, width: f.width, height: max(0, f.height - th))
if c.tabID == focusedPaneID, devToolsVisible, !devToolsFrontendDocked, f.width > 640 {
web.size.width -= min(max(320, devToolsWidth), f.width * 0.7)
@@ -651,10 +655,12 @@ final class ShellView: NSView {
func layoutContentChildren(animated: Bool = false) {
let cb = contentContainer.bounds
updateFocusRings()
- let toolbarVisible = showToolbar && !contentFullscreen
+ let toolbarVisible = panesShowBars
let layout = paneLayout(in: cb)
for c in paneCards {
c.showToolbar = toolbarVisible
+ // Arc's cards cast a soft shadow on the window; edge to edge there is no margin for it.
+ c.castsShadow = !edgeToEdge && !contentFullscreen
// Several panes: every card is rounded; a single card follows the window state (square in fullscreen).
// Edge to edge every card is square.
c.cornerRadius = paneCards.count > 1 && !edgeToEdge ? CraMetrics.contentCornerRadius : cardCornerRadius
@@ -759,7 +765,7 @@ final class ShellView: NSView {
guard let f = targetLayout.frames[c.tabID] else { continue }
var w = f.width
if c.tabID == focusedPaneID, devToolsVisible, !devToolsFrontendDocked, f.width > 640 { w -= min(max(320, devToolsWidth), f.width * 0.7) }
- let toolbarH: CGFloat = (showToolbar && !fullscreen) ? c.toolbarHeight : 0
+ let toolbarH: CGFloat = barsShown(panes: paneCards.count, fullscreen: fullscreen) ? c.toolbarHeight : 0
c.frozenWebBounds = NSRect(x: 0, y: 0, width: w, height: max(0, f.height - toolbarH))
webTargets[c.tabID] = convert(NSRect(x: target.content.minX + f.minX, y: target.content.minY + f.minY, width: w, height: max(0, f.height - toolbarH)), to: nil)
}
diff --git a/Sources/Cra/UI/SplitView/PaneCardView.swift b/Sources/Cra/UI/SplitView/PaneCardView.swift
index 013b527..e9e4f11 100644
--- a/Sources/Cra/UI/SplitView/PaneCardView.swift
+++ b/Sources/Cra/UI/SplitView/PaneCardView.swift
@@ -40,10 +40,11 @@ final class PaneCardView: NSView {
layer?.cornerRadius = cornerRadius
ring.layer?.cornerRadius = cornerRadius
needsLayout = true
+ syncShadow()
}
}
/// White page card, or Arc's tinted translucent empty pane.
- var hasPage = true { didSet { refreshBackground() } }
+ var hasPage = true { didSet { refreshBackground(); syncShadow() } }
var isDark = false { didSet { refreshBackground() } }
/// The page's own background ("#RRGGBB"; Arc's canvas until it reports one). The page window
/// trails the card by a frame or more while the window is resized quickly, and a page that is
@@ -56,7 +57,7 @@ final class PaneCardView: NSView {
/// under a dark bar shows through the bar's anti-aliased left edge as a 1px light line.
var toolbarColor: String? { didSet { refreshBackground() } }
/// The no-tab stand-in: toolbar on the gradient, no card at all.
- var transparent = false { didSet { refreshBackground() } }
+ var transparent = false { didSet { refreshBackground(); syncShadow() } }
/// While a pane is being dragged open/closed its page keeps its last size.
var frozenWebBounds: NSRect?
/// The page is on screen in another window: Arc keeps the tab selected here and shows a
@@ -79,6 +80,34 @@ final class PaneCardView: NSView {
}
}
private let ring = FocusRingView()
+ /// Arc's shadow under a page card (GitHub #178): a sibling behind the card in its superview,
+ /// on the card's frame and alpha. Off for the empty and no-tab cards and square cards.
+ private let shadowView = CardShadowView()
+ var castsShadow = false { didSet { syncShadow() } }
+
+ override func viewDidMoveToSuperview() {
+ super.viewDidMoveToSuperview()
+ if let superview {
+ if shadowView.superview !== superview { superview.addSubview(shadowView, positioned: .below, relativeTo: self) }
+ } else {
+ shadowView.removeFromSuperview()
+ }
+ syncShadow()
+ }
+
+ override func setFrameOrigin(_ newOrigin: NSPoint) { super.setFrameOrigin(newOrigin); syncShadow() }
+ override func setFrameSize(_ newSize: NSSize) { super.setFrameSize(newSize); syncShadow() }
+ override var alphaValue: CGFloat { didSet { shadowView.alphaValue = alphaValue } }
+ override var isHidden: Bool { didSet { syncShadow() } }
+
+ private func syncShadow() {
+ let on = castsShadow && hasPage && !transparent && cornerRadius > 0 && !isHidden && superview != nil
+ shadowView.isHidden = !on
+ guard on else { return }
+ shadowView.cornerRadius = cornerRadius
+ let f = frame.insetBy(dx: -CardShadowView.pad, dy: -CardShadowView.pad)
+ if shadowView.frame != f { shadowView.frame = f }
+ }
/// The card shows another tab now (a tab switch with one pane before and after): the same
/// card and toolbar follow it.
@@ -191,7 +220,7 @@ final class PaneCardView: NSView {
/// A stroke along its bounds' rounded edge (the layer's border), drawn over the card's other
/// views. One static layer: a focus change recolours or hides it, nothing redraws per frame.
-private final class FocusRingView: NSView {
+final class FocusRingView: NSView {
override init(frame: NSRect) {
super.init(frame: frame)
wantsLayer = true
@@ -204,3 +233,71 @@ private final class FocusRingView: NSView {
/// Clicks go to the bar and the page under it.
override func hitTest(_ point: NSPoint) -> NSView? { nil }
}
+
+/// Arc's card shadow, fitted to its captures (Arc 1.171, light space, 2x, GitHub #178): a
+/// Gaussian edge of 26 % black, 3.6 pt sigma, 0.8 pt low. Core Graphics' blur came out softer and
+/// lighter than its nominal sigma (fitted on Cra's own capture), hence 31 % and a 6.5 pt blur. Drawn as a
+/// stretchable image, made once per corner radius and scale, so it costs nothing per frame and
+/// stretches with the card while its frame animates. The card's own area is cut out: a card
+/// whose page has not painted yet shows the window behind it, not the shadow.
+final class CardShadowView: NSView {
+ static let alpha: CGFloat = 0.31, blur: CGFloat = 6.5, drop: CGFloat = 0.8, sigma: CGFloat = 3.6
+ /// How far the shadow reaches past the card.
+ static let pad: CGFloat = ceil(3 * sigma + drop)
+ var cornerRadius: CGFloat = 0 { didSet { if cornerRadius != oldValue { refresh() } } }
+
+ override init(frame: NSRect) {
+ super.init(frame: frame)
+ wantsLayer = true
+ layer?.contentsGravity = .resize
+ }
+
+ required init?(coder: NSCoder) { fatalError() }
+
+ override func hitTest(_ point: NSPoint) -> NSView? { nil }
+ override func viewDidChangeBackingProperties() { super.viewDidChangeBackingProperties(); refresh() }
+
+ private func refresh() {
+ let scale = window?.backingScaleFactor ?? 2
+ guard let image = Self.image(radius: cornerRadius, scale: scale) else { layer?.contents = nil; return }
+ layer?.contents = image
+ layer?.contentsScale = scale
+ // The middle stretches: one point between the corners on each axis.
+ let side = CGFloat(image.width) / scale, mid = Self.pad + cornerRadius
+ layer?.contentsCenter = CGRect(x: mid / side, y: mid / side, width: 1 / side, height: 1 / side)
+ }
+
+ private static var cache: [String: CGImage] = [:]
+
+ private static func image(radius: CGFloat, scale: CGFloat) -> CGImage? {
+ let key = "\(radius)@\(scale)"
+ if let hit = cache[key] { return hit }
+ // The card is the middle (2·radius + 1 pt square), the shadow pad around it.
+ let card = 2 * radius + 1, side = card + 2 * pad
+ let px = Int(ceil(side * scale))
+ guard let ctx = CGContext(data: nil, width: px, height: px, bitsPerComponent: 8, bytesPerRow: 0,
+ space: CGColorSpace(name: CGColorSpace.sRGB)!, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)
+ else { return nil }
+ ctx.scaleBy(x: scale, y: scale)
+ let rect = CGRect(x: pad, y: pad, width: card, height: card)
+ let path = CGPath(roundedRect: rect, cornerWidth: radius, cornerHeight: radius, transform: nil)
+ // The blurred rect: Core Graphics' shadow of a shape drawn far off the canvas, so only its
+ // shadow lands.
+ let far: CGFloat = 10_000
+ ctx.saveGState()
+ ctx.setShadow(offset: CGSize(width: far * scale, height: -drop * scale), blur: blur * scale,
+ color: NSColor.black.withAlphaComponent(alpha).cgColor)
+ ctx.translateBy(x: -far, y: 0)
+ ctx.addPath(path)
+ ctx.setFillColor(NSColor.black.cgColor)
+ ctx.fillPath()
+ ctx.restoreGState()
+ // Cut the card out.
+ ctx.setBlendMode(.clear)
+ ctx.addPath(path)
+ ctx.fillPath()
+ let image = ctx.makeImage()
+ cache[key] = image
+ return image
+ }
+}
diff --git a/Sources/Cra/UI/Windows/MainWindowController.swift b/Sources/Cra/UI/Windows/MainWindowController.swift
index b3de90a..b04f69b 100644
--- a/Sources/Cra/UI/Windows/MainWindowController.swift
+++ b/Sources/Cra/UI/Windows/MainWindowController.swift
@@ -413,6 +413,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
browsers.show(live, focused: liveFocus, focus: !commandBar.isOpen)
}
shell.layoutContentChildren()
+ syncRingPanel()
syncSidebarUI()
window?.title = selectedTab?.displayTitle ?? space.title
@@ -684,6 +685,9 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
/// page gets its own panel just its size (the find bar).
private var overlayPanel: NSPanel?
private var findPanel: FindBarPanel?
+ /// The focused pane's ring while its page is in a window of its own (DevTools docked in it):
+ /// that window covers the card, and the card's ring with it (GitHub #178).
+ private var ringPanel: NSPanel?
/// Page area per visible tab, window coordinates (one entry per pane).
private var lastPaneFrames: [UUID: NSRect] = [:]
/// While a divider is dragged the page windows follow every mouse move.
@@ -712,10 +716,46 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
if overlay.findVisible { window.addChildWindow(find, ordered: .above) }
}
+ /// Shows the focused card's ring above its page window while that page is not in the card.
+ private func syncRingPanel() {
+ guard let window else { return }
+ let card = shell.focusedCard
+ let tab = browsers.visibleTabID
+ let host = tab.flatMap { browsers.runtime(for: $0)?.hostWindow }
+ let pageInOwnWindow = host.map { $0.isVisible && !EmbeddedPages.isHost($0) } ?? false
+ let devTools = tab.flatMap { browsers.visibleDevToolsWindows[$0] }?.isVisible ?? false
+ guard let card, let color = card.focusRing, card.window === window, pageInOwnWindow || devTools else {
+ if let panel = ringPanel, panel.parent != nil { window.removeChildWindow(panel); panel.orderOut(nil) }
+ return
+ }
+ let panel = ringPanel ?? {
+ let p = NSPanel(contentRect: .zero, styleMask: [.borderless, .nonactivatingPanel], backing: .buffered, defer: false)
+ p.isOpaque = false
+ p.backgroundColor = .clear
+ p.hasShadow = false
+ p.ignoresMouseEvents = true
+ p.hidesOnDeactivate = false
+ p.contentView = FocusRingView(frame: .zero)
+ ringPanel = p
+ return p
+ }()
+ let frame = window.convertToScreen(card.convert(card.bounds, to: nil))
+ if panel.frame != frame { panel.setFrame(frame, display: true) }
+ if let ring = panel.contentView {
+ ring.layer?.borderColor = color.cgColor
+ ring.layer?.cornerRadius = card.cornerRadius
+ }
+ if panel.parent == nil {
+ window.addChildWindow(panel, ordered: .above)
+ raiseOverlayPanels()
+ }
+ }
+
/// Overlay panel above the page windows (and the floating sidebar), the find bar above it.
private func raiseOverlayPanels() {
guard let window else { return }
var panels: [NSPanel?] = [overlayPanel]
+ if let ringPanel, ringPanel.parent != nil { panels.insert(ringPanel, at: 0) }
if overlay.findVisible { panels.append(findPanel) }
// A Peek (and its dimming) stays above everything else in the window.
let wanted = panels.compactMap { $0 } + peeks.flatMap(\.peekWindows)
@@ -806,6 +846,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
}
}
releaseUnfocusedEmbeddedPage()
+ syncRingPanel()
if browsers.visibleDevToolsWindows.values.contains(where: { $0.parent === window }) {
raisePageWindows()
} else {
@@ -918,6 +959,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
if shell.frontendPageRect != pr { shell.frontendPageRect = pr }
let focusOnScreen = window.convertToScreen(focusPage)
if let panel = overlayPanel, panel.frame != focusOnScreen { panel.setFrame(focusOnScreen, display: true) }
+ syncRingPanel()
if let find = findPanel, find.frame != findPanelFrame(page: focusOnScreen) { find.setFrame(findPanelFrame(page: focusOnScreen), display: true) }
}
@@ -1046,7 +1088,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
if abs(page.maxX - body.maxX) < 0.5 { corners.insert(bottomRight) }
}
// Without the toolbar the page's top edge is the card's top edge too.
- if !shell.contentFullscreen, !shell.showToolbar, abs(page.maxY - body.maxY) < 0.5 {
+ if !shell.contentFullscreen, !shell.panesShowBars, abs(page.maxY - body.maxY) < 0.5 {
if abs(page.minX - body.minX) < 0.5 { corners.insert(topLeft) }
if abs(page.maxX - body.maxX) < 0.5 { corners.insert(topRight) }
}
@@ -1188,7 +1230,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
let selfDock = browsers.runtime(for: tab)?.hostWindow != nil
let bottom: CACornerMask = cv.isFlipped ? [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] : [.layerMinXMinYCorner, .layerMaxXMinYCorner]
let all: CACornerMask = [.layerMinXMinYCorner, .layerMaxXMinYCorner, .layerMinXMaxYCorner, .layerMaxXMaxYCorner]
- layer.maskedCorners = selfDock ? (shell.showToolbar ? bottom : all) : [.layerMaxXMaxYCorner, .layerMaxXMinYCorner]
+ layer.maskedCorners = selfDock ? (shell.panesShowBars ? bottom : all) : [.layerMaxXMaxYCorner, .layerMaxXMinYCorner]
}
/// "Undock into separate window": the frontend's window becomes a floating window of its own.
@@ -2059,7 +2101,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
?? shell.convert(shell.contentContainer.frame, to: nil)
let onScreen = window.convertToScreen(card)
let bar = shell.focusedCard?.toolbarHeight ?? CraMetrics.toolbarHeight
- return (onScreen.maxY - (store.settings.showToolbar ? bar : 0), onScreen.maxX)
+ return (onScreen.maxY - (shell.panesShowBars ? bar : 0), onScreen.maxX)
}
/// Where a popup from a URL-bar button hangs: under the toolbar, or, with the toolbar
@@ -2077,7 +2119,7 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
/// toolbar at the card's right end.
fileprivate func extensionPopupAnchor(_ id: String) -> NSPoint? {
guard let bar = toolbarBottomOnScreen() else { return nil }
- if store.settings.showToolbar, let button = (shell.focusedCard?.toolbarHost as? PaneToolbarView)?.extensionButtonFrameOnScreen(id) {
+ if shell.panesShowBars, let button = (shell.focusedCard?.toolbarHost as? PaneToolbarView)?.extensionButtonFrameOnScreen(id) {
return NSPoint(x: button.maxX, y: bar.y)
}
return NSPoint(x: bar.cardMaxX - 8, y: bar.y)
@@ -2182,9 +2224,12 @@ final class MainWindowController: NSWindowController, NSWindowDelegate, BrowserM
/// Arc's sliders button (toolbar and URL pill): the Site Control Center, hung under the
/// button that was clicked (buttons are 32 × 28), not wherever the pointer is in it.
private func showToolbarExtensionsMenu() {
- guard let window, let content = window.contentView, let y = urlBarBottomOnScreen() else { return }
+ // A split pane's bar has the sliders even with the toolbar hidden: hang under that bar then.
+ let pressed = Self.buttonFrameUnderPointer { $0 is ToolbarGlyphButton }
+ guard let window, let content = window.contentView,
+ let y = pressed != nil && shell.panesShowBars ? toolbarBottomOnScreen()?.y : urlBarBottomOnScreen() else { return }
ExtensionStore.shared.reload()
- let midX = Self.buttonFrameUnderPointer { $0 is ToolbarGlyphButton || $0 is SidebarGlyphButton }?.midX ?? NSEvent.mouseLocation.x
+ let midX = (pressed ?? Self.buttonFrameUnderPointer { $0 is SidebarGlyphButton })?.midX ?? NSEvent.mouseLocation.x
// Arc's popover overlaps the bar by 4 pt (popover top 71 under a bar ending at 75).
let onScreen = NSRect(x: midX - 16, y: y + 4, width: 32, height: 28)
let rect = content.convert(window.convertFromScreen(onScreen), from: nil)
diff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.md
index facb4ab..4dc0678 100644
--- a/docs/arc-reverse-engineering.md
+++ b/docs/arc-reverse-engineering.md
@@ -765,12 +765,25 @@ descriptions and frames) at window widths 1400 → 926 (Arc's minimum), plus win
the ring) to it; the other pane drops back to the essentials.
- [O] Narrow: a 387 pt pane (window 1000) keeps everything; a ~350 pt pane (window 926) drops Reload, cuts the
domain short ("....lvh.me") and keeps the Site Control Center; a 215 pt pane (Arc 1.170, above) has neither.
+ A three-pane split pins it down: Reload at 392 pt, gone at 359; the Site Control Center at 325, gone at 292,
+ where every pane (focused or not) also loses its Copy Current URL glyph.
+- [O] Toolbar hidden (topBarURLEnabled NO, set before launch): a single pane has no bar; a split still shows every
+ pane's full bar and ring, and View ▸ Show Toolbar is disabled while the split is open (Hide Toolbar likewise
+ with the toolbar on). Arc forces the bars in a split.
+- [O] Card shadow, single card and every pane: fitted on 1-px profiles of all four sides (light space, 2x) as a
+ Gaussian edge, black 26 %, sigma 3.6 pt, 0.8 pt low; about 11 % darker beside the card, 17 % below, gone by
+ ~8 pt. Not on an empty pane (not measured).
- [O] Ring: 2 pt (4 px at 2x), solid, along the card's rounded edge and over the bar's edge, in the space's
`primaryColorPalette.shadedDark` (#6B5709 measured on Victor's yellow space, P3 capture; #B60222 vs Arc's stored
#B70021 on the reporter's red space). None on the unfocused pane or on a lone pane.
- Cra: ToolbarComposition (`hovered`, essentials only on an unfocused, unhovered pane), ToolbarRoom (pins, then ↻,
- then the sliders below an 80 pt address, a guess between the two narrow observations), PaneCardView.focusRing
- (theme.shadedDark). A control on an unfocused pane focuses it first, as Arc's Reload does.
+ then the sliders and the copy glyph below a 100 pt address: 114 pt at Arc's 325 pt pane, 82 at 292),
+ PaneCardView.focusRing (theme.shadedDark), and a ring panel over a page that lives in its own window (DevTools
+ docked). A control on an unfocused pane focuses it first, as Arc's Reload does. ShellView.panesShowBars keeps
+ the bars in a split with the toolbar hidden. CardShadowView: a 9-slice image, 31 % with a 6.5 pt Core
+ Graphics blur (CG's blur is softer than its nominal sigma; refitted on Cra's capture to within ~2 % of Arc's
+ profile per side). Pins before ↻ is from the non-split bar (ten pins, ↻ kept); the offline copy loads no
+ extensions (`--load-extension` is ignored).
### Pinned splits and the split menu (Arc 1.171, 30 Oct)
Observed live on a throwaway Today split (example.com | example.org), archived afterwards.