Files
Lumotia/docs/architecture-map/02-tauri-runtime/tauri-config.md
Jake 26c7307607
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
agent: lumotia-rebrand — docs, scripts, root config, residuals
Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.

transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
  -> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
  as immutable audit trail). Includes architecture-map references
  to magnotia_core::*, magnotia_storage::*, etc. now pointing at
  lumotia_*; dev-setup.md tracing output examples (lumotia_startup
  target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
  audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
  hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
  crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
  crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
  doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
  ("lumotia_task_sync"); magnotia_locale i18n localStorage key
  renamed + migration shim added; CSS keyframe names
  magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
  system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
  keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
  wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
  to "lumotia era" earlier — restored).

Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
  legacy detection strings in legacy_and_target_paths() so the
  migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
  — migration call sites reference the legacy magnotia keys
  deliberately.
- docs/handovers/ — historical audit trail.

cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:38:03 +01:00

5.5 KiB
Raw Blame History

name, type, slice, last_verified
name type slice last_verified
Tauri config architecture-map-page 02-tauri-runtime 2026/05/09

Tauri config

Where you are: Architecture mapTauri runtime → Tauri config

Plain English summary. The base tauri.conf.json declares the bundle identity, the main window size and chrome, the Content Security Policy, and the icons. The Linux overlay flips the main window from frameless to native-decorations, because Tauri's frameless path on Wayland does not honour diagonal resize reliably and webkit2gtk's drag-region adds latency.

At a glance

  • Paths: src-tauri/tauri.conf.json (43 LOC), src-tauri/tauri.linux.conf.json (17 LOC).
  • Identifier: uk.co.corbel.lumotia.
  • Tauri version targeted: schema https://schema.tauri.app/config/2.
  • Main window labels: main (defined here), plus tasks-float, transcript-viewer, transcription-preview (built imperatively from commands::windows).
  • Frontend: npm run dev:frontend for dev (port 1420), npm run build produces ../build for release.
  • Tauri commands exposed: none (config files only).
  • Events emitted: none.
  • Depends on: nothing at runtime; consumed by tauri-build in build.rs and by build.rs::assert_loopback_llm_csp (build-time CSP regression guard).
  • Called from frontend at: the dev URL is what vite ships to during cargo tauri dev.

What's in here

tauri.conf.json

productName: "Lumotia"
version: "0.1.0"
identifier: "uk.co.corbel.lumotia"

build

beforeDevCommand: "npm run dev:frontend"
devUrl:           "http://localhost:1420"
beforeBuildCommand: "npm run build"
frontendDist:     "../build"

app.windows[0]

The main window. Title "Lumotia", 1020×720 (min 960×600), centred, resizable, frameless (decorations: false). The Linux overlay flips this to decorations: true.

app.security.csp

default-src 'self';
script-src  'self';
style-src   'self' 'unsafe-inline';
img-src     'self' asset: https://asset.localhost;
connect-src ipc: http://ipc.localhost
            asset: https://asset.localhost
            http://127.0.0.1:* ws://127.0.0.1:*;
media-src   'self' asset: https://asset.localhost

The two http://127.0.0.1:* and ws://127.0.0.1:* entries are pinned by the build-time guard in src-tauri/build.rs:30. They must stay (so the bundled llama.cpp server / a BYO Ollama install can be fetch()-ed from the webview), and localhost:* must stay forbidden (so endpoints normalise to a single name and are never bypassed by the resolver). See Tests for the runtime assertion.

'unsafe-inline' is permitted for style-src because Svelte injects component-scoped styles; without it, every <style> element would need a nonce. script-src 'self' keeps inline scripts forbidden.

bundle

active: true, targets: "all", icons listed: icons/32x32.png, icons/128x128.png, icons/128x128@2x.png, icons/icon.icns, icons/icon.ico. bundle.android.minSdkVersion: 24.

tauri.linux.conf.json

Tauri 2 merges per-platform overlays on top of the base config when the build target is detected. The Linux overlay re-declares app.windows[0] with the same dimensions as the base config but with decorations: true. This is the only difference. Reasons documented inline in commands::windows::open_task_window (src-tauri/src/commands/windows.rs:58): on Wayland the frameless path mishandles resize edges and adds drag latency; native KWin / Mutter decorations are reliable.

Data flow

  • tauri-build::build() consumes the config at compile time to generate the inline runtime context.
  • build.rs::assert_loopback_llm_csp parses tauri.conf.json and asserts the connect-src directive includes the loopback entries. A regression breaks compilation, not just tests.
  • WebviewWindowBuilder calls in commands::windows re-declare the secondary windows imperatively rather than adding them here, because they need preferences-injection, conditional decorations, GTK type-hints, and skip-taskbar / always-on-top settings that the static config can't express. The secondary-windows capability (see Capabilities and ACL) is what binds them to the same allowlist.

Watch-outs

  • Don't add localhost:* to connect-src. The build will fail at compile time. Use 127.0.0.1:*.
  • Don't add new *.localhost entries unless they pair with a Tauri-managed asset URL. Adding wildcards weakens CSP without giving up much in return.
  • The frontendDist is a relative path resolved from src-tauri/. Moving the frontend out of ../build requires updating both this and package.json's build script.
  • The bundle identifier is the macOS bundle ID and the Android applicationId. Changing it after a release would orphan installed apps from updates.
  • The base config has decorations: false; macOS and Windows pick that up. macOS gets a custom Titlebar component drawn by Svelte. Windows would too if you ever ship a Windows build (none today).

See also

  • App lifecycle — the main window is fetched here via app.get_webview_window("main").
  • Capabilities and ACL — pairs with the CSP to constrain what the JS can call.
  • Cargo and featuresbuild.rs is what enforces the CSP at build time.
  • Testscsp_keeps_loopback_narrow regression-tests the same property at runtime.
  • Window management — the imperative builder for tasks-float / transcript-viewer / transcription-preview.