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.

Windows: the island could get stuck compact, and the upload dot lagged the bar

Louis Raillebde6dcd012fd
diff --git a/windows/src/core/layout.ts b/windows/src/core/layout.ts
index f89e02bc..2b5876cb 100644
--- a/windows/src/core/layout.ts
+++ b/windows/src/core/layout.ts
@@ -88,6 +88,24 @@ export const VIEW_LAYOUTS: Record<IslandViewName, ViewLayout> = {
greeting: { height: 150, botX: 320, botY: 90, botDiameter: 0, agentMode: "none" },
};
+/**
+ * Progress curve of the upload bar — `usProgressCurve` from
+ * UploadSequenceEngine.swift: quick to 60 %, an unhurried middle, then a last
+ * push. A plain ease-out reads as a different animation entirely.
+ */
+export function uploadProgressCurve(u: number): number {
+ const eOut = (t: number) => 1 - Math.pow(1 - t, 3);
+ const eIn = (t: number) => t * t * t;
+ const eInOut = (t: number) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);
+ if (u < 0.4) return 0.6 * eOut(u / 0.4);
+ if (u < 0.85) return 0.6 + 0.32 * eInOut((u - 0.4) / 0.45);
+ return 0.92 + 0.08 * eIn((u - 0.85) / 0.15);
+}
+
+/** While a file hovers the box, Mochi slides along under the cursor. */
+export const UPLOAD_FOLLOW_MIN = 60;
+export const UPLOAD_FOLLOW_MAX = 580;
+
/** Chat view grows with the conversation — IslandContainer.chatPromptHeight. */
export function chatPromptHeight(messageCount: number): number {
return Math.min(300, 240 + messageCount * 40);
diff --git a/windows/src/island/fsm.ts b/windows/src/island/fsm.ts
index e26e46a1..8a24545e 100644
--- a/windows/src/island/fsm.ts
+++ b/windows/src/island/fsm.ts
@@ -91,6 +91,12 @@ export class IslandStateMachine {
this.transition("home");
}
+ /// Explicit close (OK button, Escape, an alert being answered).
+ forcePetit() {
+ this.cancelTimers();
+ this.transition("petit");
+ }
+
forceHidden() {
this.cancelTimers();
this.transition("hidden");
diff --git a/windows/src/island/island.ts b/windows/src/island/island.ts
index 18073ac5..01695f6f 100644
--- a/windows/src/island/island.ts
+++ b/windows/src/island/island.ts
@@ -6,7 +6,8 @@ import { Bridge, IS_TAURI, onDragDrop } from "../core/bridge";
import {
EXPANDED_CORNER, EXPANDED_W, NOTCH_W, PANEL_H, PANEL_W,
ROUNDED_CORNER, VIEW_LAYOUTS, botGlowColor, botGlowOpacity, botPosition, chatPromptHeight,
- islandSize, type IslandMode, type IslandViewName,
+ islandSize, uploadProgressCurve, UPLOAD_FOLLOW_MIN, UPLOAD_FOLLOW_MAX,
+ type IslandMode, type IslandViewName,
} from "../core/layout";
import { Sound } from "../core/sound";
import { State } from "../core/state";
@@ -269,8 +270,10 @@ export class Island {
collapse() {
State.isPinned = false;
this.fsm.pinned = false;
- if (this.fsm.state === "home") this.fsm.mouseLeft();
- this.setMode("compact");
+ // Drive the state machine rather than the mode: setting the mode behind its
+ // back left it thinking the island was still open, and a click on the compact
+ // island then did nothing — the island could never be reopened.
+ this.fsm.forcePetit();
}
/** Alert from the hook server: open on this view. Pinned alerts never auto-close. */
@@ -357,7 +360,7 @@ export class Island {
private stepUpload(nowMs: number) {
if (State.uploadStartMs == null) return;
const t = Math.min(1, (nowMs - State.uploadStartMs) / 1000 / State.uploadDuration);
- State.uploadProgress = t * (2 - t);
+ State.uploadProgress = uploadProgressCurve(t);
const tick = Math.floor(State.uploadProgress * 10);
if (tick !== this.lastTick && tick < 10) {
this.lastTick = tick;
@@ -643,6 +646,17 @@ export class Island {
this.botCy.target = p.cy;
this.botSize.target = p.diameter / 0.6;
+ // While uploading, Mochi *is* the bar's cursor: a spring would always trail
+ // the fill. Follow the progress exactly, like the macOS TimelineView does.
+ if (State.view === "uploading" && State.uploadStartMs != null) {
+ this.botCx.set(p.cx);
+ }
+
+ // With a file hovering the box, Mochi slides along under the cursor.
+ if (State.view === "upload" && State.fileDragOver) {
+ this.botCx.target = clamp(State.mouseInIsland.x, UPLOAD_FOLLOW_MIN, UPLOAD_FOLLOW_MAX);
+ }
+
const greetingActive = State.mode === "expanded" && State.view === "greeting";
const visible = p.opacity > 0 && !greetingActive;
this.botCanvas.style.opacity = visible ? "1" : "0";