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.

fix(flow): ensure dictation pill window is parked off-screen and hidden on startup (#698)

unknowne786d7c26e92
diff --git a/windows/src-tauri/src/flow/pill.rs b/windows/src-tauri/src/flow/pill.rs
index 21de293b..d34f01b1 100644
--- a/windows/src-tauri/src/flow/pill.rs
+++ b/windows/src-tauri/src/flow/pill.rs
@@ -120,6 +120,8 @@ pub fn setup(app: &AppHandle) {
if !platform::prepare_pill_window(&win, mode) {
let _ = win.destroy();
mode = DesktopMode::Off;
+ } else if park {
+ let _ = win.set_position(PhysicalPosition::new(PARKED.0, PARKED.1));
}
}
Err(err) => {
@@ -138,6 +140,7 @@ pub fn setup(app: &AppHandle) {
announce_seq: std::sync::atomic::AtomicU64::new(1),
});
app.manage(pill.clone());
+ show(app, &pill, false);
if mode == DesktopMode::Poll {
spawn_poll(app.clone(), pill);
}
diff --git a/windows/src/pill/main.ts b/windows/src/pill/main.ts
index 7d81770a..e03c64f5 100644
--- a/windows/src/pill/main.ts
+++ b/windows/src/pill/main.ts
@@ -240,6 +240,13 @@ let capsule: HTMLElement | null = null;
let lastKey = "";
function render() {
+ if (!visible) {
+ root.style.display = "none";
+ root.replaceChildren();
+ void FlowBridge.pillHot([]);
+ return;
+ }
+ root.style.display = "flex";
const l = look();
const open = l !== "resting";
const length = open ? openLength(l) : RESTING_LENGTH;
@@ -277,6 +284,10 @@ function render() {
}
function reportHot() {
+ if (!visible) {
+ void FlowBridge.pillHot([]);
+ return;
+ }
const rects: [number, number, number, number][] = [];
const W = window.innerWidth;
const H = window.innerHeight;
@@ -493,10 +504,11 @@ async function main() {
const status = await FlowBridge.status();
if (status) platform = status.platform;
state = (await FlowBridge.pillState()) ?? state;
- visible = state.enabled || state.noteStartedAt !== null || state.announcement !== null || state.voice !== null;
+ visible = state.enabled || state.noteStartedAt !== null || state.announcement !== null || state.voice !== null || state.phase !== "idle";
render();
void onEvent<PillState>("pill-state", (s) => {
state = s;
+ visible = s.enabled || s.noteStartedAt !== null || s.announcement !== null || s.voice !== null || s.phase !== "idle";
if (s.phase === "listening") target.fill(0);
render();
});