Windows, Menus & Tray
Custom chrome, restored window state, JS-built menus, and tray behavior.
The starter owns desktop chrome in Tauri APIs and TypeScript. decorations: false in tauri.conf.json lets src/components/window/ draw the draggable
titlebar and controls; only the enumerated core-window permissions can perform
native actions. On Windows, right-click/Alt+Space calls the single
show_window_system_menu Rust command.
tauri-plugin-window-state saves and restores size, position, and maximized
state automatically; the configured initial size is only the first-run default.
Menus, tray, and launch
src/lib/menu/app-menu.ts and src/lib/tray/app-tray.ts build native menus in
JavaScript with Tauri v2 APIs. Labels use i18next directly, so there is no
separate native i18n layer. The Template menu follows features.showcase; update
items follow features.autoUpdate. This is why one flag reaches webview, menu,
and tray in Tauri.
The tray is created as the shell initializes and its menu refreshes with
settings/update state. minimizeToTray is off by default; when enabled, close
can hide the window rather than quit. Tray art lives in resources/; Rust enables
the needed tray-icon and image-png features.
launchAtLogin controls tauri-plugin-autostart; its registered launch args
include --hidden. Webview zoom is persisted in settings and clamped from -3 to
3.
Guarded navigation
Menus and tray use the same NAVIGATION_ROUTES allow-list as deep links. For
outbound links, openExternalUrl() validates https: or mailto:, Rust repeats
the scheme check, and the capability scopes the opener. The webview cannot
navigate itself off the app because CSP and ACL enforce the boundary together.
