feat(desktop): URL editor, tray, Linux bundles, cookie fix (LC-123) #124
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/desktop-clients"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Continues LC-123 (Tauri 2 desktop migration). Closes the biggest desktop usability gaps: the binary now ships with a URL editor on its welcome page (no more "set env var and restart"), a system tray icon, the notification plugin wired up for future server-side calls, and proper Linux
.deb+.AppImagebundles. Also fixes a silent login bug where WebKit2GTK rejected the session cookie onhttp://localhostbecause of the unconditionalSecureflag.LC-123 has been reopened to In Progress with an audit comment listing what is now done vs. carved out into child issues LC-126..LC-132.
Changes
server/
state.rs: newAppState::cookies_secure()returningbase_url.starts_with("https://"). Used to gate theSecureattribute on auth cookies so plain-HTTP dev (defaulthttp://localhost:8080base URL) stops getting cookies silently dropped by WebKit2GTK.routes/auth.rs,routes/two_factor.rs: threadsecure: boolthrough all four cookie builders (build_session_cookiex2,build_pending_cookie,build_pending_registration_cookie) and passstate.cookies_secure()at every call site. Tests already constructAppStateby hand and do not call the cookie builders directly, so no test changes were required.desktop/
src/config.rs(new): persists the chosen server URL todirs::config_dir()/lets-chat-desktop/config.json($XDG_CONFIG_HOMEon Linux,%APPDATA%on Windows, Application Support on macOS once that target lands). Precedence on startup:LETS_CHAT_SERVER_URLenv var, then this config file, then the built-in default.src/main.rs: adds theset_server_urlIPC command, the Tauri 2 system tray (Show / Quit menu, left-click focuses the main window, right-click opens the menu), and registerstauri-plugin-notificationso the lets-chat server pages can callinvoke('plugin:notification|notify', { title, body })once that server-side integration lands.src/welcome.html: rewritten to include a URL editor with a blue "If you are runningjust dev-web-local, usehttp://localhost:18080" hint and a one-click fill, plus an always-visible status line so a click on "Save & connect" can never silently no-op. JS useswindow.__TAURI_INTERNALS__.invokedirectly (Tauri 2 injects only that surface;window.__TAURI__.corewould require bundling the JS package) and falls back to a plain navigation if the IPC bridge is unavailable, so the user can always connect.src/welcome.rs:server_reachablenow treats HTTP 4xx/5xx as unreachable, not just network errors, so a wrong-port server returning a Problem+JSON 404 renders the welcome page instead of the raw JSON.Cargo.toml: addsdirs,tauri-plugin-notification, and thetray-icon+image-pngTauri features.capabilities/default.json: addsnotification:default.tauri.conf.json: enables bundling (bundle.active: true,targets: ["deb", "appimage"]), declares categorySocialNetworking, icons, publisher, dependencies.icons/icon-square-{32,64,128,256}.png(new): square padded versions of the existingicon.png(which is 256x143). The Tauri 2 AppImage bundler refuses to run without at least one square icon. The originalicon.pngis left untouched; replace these padded versions when a proper square logo asset is available.ci-build/
Dockerfile.desktop-linux-bundles(new): installstauri-cli2.x and runscargo tauri build --bundles deb,appimageto produce the bundles alongside the binary. ExistingDockerfile.desktop-linuxis left alone so binary-only iteration stays fast.justfile
build-desktop-linuxandbuild-desktop-windowsrecipes: switched fromnushebang tobashbecause{{ docker_version_args }}contains$(git ...)substitutions that only bash evaluates; the previous nu shebang was baking the literal$(git rev-parse ...)string into the binary asGIT_HASH.build-desktop-linux-bundles(new): builds via the bundle Dockerfile, extracts the binary plus the.deband.AppImageintoartifacts/..gitignore
artifacts/(local bundle output).LC-123 acceptance criteria progress
LETS_CHAT_SERVER_URLcontrols target servergetUserMediaworks on 5 targetsgetDisplayMediaon Windows + macOS.deb+.AppImageworks; CI workflow update LC-132; Windows.msiLC-131; macOS.dmgLC-126Test plan
just check(fmt + standalone + saas + clippy)just test(standalone, 53 binaries, all green)just test-saas(saas, all green)just build-desktop-linuxproduces a 17M binary with embeddedGIT_HASH/GIT_VERSION(no more literal$(git ...)string)just build-desktop-linux-bundlesproducesartifacts/bundle-linux/lets-chat_0.1.0_amd64.deb(5.4M) andlets-chat_0.1.0_amd64.AppImage(100M, includes bundled GTK/WebKit/glibc)~/.config/lets-chat-desktop/config.jsonand navigates on success, alert updates in place on failurejust dev-web-localoverhttp://localhost:18080(was broken pre-cookie-fix)Followups
The remaining LC-123 acceptance criteria are each tracked as
subtask ofLC-123:.dmgbundling.apk+.aab).ipa)getUserMediapermission hooks across all 5 platformsgetDisplayMedia(screen share) for Windows + macOS.msibundle infrastructure.deb+.AppImageto the Generic Packages registryLC-123 itself stays In Progress until those close or get explicitly deferred.
References: LC-123, LC-126, LC-127, LC-128, LC-129, LC-130, LC-131, LC-132.