Skip to content

fix: self-heal stale Accessibility grants, hide the pill at idle, wire the on-device cleanup worker - #9

Open
Iamdk25 wants to merge 2 commits into
Blueturboguy07:mainfrom
Iamdk25:feat/self-heal-pill-local-cleanup
Open

Iamdk25 wants to merge 2 commits into
Blueturboguy07:mainfrom
Iamdk25:feat/self-heal-pill-local-cleanup

Conversation

@Iamdk25

@Iamdk25 Iamdk25 commented Sep 1, 2026

Copy link
Copy Markdown

Two long-standing pain points and one dead code path, fixed:

1. Stale Accessibility grants now self-heal (macOS)

Every ad-hoc-signed rebuild invalidates the TCC entry. macOS then shows WhimprFlow as enabled in System Settings while the running build is refused (or the reverse: the app reads "not granted" while the pane shows it on). Previously this dead-ended in a manual toggle dance.

  • On launch, when untrusted, the app clears its own stale entry (tccutil reset), re-prompts, and opens the Accessibility pane.
  • The onboarding Grant button does the same reset-then-prompt.
  • A Fix Accessibility action (onboarding banner + Hub banner) covers the inverse case: granted, but the Fn tap is dead.
  • New hotkey_wired status (TAP_LIVE on macOS, HOOK_LIVE on Windows) distinguishes "granted" from "actually working"; banners appear only after a grace period so they never false-positive while the tap spins up.
  • The tap-creation retry loop re-checks trust every iteration, so reset → re-enable works with no relaunch, and a tap is never created while untrusted (macOS would silently cap it to frontmost-only).

2. Pill only exists while WhimprFlow is working

The overlay window used to be always visible at rest (idle nub). Bar-state emission now flows through one shared emitter that also shows/hides the window: visible for recording/locked/transcribing/done/error, hidden at idle. Wired through the macOS state machine, the diagnostics path, the Windows pipeline, and the tray demo items.

3. On-device cleanup worker reachable in dev and release

Local (Qwen) cleanup was dead unless someone hand-built target/release/whimpr-llm-worker:

  • worker_bin_path() now checks both target/release and target/debug in dev.
  • dev.sh builds the worker before tauri dev.
  • scripts/build-macos.sh builds the worker, copies it next to the app executable (the first lookup), signs it, and re-seals the bundle.

Verification

  • cargo check -p whimpr-tauri clean, 43 unit tests green (whimpr-core, whimpr-ipc).
  • tsc --noEmit + vite build clean.
  • Smoke-tested the built app on macOS 14+ (Apple Silicon): Accessibility self-heal logs correct, Fn tap created with no retries, cleanup mode: Local → Qwen3-4B GGUF loads on Metal GPU (37/37 layers), worker process spawned from inside the .app bundle.

Windows parity is compile-level only (win.rs reviewed, AtomicBool/Ordering imports verified) — not runtime-tested on Windows.

…s, hide the pill at idle

Two of the most-reported pain points, fixed at the source:

- Stale-grant self-heal. Every ad-hoc-signed rebuild invalidates the TCC
  entry, leaving System Settings showing WhimprFlow as enabled while the
  running build is refused (or the reverse). On launch, when untrusted, the
  app now clears its own stale entry (tccutil reset), re-prompts, and opens
  the Accessibility pane; the Grant button does the same; a Fix Accessibility
  action covers the granted-but-dead-tap case. hotkey_wired status (TAP_LIVE
  on macOS, HOOK_LIVE on Windows) distinguishes 'granted' from 'actually
  working', surfaced in onboarding and the Hub after a grace period so it
  never false-positives. The tap thread re-checks trust every retry, so
  reset -> re-enable works with no relaunch.

- Pill only while working. The overlay window was always visible at rest as
  an idle nub. Bar-state emission now goes through one shared emitter that
  also shows/hides the window: visible for recording/locked/transcribing/
  done/error, hidden at idle. Wired through the macOS state machine, the
  diagnostics path, the Windows pipeline, and the tray demo items.
The local Qwen cleanup worker was never reachable outside a hand-built
target/release: the release .app didn't bundle it, and the dev fallback
only looked at target/release while tauri dev builds target/debug.

- worker_bin_path now checks both profiles in dev
- dev.sh builds the worker before launching tauri dev
- build-macos.sh builds the worker, copies it next to the app executable
  (worker_bin_path's first lookup), and re-seals the bundle signature
nitrimandylis pushed a commit to nitrimandylis/WhimprFlow that referenced this pull request Sep 12, 2026
* port windows: complete the hotkey surface and pill controls

The Windows layer (cfg(target_os=windows), never compiled until now) was
missing the symbols lib.rs calls via hotkey::. Add them mirroring the
macOS surface:

- models_dir/model_path with language-aware model selection (honours
  Settings.whisper_model, otherwise picks .en variants for English and
  multilingual ggml-*.bin otherwise)
- read_openai_key/read_anthropic_key via env var or keyring
- real ui_start/ui_stop/ui_cancel/trigger_hands_free wired to the hook
  thread's on_ptt_* handlers (no more empty stubs)
- LAST_BAR + last_bar remembered in emit_bar
- make rebuild_asr pub
- fix the Windows re-export to match the macOS export list

Verified: cargo check --target x86_64-pc-windows-gnu -j1 (in src-tauri),
cargo check --workspace -j1, cargo test --workspace -j1. The Cargo.lock
is synced to the 1.0.0 version bump from ed09182.

* ci: add Windows build workflow (Phase 2)

Windows CI modeled on build-macos.yml: builds the whimpr-llm-worker
sidecar for x86_64-pc-windows-msvc, stages it into src-tauri/binaries,
runs cargo check/test across the workspace, and builds the frontend so
the Tauri app bundles. Runs on pull_request to gate the Windows port.

* fix: guard icon_as_template (macOS-only) on non-macOS

icon_as_template(true) is macOS-only in Tauri v2 and would panic at
startup on Windows. Apply the template only on macOS; other platforms
just set the full-color icon. Runtime fix identified in Phase 3.

* fix: normalize push-to-talk key to Right Control on Windows

The macOS-only PushToTalkKey concept (Fn / Globe, Right Command, Right
Option) leaked into the Windows settings UI: the default is 'fn', but
the Windows keyboard hook only implements Right Control (PTT_VK). The
setting was ignored on Windows, so the app advertised a key that did
nothing while only Right Control worked.

Normalize push_to_talk_key to RightControl on load and on save so every
reader (settings pane, onboarding, FlowBar, history) shows the key the
hook actually responds to. Fix found during the Phase 3 Windows runtime
pass (issue Blueturboguy07#7).

* fix: hide macOS-only keys and copy on Windows (issue Blueturboguy07#9)

* dev: add portable Windows dev launcher (dev.ps1) and README notes

* docs: dual-platform run instructions (macOS + Windows)

* docs: consolidate dual-platform Windows run instructions

* docs: add platform differences table to README

---------

Co-authored-by: skibkitty <272934292+skibkitty@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant