Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Back to display-rate Mochi (reverts #551)

Claude61ee8df17b40
diff --git a/NotchBuddy/Sources/App/BotCanvasView.swift b/NotchBuddy/Sources/App/BotCanvasView.swift
index b2d2e626..bc357767 100644
--- a/NotchBuddy/Sources/App/BotCanvasView.swift
+++ b/NotchBuddy/Sources/App/BotCanvasView.swift
@@ -16,11 +16,9 @@ struct BotCanvasView: View {
@StateObject private var engine = BotEngine()
var body: some View {
- // 60 fps: every frame on a 60 Hz screen, one in two on ProMotion (120 Hz drew the
- // notch twice as often for no visible gain and doubled the CPU and WindowServer cost).
- // MochiFrameClock.advance runs the skipped steps, so Mochi's speed never changes.
- TimelineView(.animation(minimumInterval: MochiFrameClock.interval(fps: 60),
- paused: state.mode == .hidden || paused)) { timeline in
+ // Display refresh rate — every frame on a 60 Hz screen, every frame on ProMotion.
+ // MochiFrameClock.advance accumulates the step debt so Mochi's speed never changes.
+ TimelineView(.animation(paused: state.mode == .hidden || paused)) { timeline in
// The Canvas must capture the frame's date: a closure that doesn't change from
// one tick to the next is not redrawn, and Mochi froze.
let frame = timeline.date
@@ -247,9 +245,8 @@ struct MiniBotCanvasView: View {
var body: some View {
- // 60 fps like the main Mochi. Paused in island views that are not shown.
- TimelineView(.animation(minimumInterval: MochiFrameClock.interval(fps: 60),
- paused: !viewActive)) { timeline in
+ // Display refresh rate. Paused in island views that are not shown.
+ TimelineView(.animation(paused: !viewActive)) { timeline in
let frame = timeline.date // see BotCanvasView: redraw on every tick
Canvas { context, size in
_ = frame
diff --git a/NotchBuddy/Sources/App/DesktopMochi.swift b/NotchBuddy/Sources/App/DesktopMochi.swift
index fd1c3c34..71cbe8f9 100644
--- a/NotchBuddy/Sources/App/DesktopMochi.swift
+++ b/NotchBuddy/Sources/App/DesktopMochi.swift
@@ -27,9 +27,7 @@ struct DesktopBotView: View {
@ObservedObject var viewState: DesktopBotViewState
var body: some View {
- // 60 fps like the notch Mochi (see BotCanvasView).
- TimelineView(.animation(minimumInterval: MochiFrameClock.interval(fps: 60),
- paused: viewState.paused)) { timeline in
+ TimelineView(.animation(paused: viewState.paused)) { timeline in
Canvas { ctx, size in
_ = timeline.date // force redraw every tick (see BotCanvasView)
diff --git a/NotchBuddy/Sources/App/IslandViewContent.swift b/NotchBuddy/Sources/App/IslandViewContent.swift
index 141fa94c..eda4d70d 100644
--- a/NotchBuddy/Sources/App/IslandViewContent.swift
+++ b/NotchBuddy/Sources/App/IslandViewContent.swift
@@ -3841,9 +3841,8 @@ struct TickerShimmerText: View {
@Environment(\.islandViewActive) private var viewActive
var body: some View {
- // A 2.2 s sweep at 60 fps. Paused when hidden.
- TimelineView(.animation(minimumInterval: MochiFrameClock.interval(fps: 60),
- paused: paused || !viewActive)) { tl in
+ // A 2.2 s sweep at display refresh rate. Paused when hidden.
+ TimelineView(.animation(paused: paused || !viewActive)) { tl in
let t = tl.date.timeIntervalSinceReferenceDate
let p = CGFloat(t.truncatingRemainder(dividingBy: 2.2) / 2.2)
// phase sweeps -0.1 → 1.1 so white peak enters from left and exits right