Commit Graph

9 Commits

Author SHA1 Message Date
teernisse
47c7b3e83c feat: integrate app initialization into Tauri setup
Startup sequence now:
1. Creates data directories (~/.local/share/mc/)
2. Cleans up orphaned tmp files from crashes
3. Verifies CLI dependencies (lore, br, bv) asynchronously
4. Emits startup-warnings event with missing CLI warnings
5. Emits cli-availability event with tool status
6. Emits startup-sync-ready when CLIs available

This enables the frontend to:
- Display warnings for missing tools
- Know which features are available
- Trigger reconciliation when ready

bd-3jh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:34:34 -05:00
teernisse
0ad1b30941 feat: add app initialization module with startup sequence
Implements core startup infrastructure:
- AppConfig for data directory paths
- ensure_data_dir() to create ~/.local/share/mc/
- verify_cli_dependencies() async CLI availability check
- load_with_migration() for state file loading with migration support
- init() main entry point coordinating lock acquisition and setup
- StartupWarning enum for non-fatal issues (missing CLIs, state reset)
- InitError enum with conversion to McError

Also exposes Bridge::with_data_dir() publicly (was test-only).

Includes 11 tests covering directory creation, lock acquisition,
lock contention, corrupt file handling, and config paths.

bd-3jh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:33:07 -05:00
teernisse
da13b99b75 fix: add missing specta annotations, scope tmp cleanup, and secure state file permissions 2026-02-26 10:24:28 -05:00
teernisse
807899bc49 feat: implement CommandPalette for quick filter and search
- Add text search across all focus items
- Support filter commands: type: and stale:
- Keyboard navigation with arrow keys + Enter
- Click to select items
- Escape or backdrop click to close
- 17 tests covering search, filters, keyboard nav, and empty state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:16:14 -05:00
teernisse
378a173084 feat: implement ReasonPrompt component with quick tags
- Create ReasonPrompt dialog for capturing optional reasons
- Add quick tag buttons (Blocking, Urgent, Context switch, etc.)
- Support keyboard navigation (Escape to cancel)
- Handle text input with trimming and null for empty
- Different titles for different actions (set_focus, defer, skip)
- All 10 tests pass

Closes bd-2p0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:10:02 -05:00
teernisse
087b588d71 feat: add Tauri state persistence and BvCli trait
- Add Tauri storage adapter for Zustand (tauri-storage.ts)
- Add read_state, write_state, clear_state Tauri commands
- Wire focus-store and nav-store to use Tauri persistence
- Add BvCli trait for bv CLI mocking with response types
- Add BvError and McError conversion for bv errors
- Add cleanup_tmp_files tests for bridge
- Fix linter-introduced tauri_specta::command issues

Closes bd-2x6, bd-gil, bd-3px

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 10:06:57 -05:00
teernisse
f9f35c9476 chore: call tmp file cleanup on app startup
Integrates the bridge's cleanup_tmp_files() method into the Tauri
setup phase. This ensures any orphaned .json.tmp files from previous
crashes are cleaned up before the app starts operating.

The cleanup runs early in setup(), before tray and shortcuts, to
ensure a clean state for the bridge to operate in.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 09:56:36 -05:00
teernisse
2e0ead8660 feat: wire up Tauri IPC commands with global shortcuts and tray
Completes the backend command layer, exposing bridge operations to the
frontend via Tauri IPC. Also adds system tray support and global hotkeys.

New commands:
- get_lore_status: Real CLI integration (was stub), returns issue/MR counts
- get_bridge_status: Mapping counts, pending items, sync timestamps
- sync_now: Trigger incremental sync (since_last_check events)
- reconcile: Full reconciliation pass (two-strike orphan detection)
- quick_capture: Create a new bead from freeform text

All commands use tokio::spawn_blocking for CLI I/O, preventing async
executor starvation. Commands accept trait objects for testability.

System integration:
- Global shortcut: Cmd+Shift+M toggles window visibility
- Global shortcut: Cmd+Shift+C opens quick capture overlay
- System tray: Left-click toggles window, right-click shows menu
- Tray menu: Show Mission Control, Quit

Tauri configuration:
- Added global-shortcut plugin with permissions
- Shell plugin scoped to lore, br, bv commands only
- Removed trayIcon config (using TrayIconBuilder instead)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 09:54:15 -05:00
teernisse
62ee08de29 feat: scaffold Tauri 2.0 backend foundation
Set up the Rust backend for Mission Control using Tauri 2.0:

Cargo Configuration:
- Cargo.toml: Tauri 2.0, serde, thiserror, tracing, mockall
  - Library crate (mission_control_lib) for testability
  - Binary crate for Tauri entry point
- Cargo.lock: Pinned dependencies for reproducible builds

Tauri Configuration (tauri.conf.json):
- App identifier: com.mission-control.app
- Window: 800x600, centered, hiddenTitle for clean macOS look
- Shell plugin scoped to lore, br, bv commands only
- Tray icon configured for background operation

Application Bootstrap:
- src/main.rs: Minimal entry point, delegates to lib
- src/lib.rs: Tracing setup, plugin registration, command handlers
  - Debug mode: auto-opens devtools
  - Safe window lookup (no unwrap panic)
- build.rs: Tauri build script for codegen

Architecture: The lib/bin split enables unit testing the Tauri
command handlers without launching the full app.
2026-02-25 17:01:25 -05:00