Skip to content

feat(desktop): add cross-platform tray app for quick secret creation - #172

Merged
dillonstreator merged 1 commit into
mainfrom
feat/desktop-app
Nov 23, 2026
Merged

dillonstreator merged 1 commit into
mainfrom
feat/desktop-app

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

Closes #57

Summary

Adds @crypt.fyi/desktop, a cross-platform (macOS, Windows, Linux) tray/menu-bar app for creating secret links from anywhere:

  • Global shortcut (default Ctrl+Alt+Shift+E / ⌘⌥⇧E, configurable) toggles a small always-on-top quick-create window.
  • The secret is prefilled from the clipboard (can be turned off). Options: password, expiry (same 5 min to 7 day choices as web/extension) and burn after reading.
  • On create, the link replaces the clipboard contents (which also removes the prefilled plaintext) and a notification confirms it. If notifications are blocked or the copy fails, the window shows the link instead.
  • Tray menu: New secret, Settings, Quit. Closing the window keeps the app in the tray. On macOS it has no Dock icon. A single-instance guard sends a second launch to the running app.
  • Settings: API URL (default https://api.crypt.fyi), web URL, shortcut recorder, default expiry/burn, clipboard prefill, language and theme.
  • Translated into all five locales; styled with @crypt.fyi/theme.

Architecture

  • Why Tauri 2 and not Electron: much smaller installers, the system WebView instead of a bundled Chromium, and a deny-by-default capability model that lets the window be limited to exactly the native APIs it needs.
  • Frontend (packages/desktop/src): plain TypeScript + Tailwind on Vite, the same approach as the extension's settings page. All logic that isn't DOM wiring lives in small pure modules with unit tests:
    • secret.ts builds the Client.create input, the share URL (same shape as web: key in the fragment, ?p=true for passwords) and maps errors.
    • settings.ts validates settings per field.
    • shortcut.ts records keyboard input as an accelerator and formats it for display.
    • i18n.ts is a small i18next-compatible lookup over the core locales, with {{var}} interpolation and plurals.
  • Rust (src-tauri/src/lib.rs): only the tray, window lifecycle (close hides the window), single-instance handling and plugin setup. The tray is built natively so the app can always be reopened or quit, even if the webview fails to load. The frontend localizes its labels through one set_tray_labels command.
  • Workspace: build, lint, typecheck and test cover the frontend only, so the normal pnpm pipeline and CI need no Rust. There is no dev script, so the root pnpm dev doesn't need Rust either. tauri:dev and tauri:build are separate scripts. The version comes from package.json, and the package joins the changesets fixed group so it stays in step with the others.
  • New Desktop workflow (.github/workflows/desktop.yml): builds on macOS (arm64 and x64), Windows and Linux with tauri-apps/tauri-action@v1 and uploads the installers as workflow artifacts. It also runs cargo fmt --check and cargo clippy -D warnings. It runs only when desktop, core, theme or the lockfile change.

Security notes

  • Zero-knowledge is unchanged. Key generation, compression, encryption and the verification hash all happen in the webview through @crypt.fyi/core's Client. The server gets ciphertext and the hash only. No secret, key or password crosses IPC into Rust.
  • Nothing secret is persisted. Only preferences go to local storage. Content, password and link are cleared from the form whenever the window hides (Esc, shortcut, close, after a create). Notifications never include the link, because notification centers keep a history. Errors show only a status code or the API host, never a raw error message.
  • Least-privilege capability (capabilities/default.json): clipboard read/write text, global-shortcut register/unregister, notifications, and show/hide/focus for its own window. There is no fs, shell, process, opener or HTTP plugin. API requests use the webview's fetch, bounded by CSP.
  • Strict CSP in tauri.conf.json: default-src 'self', script-src 'self', style-src 'self' (no unsafe-inline in production builds; devCsp relaxes styles only for Vite HMR), object-src/frame-src/form-action/base-uri set to 'none', and freezePrototype: true.
    • connect-src is https: plus http on loopback only, because the API URL is user-configurable (self-hosting).
    • Settings validation enforces the same rule and rejects credentials, query strings or fragments in endpoints.
  • withGlobalTauri: false.

Testing

Verified locally (Windows, Node 22):

  • pnpm install, pnpm format:check, pnpm lint, pnpm typecheck: all pass.
  • pnpm --filter @crypt.fyi/desktop test: 58 tests pass.
  • Web, theme and extension tests pass. Core tests pass (65) when run with an explicit --testMatch.
    • On this Windows worktree path, core's and cli's jest testMatch finds no files. That's an existing environment quirk, unrelated to this change. CI runs on Linux.
  • pnpm --filter @crypt.fyi/desktop build: the frontend bundle has no inline scripts or styles.
  • Rendered the frontend in a browser with mocked Tauri internals to check the create and settings layouts and the translations.

Not verified locally:

  • Rust: no cargo on this machine, so cargo check/clippy and the native app weren't run here. The new Desktop workflow on this PR compiles, lints and bundles it on all four targets; see its checks.
  • Manual end-to-end on real OSes: tray, global shortcut, clipboard and notifications on macOS, Windows and Linux (X11/Wayland).
  • Gaps / follow-ups:
    • Installers are unsigned (Gatekeeper/SmartScreen warnings) and there is no auto-update or launch-at-login.
    • Release publishing of installers isn't wired up; artifacts are only attached to workflow runs.
    • Advanced extension options (IP allow-list, read/failure counts, webhooks) aren't exposed yet.

Tauri 2 tray/menu-bar app for macOS, Windows and Linux. A configurable
global shortcut opens a quick-create window prefilled from the clipboard;
the secret is encrypted in the webview with @crypt.fyi/core and the link
replaces the clipboard contents, confirmed by a notification.

Adds desktop translations to every locale, a Desktop workflow that builds
the app on all three platforms, and docs.
@dillonstreator
dillonstreator merged commit a42dd0f into main Nov 23, 2026
12 checks passed
@dillonstreator
dillonstreator deleted the feat/desktop-app branch November 23, 2026 15:38
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
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.

cross-platform native app

1 participant