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.

Flow pill: buttons take clicks, and the pill keeps its edge

ARNAV AGGARWAL24deb988e166
diff --git a/windows/src/pill/main.ts b/windows/src/pill/main.ts
index 7d81770a..afbaab67 100644
--- a/windows/src/pill/main.ts
+++ b/windows/src/pill/main.ts
@@ -128,6 +128,7 @@ function pillButton(icon: string, tip: string, action: () => void, opts: { small
action();
});
b.addEventListener("pointerenter", () => {
+ if (tooltip === tip) return;
tooltip = tip;
render();
});
@@ -265,10 +266,15 @@ function render() {
capsule.style.width = `${vertical() ? thickness : length}px`;
capsule.style.height = `${vertical() ? length : thickness}px`;
});
- // Bubble first in the DOM: the flex direction puts it beside the pill.
+ // Bubble first in the DOM: the flex direction puts it beside the pill. The
+ // capsule itself stays attached: taking it out and back in re-fires
+ // pointerenter on the button under the cursor, which renders again, in a
+ // loop that also eats every click (the press and the release land on a
+ // node that was removed in between).
for (const old of root.querySelectorAll(".bubble")) old.remove();
const b = bubble();
- root.replaceChildren(...(b ? [b] : []), capsule);
+ if (b) root.prepend(b);
+ if (capsule.parentNode !== root) root.append(capsule);
mochi.setState(state.phase === "thinking" || state.voice?.phase === "thinking" ? "thinking" : "idle");
wake();
// Where the mouse is taken, once the sizes have settled.
diff --git a/windows/src/pill/pill.css b/windows/src/pill/pill.css
index 96029914..4d111241 100644
--- a/windows/src/pill/pill.css
+++ b/windows/src/pill/pill.css
@@ -48,6 +48,15 @@ body {
padding-right: 2px;
}
+/* On a side the pill keeps the edge and its bubble opens inward beside it.
+ The bubble comes first in the DOM (right for the bottom, where it sits
+ above), which on a side would put it at the edge and push the pill inward,
+ out of the zone that takes the mouse. */
+#pill.left .capsule,
+#pill.right .capsule {
+ order: -1;
+}
+
.capsule {
position: relative;
flex: 0 0 auto;