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.
Swift ai-agentsanthropicantigravityclaudeclaude-codecodexcursordynamic-islandgemini-cliiosiphonlinuxmacosmacos-appmenubar-appnotchopen-sourceswiftswiftuiwindows
Wardrobe view: right-click Mochi, or Wardrobe… in the tray
Claudec97dec18cec5
diff --git a/windows/src-tauri/src/tray.rs b/windows/src-tauri/src/tray.rsindex f6aa0c8f..559f6b4e 100644--- a/windows/src-tauri/src/tray.rs+++ b/windows/src-tauri/src/tray.rs@@ -1,4 +1,4 @@-// Notification-area icon: Open, Settings, Pause, Quit.+// Notification-area icon: Open, Wardrobe, Settings, Pause, Quit.use tauri::menu::{Menu, MenuItem, PredefinedMenuItem};use tauri::tray::TrayIconBuilder;@@ -8,13 +8,14 @@ use crate::island::WINDOW_LABEL;pub fn build(app: &AppHandle) -> tauri::Result<()> {let open = MenuItem::with_id(app, "open", "Open Coucou", true, None::<&str>)?;+ let wardrobe = MenuItem::with_id(app, "wardrobe", "Wardrobe…", true, None::<&str>)?;let settings = MenuItem::with_id(app, "settings", "Settings…", true, None::<&str>)?;let pause = MenuItem::with_id(app, "pause", "Pause", true, None::<&str>)?;let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;let sep1 = PredefinedMenuItem::separator(app)?;let sep2 = PredefinedMenuItem::separator(app)?;- let menu = Menu::with_items(app, &[&open, &sep1, &settings, &pause, &sep2, &quit])?;+ let menu = Menu::with_items(app, &[&open, &sep1, &wardrobe, &settings, &pause, &sep2, &quit])?;let mut builder = TrayIconBuilder::with_id("coucou").tooltip("Coucou")diff --git a/windows/src/core/layout.ts b/windows/src/core/layout.tsindex 6f70eea4..0f0b2997 100644--- a/windows/src/core/layout.ts+++ b/windows/src/core/layout.ts@@ -21,7 +21,8 @@ export type IslandViewName =| "result"| "note"| "settings"- | "greeting";+ | "greeting"+ | "wardrobe";export type BotStateName =| "idle"@@ -86,6 +87,7 @@ export const VIEW_LAYOUTS: Record<IslandViewName, ViewLayout> = {note: { height: 160, botX: 60, botY: null, botDiameter: 50, agentMode: "column" },settings: { height: 160, botX: 54, botY: null, botDiameter: 46, agentMode: "none" },greeting: { height: 150, botX: 320, botY: 90, botDiameter: 0, agentMode: "none" },+ wardrobe: { height: 160, botX: 68, botY: null, botDiameter: 58, agentMode: "none" },};// The upload views above are only the fallback geometry. Once a file is actuallydiff --git a/windows/src/island/island.ts b/windows/src/island/island.tsindex 7fdb6180..18aabfa6 100644--- a/windows/src/island/island.ts+++ b/windows/src/island/island.ts@@ -14,6 +14,7 @@ import { State } from "../core/state";import { BotEngine, hexToRGB } from "../mochi/engine";import { Greeting } from "../mochi/greeting";import { createMiniBot, pruneMiniBots, syncMiniBotStates, tickMiniBots } from "../mochi/minibots";+import { SeasonCache, parseOutfit } from "../mochi/wardrobe";import { UploadCanvas } from "../upload/canvas";import { USC, UploadSeq } from "../upload/sequence";import { buildHeader, buildViews, type ViewActions, type ViewHost } from "../views/views";@@ -21,6 +22,10 @@ import { h } from "../views/dom";import { IslandStateMachine } from "./fsm";const BOT_OVERHANG = 40;+/** Extra canvas on each side of Mochi, for the witch hat's brim and the Santa hat's tip. */+const BOT_SIDE = 24;+/** The pill whose Mochi wears the outfit; any other focused pill takes its own look. */+const MAIN_PILL = "integration_claude";/** Same margin as the Rust hit test (src-tauri/src/island.rs). */const HIT_MARGIN = 14;@@ -60,6 +65,8 @@ export class Island {private engine = new BotEngine();private greeting = new Greeting();+ private greetingShown = false;+ private seasons = new SeasonCache();private running = false;private lastFrame = 0;@@ -167,6 +174,18 @@ export class Island {},openSettingsWindow: () => void Bridge.openSettingsWindow(),blip: () => Sound.play("blip"),+ chooseOutfit: (selection) => {+ if (parseOutfit(State.settings.mochiOutfit) === selection) return;+ State.settings.mochiOutfit = selection;+ void Bridge.saveSettings(State.settings);+ Sound.play("pop");+ this.engine.triggerEmote("proud");+ State.notify();+ },+ previewOutfit: (outfit) => {+ State.wardrobePreview = outfit;+ State.notify();+ },};this.wakeStrip = h("div", { id: "wake-strip" });@@ -334,6 +353,15 @@ export class Island {this.fsm.reveal();}+ /** Right-click on Mochi: wardrobe open ↔ back to the usual view. */+ toggleWardrobe() {+ if (State.paused || State.mode === "hidden") return;+ // The greeting and the drop sequence draw a Mochi of their own.+ if (State.mode === "expanded" && (State.view === "greeting" || this.uploadActive)) return;+ if (State.mode === "expanded" && State.view === "wardrobe") this.setView(State.defaultView());+ else this.setView("wardrobe");+ }+/** An alert stopped waiting for an answer: let the island auto-close again. */dropPin() {this.fsm.pinned = false;@@ -534,6 +562,12 @@ export class Island {this.islandEl.addEventListener("mousedown", (e) => {Sound.resume();State.lastActivity = performance.now();+ // Right-click on Mochi opens the wardrobe, and closes it again.+ if (e.button === 2 && this.isBotHit(e.clientX, e.clientY)) {+ this.cancelBotHover();+ this.toggleWardrobe();+ return;+ }if (State.mode !== "expanded") {this.fsm.click();return;@@ -544,6 +578,12 @@ export class Island {}});+ // No browser menu over Mochi: his right-click is the wardrobe. Everywhere+ // else (the chat field) the webview keeps its own menu.+ this.islandEl.addEventListener("contextmenu", (e) => {+ if (this.isBotHit(e.clientX, e.clientY)) e.preventDefault();+ });+window.addEventListener("keydown", (e) => {if (e.key === "Escape" && State.mode === "expanded" && !State.isPinned) this.collapse();State.lastActivity = performance.now();@@ -773,15 +813,16 @@ export class Island {const size = this.botSize.value;const w = Math.max(1, Math.round(size));const hCss = w + BOT_OVERHANG;+ const wCss = w + BOT_SIDE * 2;const dpr = Math.min(2, window.devicePixelRatio || 1);if (this.canvasPx !== w) {this.canvasPx = w;- this.botCanvas.width = Math.round(w * dpr);+ this.botCanvas.width = Math.round(wCss * dpr);this.botCanvas.height = Math.round(hCss * dpr);- this.botCanvas.style.width = `${w}px`;+ this.botCanvas.style.width = `${wCss}px`;this.botCanvas.style.height = `${hCss}px`;}- this.botCanvas.style.left = `${this.botCx.value - w / 2}px`;+ this.botCanvas.style.left = `${this.botCx.value - wCss / 2}px`;this.botCanvas.style.top = `${this.botCy.value - BOT_OVERHANG / 2 - hCss / 2}px`;const ctx = this.botCanvas.getContext("2d");@@ -801,9 +842,18 @@ export class Island {this.engine.slotHVel = 0;}}+ // Only the main Mochi is dressed: a focused integration pill shows its own+ // colours, unless the wardrobe is open (BotCanvasView.showOutfit, macOS).+ // In the wardrobe the hovered outfit swaps in at once, without the drop-in.+ const inWardrobe = State.mode === "expanded" && State.view === "wardrobe";+ const mainFocused = State.focusId == null || State.focusId === MAIN_PILL;+ const showOutfit = mainFocused || State.mode !== "expanded" || inWardrobe;+ const outfit = State.wardrobePreview ?? this.seasons.get(parseOutfit(State.settings.mochiOutfit));+ this.engine.setOutfit(showOutfit ? outfit : "none", !inWardrobe);+this.engine.update(dt);- ctx.setTransform(dpr, 0, 0, dpr, 0, 0);- ctx.clearRect(0, 0, w, hCss);+ ctx.setTransform(dpr, 0, 0, dpr, BOT_SIDE * dpr, 0);+ ctx.clearRect(-BOT_SIDE, 0, wCss, hCss);this.engine.draw(ctx, w, hCss);}@@ -840,6 +890,12 @@ export class Island {this.contentEl.style.pointerEvents = expanded && !greetingActive ? "auto" : "none";this.greetingCanvas.style.display = greetingActive ? "block" : "none";+ // Leaving the greeting, however it ends, lets its sound fade out.+ if (this.greetingShown && !greetingActive) this.greeting.leave();+ this.greetingShown = greetingActive;+ // A wardrobe try-on never outlives the wardrobe.+ if (State.wardrobePreview && !(expanded && State.view === "wardrobe")) State.wardrobePreview = null;+this.header.sync();for (const [name, view] of this.views) {const on = name === State.view;diff --git a/windows/src/main.ts b/windows/src/main.tsindex f65d5e75..21b2195f 100644--- a/windows/src/main.ts+++ b/windows/src/main.ts@@ -43,6 +43,10 @@ async function main() {setPaused(false);island.alert(State.defaultView());break;+ case "wardrobe":+ setPaused(false);+ island.alert("wardrobe");+ break;case "pause":setPaused(!State.paused);if (State.paused) island.fsm.forceHidden();diff --git a/windows/src/style.css b/windows/src/style.cssindex b2cf6756..28c7c392 100644--- a/windows/src/style.css+++ b/windows/src/style.css@@ -1365,3 +1365,65 @@ input[type="range"]::-webkit-slider-thumb {.int-card.detail {padding-top: 8px;}++/* ── Wardrobe (right-click on Mochi) — WardrobeView on macOS ─────────────── */++.wardrobe-stack {+ padding: 12px 16px 12px 104px;+ gap: 10px;+}++.wardrobe-head {+ display: flex;+ align-items: baseline;+ gap: 6px;+ min-width: 0;+}++.wardrobe-title {+ font: 600 12px var(--font);+ color: var(--ink);+ flex: 0 0 auto;+}++.wardrobe-note {+ margin-left: auto;+ font: 400 11px var(--font);+ color: var(--dim-2);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}++.wardrobe-grid {+ display: flex;+ flex-wrap: wrap;+ gap: 5px;+}++.wardrobe-item {+ width: 30px;+ height: 30px;+ padding: 0;+ border-radius: 7px;+ border: 1px solid rgba(255, 255, 255, 0.08);+ background: rgba(255, 255, 255, 0.06);+ display: grid;+ place-items: center;+ cursor: default;+ transition: background 0.12s ease-out, border-color 0.12s ease-out;+}++.wardrobe-item:hover {+ background: rgba(255, 255, 255, 0.1);+}++.wardrobe-item.on {+ border-color: rgba(255, 255, 255, 0.4);+}++.wardrobe-item canvas {+ width: 28px;+ height: 28px;+ pointer-events: none;+}diff --git a/windows/src/views/views.ts b/windows/src/views/views.tsindex ac0ac7b6..484909b7 100644--- a/windows/src/views/views.ts+++ b/windows/src/views/views.ts@@ -11,6 +11,8 @@ import { createMiniBot, pruneMiniBots } from "../mochi/minibots";import { buildPrompt } from "./chat";import { buildChoose, buildUpload, buildUploading } from "./upload";import { renderIntegrationCard, type IntegrationCardHooks } from "./integrations";+import { buildWardrobe } from "./wardrobe";+import type { Outfit, OutfitSelection } from "../mochi/wardrobe";export interface ViewActions {setView(v: IslandViewName): void;@@ -26,6 +28,10 @@ export interface ViewActions {setAutoClose(seconds: number): void;openSettingsWindow(): void;blip(): void;+ /** Wardrobe click: keeps the outfit ("auto" and "none" included). */+ chooseOutfit(selection: OutfitSelection): void;+ /** Wardrobe hover: shows an outfit on Mochi without keeping it; null ends it. */+ previewOutfit(outfit: Outfit | null): void;}export interface ViewHost {@@ -501,6 +507,7 @@ export function buildViews(map.set("upload", buildUpload());map.set("uploading", buildUploading());map.set("choose", buildChoose(actions));+ map.set("wardrobe", buildWardrobe(actions));// Not in the Windows v1: sending a file by email, window attach + web result.map.set("mail", buildPlaceholder("Sending by email isn't in this version.", ""));map.set("searching", buildPlaceholder("Claude is searching…", ""));diff --git a/windows/src/views/wardrobe.ts b/windows/src/views/wardrobe.tsnew file mode 100644index 00000000..4c9a61e5--- /dev/null+++ b/windows/src/views/wardrobe.ts@@ -0,0 +1,94 @@+// Wardrobe view — port of WardrobeView (IslandViewContent.swift). Opened with a+// right-click on Mochi or from the tray menu. Resting the pointer on a button+// tries the outfit on Mochi; a click keeps it.++import { h } from "./dom";+import { State } from "../core/state";+import { drawWardrobeIcon } from "../mochi/outfits";+import {+ OUTFIT_LABELS, OUTFIT_SELECTIONS, WARDROBE_STRINGS, parseOutfit, resolveOutfit, seasonalOutfit,+ wardrobeHeader, type Outfit, type OutfitSelection,+} from "../mochi/wardrobe";+import type { ViewActions, ViewHost } from "./views";++const ICON = 28;++export function buildWardrobe(actions: ViewActions): ViewHost {+ const note = h("span", { class: "wardrobe-note" });+ const grid = h("div", { class: "wardrobe-grid" });+ const el = h(+ "div",+ { class: "view wardrobe" },+ h(+ "div",+ { class: "card" },+ h(+ "div",+ { class: "stack wardrobe-stack" },+ h("div", { class: "wardrobe-head" }, h("span", { class: "wardrobe-title", text: WARDROBE_STRINGS.title }), note),+ grid,+ ),+ ),+ );++ let hovered: OutfitSelection | null = null;+ let drawnSeason: Outfit | null = null;+ const items = new Map<OutfitSelection, { button: HTMLButtonElement; canvas: HTMLCanvasElement }>();++ const updateNote = () => {+ note.textContent = wardrobeHeader(hovered, parseOutfit(State.settings.mochiOutfit), new Date());+ };++ for (const sel of OUTFIT_SELECTIONS) {+ const canvas = h("canvas");+ const button = h(+ "button",+ { class: "wardrobe-item", title: OUTFIT_LABELS[sel], "aria-label": OUTFIT_LABELS[sel] },+ canvas,+ );+ button.addEventListener("mouseenter", () => {+ hovered = sel;+ actions.previewOutfit(resolveOutfit(sel, new Date()));+ updateNote();+ });+ button.addEventListener("mouseleave", () => {+ if (hovered !== sel) return;+ hovered = null;+ actions.previewOutfit(null);+ updateNote();+ });+ button.addEventListener("click", () => actions.chooseOutfit(sel));+ items.set(sel, { button, canvas });+ grid.append(button);+ }++ /** Icons are drawn once; only "auto" changes, with the season. */+ const drawIcons = () => {+ const season = seasonalOutfit(new Date());+ if (season === drawnSeason) return;+ const first = drawnSeason == null;+ drawnSeason = season;+ const dpr = Math.min(2, window.devicePixelRatio || 1);+ for (const [sel, { canvas }] of items) {+ if (!first && sel !== "auto") continue;+ canvas.width = Math.round(ICON * dpr);+ canvas.height = Math.round(ICON * dpr);+ const ctx = canvas.getContext("2d");+ if (!ctx) continue;+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);+ drawWardrobeIcon(ctx, ICON, sel, season, WARDROBE_STRINGS.autoBadge);+ }+ };++ return {+ el,+ sync() {+ drawIcons();+ // The island drops the preview when the view closes: so does the hover.+ if (State.wardrobePreview == null) hovered = null;+ const current = parseOutfit(State.settings.mochiOutfit);+ for (const [sel, { button }] of items) button.classList.toggle("on", sel === current);+ updateNote();+ },+ };+}