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.

Mochi follows the pointer again; optimized Swift in the DebugCloud run build

Claude5133de2de21f
diff --git a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
index fd752551..89ec9d01 100644
--- a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
+++ b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
@@ -1759,6 +1759,7 @@
PRODUCT_NAME = Coucou;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG PHONE_LINK";
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
};
name = DebugCloud;
};
diff --git a/NotchBuddy/Sources/App/BotCanvasView.swift b/NotchBuddy/Sources/App/BotCanvasView.swift
index 627ab8a8..ee9b2e30 100644
--- a/NotchBuddy/Sources/App/BotCanvasView.swift
+++ b/NotchBuddy/Sources/App/BotCanvasView.swift
@@ -20,8 +20,12 @@ struct BotCanvasView: View {
// 0.05 step per display frame (MochiFrameClock), so the motion is the same as at
// the display rate, with half to a quarter of the drawing.
TimelineView(.animation(minimumInterval: state.mode == .expanded ? 1.0 / 60.0 : 1.0 / 30.0,
- paused: state.mode == .hidden || paused)) { _ in
+ 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
Canvas { context, size in
+ _ = frame
let look = lookXY(state: state)
engine.lookX = look.x
engine.lookY = look.y
@@ -238,8 +242,10 @@ struct MiniBotCanvasView: View {
var body: some View {
// A 12–20 pt Mochi: 30 fps looks the same as the display rate and costs a quarter
// on ProMotion. Paused in island views that are not shown.
- TimelineView(.animation(minimumInterval: 1.0 / 30.0, paused: !viewActive)) { _ in
+ TimelineView(.animation(minimumInterval: 1.0 / 30.0, paused: !viewActive)) { timeline in
+ let frame = timeline.date // see BotCanvasView: redraw on every tick
Canvas { context, size in
+ _ = frame
engine.setDancing(isDancing)
MochiFrameClock.advance(engine)
var ctx = context
diff --git a/NotchBuddy/project.yml b/NotchBuddy/project.yml
index 3cdd969e..4e37bcc2 100644
--- a/NotchBuddy/project.yml
+++ b/NotchBuddy/project.yml
@@ -165,6 +165,9 @@ targets:
DebugCloud:
CODE_SIGN_ENTITLEMENTS: Resources/CoucouCloud.entitlements
SWIFT_ACTIVE_COMPILATION_CONDITIONS: "DEBUG PHONE_LINK"
+ # The build run every day from Xcode: optimized like Release, so Mochi's
+ # drawing costs what it costs for users (unoptimized Swift was ~2× the CPU).
+ SWIFT_OPTIMIZATION_LEVEL: "-O"
# The distributed build carries the iPhone sync (off until the user
# turns it on in Settings), so it needs iCloud and its Developer ID profile.
Release: