Skip to content

Cross-platform (Windows/Linux) verification + automated tests #3

Description

@victorlucss

Context

Dict is a Tauri 2.0 app intended to run on macOS, Windows, and Linux, but development and manual testing have happened almost entirely on macOS. We need confidence that core flows work on the other platforms, plus automated tests to catch regressions.

Platform-specific surfaces to verify

These are the areas most likely to differ across platforms:

  • Global hotkey registration + firing (tauri-plugin-global-shortcut); default differs per-OS (Alt+Space mac / Ctrl+Alt+Space else) and live re-registration via on_shortcut.
  • Bare-modifier / Fn trigger — currently macOS-only (NSEvent flagsChanged monitor in lib.rs). Needs a Windows/Linux equivalent (e.g. low-level keyboard hook) or graceful no-op + UI gating.
  • Audio capture (cpal) — device enumeration, default device, sample formats/rates, resampling to 16 kHz.
  • Whisperwhisper-cli discovery (whisper.rs) and model dir resolution (~/.config/dict/models vs %APPDATA%/dict/models).
  • Text injection (text_injector.rs) — clipboard + paste keystroke (Cmd+V vs Ctrl+V), accessibility/permission model.
  • Frontmost-app detection (frontmost_app.rs) — macOS NSWorkspace / Windows GetForegroundWindow / Linux xdotool.
  • Window chrome — vibrancy + overlay title bar are macOS-only; verify the Preferences/overlay windows look/behave acceptably elsewhere.
  • Tray — left-click-opens-Settings + right-click menu behavior across platforms.
  • Config + capabilities — config path resolution; Tauri capabilities/permissions.

Proposed automated tests

  • Unit tests for platform-agnostic logic: settings (de)serialization + defaults (some exist in settings.rs), accelerator/bare-modifier parsing, whisper arg building, LLM provider/model URL derivation, tone→prompt mapping.
  • #[cfg(target_os)]-gated tests for path resolution (models/config dirs) per platform.
  • CI matrix (GitHub Actions) building on macOS + Windows + Linux (cargo build/cargo test for src-tauri, plus tauri build), extending .github/workflows/release.yml's matrix to run on PRs.
  • Smoke/integration (later): headless launch that asserts startup (hotkey registered, tray created) without crashing, per-OS.

Status

Deferred — tracking for future work. Priority: do the CI build matrix first (cheap regression signal), then unit tests, then per-platform manual passes for the native surfaces above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions