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.
Arc parity: the sidebar's ⌘S motion, measured again in Arc 1.172.1
Victorba0bd0fb7788
diff --git a/Packages/CraCore/Sources/CraCore/SidebarMotion.swift b/Packages/CraCore/Sources/CraCore/SidebarMotion.swiftnew file mode 100644index 0000000..497e2c2--- /dev/null+++ b/Packages/CraCore/Sources/CraCore/SidebarMotion.swift@@ -0,0 +1,24 @@+import Foundation++/// How the sidebar hides and comes back on ⌘S (Arc 1.172.1, Victor's Arc, 8 Nov 2026, recorded with+/// `screencapture -V` at 60 fps, four runs): the page's edge covers 42–44 %, 71–73 %, 89 %, 97–98 % of its+/// travel after frames 1–4 when hiding, 25–35 %, 66–72 %, 86–92 %, 96–99 % when showing, done in about+/// 5 frames. Arc 1.170 recorded with ffmpeg (66/87/96/99 %) had dropped the first frames.+public enum SidebarMotion {+ public static let duration: TimeInterval = 0.085+ /// The cubic Bézier's control points (CAMediaTimingFunction), fitted to those frames.+ public static let curve: (Double, Double, Double, Double) = (0.3, 0.7, 0.5, 1)++ /// The share of the travel done `t` seconds in.+ public static func progress(at t: TimeInterval, curve c: (Double, Double, Double, Double) = curve, duration: TimeInterval = duration) -> Double {+ let x = min(1, max(0, t / duration))+ var lo = 0.0, hi = 1.0+ for _ in 0..<50 {+ let s = (lo + hi) / 2+ let bx = 3 * (1 - s) * (1 - s) * s * c.0 + 3 * (1 - s) * s * s * c.2 + s * s * s+ if bx < x { lo = s } else { hi = s }+ }+ let s = (lo + hi) / 2+ return 3 * (1 - s) * (1 - s) * s * c.1 + 3 * (1 - s) * s * s * c.3 + s * s * s+ }+}diff --git a/Packages/CraCore/Tests/CraCoreTests/SidebarMotionTests.swift b/Packages/CraCore/Tests/CraCoreTests/SidebarMotionTests.swiftnew file mode 100644index 0000000..99f2d13--- /dev/null+++ b/Packages/CraCore/Tests/CraCoreTests/SidebarMotionTests.swift@@ -0,0 +1,33 @@+import CraCore+import Foundation+import Testing++/// The sidebar's ⌘S motion against Arc 1.172.1's frames (8 Nov 2026).+struct SidebarMotionTests {+ /// Arc's hide and show, the share of the travel after each 60 fps frame.+ static let arc: [[Double]] = [[0.43, 0.72, 0.89, 0.975, 1], [0.42, 0.71, 0.89, 0.97, 1], [0.35, 0.67, 0.86, 0.96, 1], [0.34, 0.66, 0.92, 0.99, 1]]++ /// Each run, at the best of ten sub-frame phases (when the animation began within its first frame).+ static func error(_ curve: (Double, Double, Double, Double)) -> Double {+ arc.map { run in+ (1...10).map { Double($0) / 600 }.map { phase in+ run.enumerated().map { k, v in+ let p = SidebarMotion.progress(at: phase + Double(k) / 60, curve: curve)+ return (p - v) * (p - v)+ }.reduce(0, +)+ }.min()!+ }.reduce(0, +)+ }++ @Test func followsArcsFrames() {+ #expect(Self.error(SidebarMotion.curve) < 0.006)+ // The Arc 1.170 fit runs well ahead of Arc 1.172.1 in the first frames.+ #expect(Self.error((0.15, 0.7, 0.3, 1)) > 0.02)+ }++ @Test func endsInFiveFrames() {+ #expect(SidebarMotion.progress(at: 0) < 1e-9)+ #expect(SidebarMotion.progress(at: 5.0 / 60) > 0.97)+ #expect(SidebarMotion.progress(at: 1) > 1 - 1e-9)+ }+}diff --git a/Sources/Cra/UI/ShellView.swift b/Sources/Cra/UI/ShellView.swiftindex c9aefc1..884a9a5 100644--- a/Sources/Cra/UI/ShellView.swift+++ b/Sources/Cra/UI/ShellView.swift@@ -828,7 +828,7 @@ final class ShellView: NSView {layoutSubtreeIfNeeded()}- func animateSidebar(visible: Bool, floating: Bool, fullscreen: Bool, width: CGFloat, duration: TimeInterval = 0.085) {+ func animateSidebar(visible: Bool, floating: Bool, fullscreen: Bool, width: CGFloat, duration: TimeInterval = SidebarMotion.duration) {let target = frames(sidebarVisible: visible, floating: floating, fullscreen: fullscreen, width: width)// Size the pages for their destination once, up front; the cards then just slide over them.let targetLayout = paneLayout(in: NSRect(origin: .zero, size: target.content.size))@@ -843,10 +843,10 @@ final class ShellView: NSView {}layoutContentChildren()animatingFrames = true- // Fast start, soft landing: feels immediate without a visible snap.- // Fitted to Arc 1.170's ⌘S hide at 60 fps: 66 / 87 / 96 / 99 % of the travel after- // frames 1–4 (card edge 568 → 204 → 90 → 42 → 24 → 20 px).- let timing = CAMediaTimingFunction(controlPoints: 0.15, 0.7, 0.3, 1)+ // Arc 1.172.1's ⌘S at 60 fps (CraCore SidebarMotion): about 43 / 72 / 89 / 97 % of the travel+ // after frames 1–4.+ let c = SidebarMotion.curve+ let timing = CAMediaTimingFunction(controlPoints: Float(c.0), Float(c.1), Float(c.2), Float(c.3))onAnimatePaneFrames?(webTargets, duration, timing)NSAnimationContext.runAnimationGroup { ctx inctx.duration = durationdiff --git a/docs/arc-parity.md b/docs/arc-parity.mdindex d20671f..26d60c7 100644--- a/docs/arc-parity.md+++ b/docs/arc-parity.md@@ -101,7 +101,15 @@ gains "New Profile".matches after this sweep (it had no opening animation and resized with AppKit's default). Arc's codeheader is only Back and a centred CSS / JS switch; Cra had the boost's name and Undo there too.-Not re-measured in this sweep: earlier sessions measured the sidebar, command bar, split view,+- Sidebar ⌘S, 8 Nov 2026, `screencapture -V` at 60 fps, four Arc runs and two of Cra each way (SidebarMotion): Arc's+ page edge covers about 43 / 72 / 89 / 97 % of its travel after frames 1–4 hiding and 30 / 69 / 89 / 97 % showing,+ done in 5 frames. Cra ran ahead (67 / 87 / 96 / 99 %, fitted to an ffmpeg recording that had dropped Arc's first+ frames); now 0.085 s on (0.3, 0.7, 0.5, 1), measured 23–48 / 60 / 83–85 / 96–98 % hiding and 30–47 / 65–76 /+ 86–92 / 96–98 % showing. ffmpeg's avfoundation capture misses window moves; `screencapture -V` doesn't.++- Previews cards, 8 Nov 2026: see "Previews, measured".++Not re-measured in this sweep: earlier sessions measured the command bar, split view,Peek, Little Arc, PiP, folders, space dock, Library swipe, dialogs, toasts and toolbar against Arc(docs/arc-reverse-engineering.md). New surfaces built from this list are matched to captures takenin this sweep (Essential Shortcuts window, Library pages).