diff --git a/docs/decisions/v1.1-floating-window.md b/docs/decisions/v1.1-floating-window.md deleted file mode 100644 index 735d875..0000000 --- a/docs/decisions/v1.1-floating-window.md +++ /dev/null @@ -1,108 +0,0 @@ -# v1.1 — Floating window + regular Mac app - -**Status:** Accepted -**Date:** 2026-05-01 -**Supersedes:** PRD §FR2 (Tauri menubar app, tray icon, popover positioned near tray icon) - -## Context - -v1 shipped as a menubar tray app (`ActivationPolicy::Accessory`, no Dock, no app menu, popover anchored to tray icon, baked `alwaysOnTop`, auto-hide on focus loss). After ship, the goal shifted: the user wants a **regular Mac app** with a draggable floating window, optional always-on-top, a Dock icon, and an app menu. The menubar-popover model and its supporting decisions (NSWindowCollectionBehavior across Spaces, NSPanel nonactivating, positioner near tray icon, `WindowLevel::{Floating, Status, Screensaver}` enum) are obsolete. - -## Decisions - -Each item below is locked. Any change requires a new ADR superseding this one. - -### D1 — Tray icon dropped - -No tray icon. App entry point is the Dock icon and the app menu's `Window > Show Ranch` item. - -### D2 — Custom titlebar (no native chrome) - -`tauri.conf.json` keeps `decorations: false`. A React component renders a thin titlebar with a drag region (`data-tauri-drag-region`) and a close button. No traffic lights, no title text. - -### D3 — `Always on Top` toggle in `Window` menu - -Toggle lives in the standard Mac `Window` menu as a checkbox item. State persists to `~/.adhd-ranch/settings.yaml` under `widget.always_on_top: bool`. Restored on launch. - -### D4 — `WindowLevel` enum killed - -The three-level `WindowLevel::{Floating, Status, Screensaver}` enum (a menubar-popover artifact) is removed. Replace with a boolean. Settings key `widget.window_level` is removed; replaced with `widget.always_on_top`. No migration shim — v1 was a single-user beta. - -### D5 — No Settings UI in v1.1 - -No Preferences window. App menu items write `settings.yaml` directly when toggled. Caps and other config remain hand-edited. A Settings panel may come later; this is additive. - -### D6 — Close button hides; `Show Ranch` reopens - -The titlebar close button hides the window (`window.hide()`); the app keeps running. `Window > Show Ranch` calls `window.show().focus()`. Cmd-W also hides. Cmd-Q quits. Hiding (vs destroy) preserves React state — scroll position, expanded proposals, open Edit modal. - -### D7 — Window position + size via macOS autosave - -One objc2 call to `setFrameAutosaveName:` ("adhd-ranch-main"). macOS UserDefaults stores the frame; survives crashes; reset via `defaults delete com.adhd-ranch.app`. No app-level persistence code, no entries in `settings.yaml`. - -### D8 — Auto-hide on focus loss removed - -The `WindowEvent::Focused(false) → window.hide()` path in `src-tauri/src/app/mod.rs` is removed. A floating window that hides itself when the user clicks elsewhere defeats the purpose. - -### D9 — Minimal app menu - -``` -Adhd Ranch - About Adhd Ranch - ─ - Quit Cmd+Q -File - Close Cmd+W (hides window) -Edit - (Tauri defaults: undo/redo/cut/copy/paste/select all) -Window - Always on Top ✓ (toggle, persists to settings.yaml) - ─ - Show Ranch -``` - -No Help menu. No `File > New Focus` shortcut — the in-window button is sufficient. Standard Edit menu is Tauri's default and covers the proposal-edit textareas free. - -### D10 — Default 400×600, resizable, min 320×400 - -`tauri.conf.json` updated: `width: 400`, `height: 600`, `resizable: true`, `minWidth: 320`, `minHeight: 400`. Floating window users park the window in a corner and want vertical room for 5 focuses × up to 7 tasks. Min prevents accidental shrink-to-nothing. Combined with autosave (D7), users set their preferred size once. - -### D11 — Activation policy `Regular` - -Flip `app.set_activation_policy(tauri::ActivationPolicy::Accessory)` to `Regular` on macOS. Required for Dock icon and standard Mac app menu. - -### D12 — Dock click reopens window - -Wire Tauri `RunEvent::Reopen` (macOS) to `window.show().focus()`. Same path as `Window > Show Ranch`. Standard Mac convention — clicking the Dock icon of a running app brings its main window forward. - -## Consequences - -### Code that must change - -- `src-tauri/src/app/mod.rs` — drop `set_activation_policy(Accessory)`, drop `tray::install` call, drop `WindowEvent::Focused(false) → hide()`, add `RunEvent::Reopen`, replace `window_level::apply` call site with `setFrameAutosaveName:` plus optional `setLevel: kCGFloatingWindowLevel` (when `always_on_top`). -- `src-tauri/src/app/window_level.rs` — replace with `panel_level.rs` (or merge into a single `window_chrome.rs`); keep an `apply_always_on_top(window: &WebviewWindow, on: bool)` that sets `setLevel:` to `kCGFloatingWindowLevel` (3) when on, `NSNormalWindowLevel` (0) when off. -- `src-tauri/src/app/tray.rs` — delete. -- `src-tauri/src/app/menu.rs` — extend with `Window > Always on Top` and `Window > Show Ranch`; the existing tray-menu code is removed. -- `src-tauri/tauri.conf.json` — `width: 400`, `height: 600`, `resizable: true`, `minWidth: 320`, `minHeight: 400`. `decorations: false` stays. `alwaysOnTop` removed (now runtime-controlled). `skipTaskbar` removed (regular app shows in Dock). -- `crates/domain/src/settings.rs` — remove `WindowLevel`, `parse_window_level`. Replace `Widget { window_level }` with `Widget { always_on_top: bool }`. Tests rewritten. -- `crates/commands/` — call sites that read `widget.window_level` updated to `widget.always_on_top`. -- `src/components/Titlebar.tsx` (new) — React component with drag region + close button. - -### Code that becomes dead - -- `tauri-plugin-positioner` is no longer needed for tray-anchor positioning. Keep only if used elsewhere; otherwise remove from `Cargo.toml` + `mod.rs`. -- `src-tauri/src/app/window_level.rs` — replaced. - -### Issues invalidated - -- `issues/010-popover-spaces-and-fullscreen.md` — premise dead (no tray popover). Rewritten as "Regular app skeleton". -- `issues/011-nonactivating-panel.md` — premise dead. Rewritten as "App menu + custom titlebar + Always on Top toggle". - -### Docs requiring follow-up - -- `PRD.md` §FR2 (Tauri menubar app) — rewrite or annotate as superseded by this ADR. -- `PRD.md` §FR3 (Widget UI — popover layout) — soften "popover" language to "main window". -- `CONTEXT.md` "Application" section — rewrite "menubar/tray app via TrayIconBuilder; popover window is borderless, always-on-top, positioned near the tray icon" to reflect the new model. -- `CONTEXT.md` "Configuration" — `settings.yaml` example updated with `widget.always_on_top`. -- `README.md` "Day-to-day usage" — rewrite step 1 ("Open the menubar popover") to reflect Dock + window model. -- `CHANGELOG.md` — add `[Unreleased]` entries: `Changed` (regular Mac app + floating window), `Removed` (tray icon, `WindowLevel` enum, auto-hide). diff --git a/issues/README.md b/issues/README.md index a0e7b71..fb9c9a1 100644 --- a/issues/README.md +++ b/issues/README.md @@ -6,9 +6,6 @@ Each issue is a self-contained vertical slice an AFK coding agent ("ralph") can Complete these before picking up any other open issue. All are unblocked and independent — grab any order. -- [~] [033 — Extract pig/drag IPC into api/ layer](033-pig-ipc-api-layer.md) — PR #39 open, awaiting review -- [~] [034 — Move Focus/Task invariants into domain](034-focus-invariants-in-domain.md) — PR #40 open, awaiting review -- [~] [035 — Unit tests for MarkdownFocusStore](035-focus-store-unit-tests.md) — PR #41 open, awaiting review - [ ] [036 — Generate TypeScript types from Rust via ts-rs](036-ts-types-from-rust.md) ## How to pick up an issue diff --git a/issues/024-display-subsystem-agent-prompt.md b/issues/done/024-display-subsystem-agent-prompt.md similarity index 100% rename from issues/024-display-subsystem-agent-prompt.md rename to issues/done/024-display-subsystem-agent-prompt.md diff --git a/issues/024-display-subsystem.md b/issues/done/024-display-subsystem.md similarity index 100% rename from issues/024-display-subsystem.md rename to issues/done/024-display-subsystem.md diff --git a/issues/033-pig-ipc-api-layer.md b/issues/done/033-pig-ipc-api-layer.md similarity index 100% rename from issues/033-pig-ipc-api-layer.md rename to issues/done/033-pig-ipc-api-layer.md diff --git a/issues/034-focus-invariants-in-domain.md b/issues/done/034-focus-invariants-in-domain.md similarity index 100% rename from issues/034-focus-invariants-in-domain.md rename to issues/done/034-focus-invariants-in-domain.md diff --git a/issues/035-focus-store-unit-tests.md b/issues/done/035-focus-store-unit-tests.md similarity index 100% rename from issues/035-focus-store-unit-tests.md rename to issues/done/035-focus-store-unit-tests.md