Repository navigation
refactor(desktop): move the desktop shell from Tauri to Electron - #185
Merged
Merged
Conversation
…ocument how to run it
…top shells The terminal moves from the Rust shell (portable-pty) into the sidecar (Bun's built-in PTY), so the Tauri and Electron shells share one implementation. Each terminal is one WebSocket at /terminal; default shell detection and bash path validation are /api/terminal routes. Both are limited to local-trusted requests. The sidecar reads the terminal settings it already stores instead of receiving them on every spawn. The sidecar launcher now merges the login shell environment into its own environment, which the Rust shell used to do when starting it, so the Electron shell gets the same PATH without its own copy. Part of #174, #173 item 3.
…ri shell - App mode and portable mode: the config directory is resolved once at startup from app-mode.json next to the executable or in the Tauri app config directory, and passed to the sidecar. Switching modes writes app-mode.json in the same places and format as before. With a config directory, Chromium's data lives in <config>/Electron. - Window state is read from and written to the existing window-state.json in physical pixels, restored only when it fits on a display, including the maximized state. - macOS application menu (About, Settings, Edit, View, Window), a tray with Show and Quit, closing hides to the tray, single instance. - Title areas move the window through CSS app-region drag regions. - Session export, update install preparation, dropped file paths through webUtils, and main-process errors without the IPC wrapper text. - Update checks report that updates are not configured, as Tauri's updater did without endpoints. - desktop lint also type-checks the Electron main process. Part of #174.
Notifications go through Electron's Notification. Clicking one brings the window forward and sends the notification's target back to the page, which opens the session as before. Windows gets an AppUserModelId so toasts show. Electron has no notification permission query on macOS, so permission reads as granted wherever notifications are supported and macOS asks on the first notification. Part of #174.
…ilder - electron-builder builds the macOS Apple Silicon dmg and the Windows x64 NSIS installer, with the same artifact names as before. The sidecar and ripgrep go to Resources/bin; the macOS entitlements keep JIT for the sidecar under the hardened runtime. The NSIS hooks stop running sidecars before installing and uninstalling, as the Tauri hooks did. - The release workflow builds with electron-builder instead of Tauri. Without signing secrets, macOS builds are ad-hoc signed and Windows builds unsigned, as today; with MACOS_CSC_LINK, APPLE_* and WINDOWS_CSC_LINK set, they are signed and the macOS app is notarized. - The installer smoke test looks for the sidecar and ripgrep under Resources/bin and finds the Windows app by its executable name. - The sidecar build detects the host target without rustc, and the release script reads the current version from desktop/package.json. Part of #174.
- lib/shell is the Electron implementation; the Tauri implementation, the build-time shell switch, desktop/src-tauri, the @tauri-apps packages and the Tauri build scripts are gone. isTauriRuntime is now isDesktopRuntime and detects the preload bridge. - Shell calls reject instead of throwing when the page has no bridge, as the Tauri calls did, so the H5 page keeps working. - Window dragging uses CSS drag regions on the title areas; dropped files are read from the DOM drop with their paths from the preload. - The packaged page gets the same content security policy Tauri set. The startup watchdog moves from an inline script to public/startup-guard.js so the policy allows it. - The server trusts the dreamcoder://localhost origin instead of the Tauri origins and finds the H5 build next to the sidecar folder. - Sidecar binaries build into desktop/binaries and icons live in desktop/electron/build. bun run electron:dev starts Vite and Electron together; bun run electron:install fetches the Electron binary. Development builds open the developer tools with F12. - A missing sidecar binary shows the startup error instead of crashing the main process. - README, CONTRIBUTING, TROUBLESHOOTING, AGENTS.md and the CHANGELOG describe the Electron app. Closes #174.
…ory files - macOS: the traffic lights line up with the sidebar toggle, and the toggle floating over the title bar is no longer a window drag region, so clicks reach it. - Settings pages leave room for the close button at the top right. - The memory API answers 404 for a memory file that does not exist instead of a 500, and a chat link to a missing memory file selects its project without an error.
Treat Electron as the only shell the app has had: - app-mode.json lives in the active config directory and Electron's user data folder instead of the Tauri app config directory. - Window state is stored in Electron's screen coordinates in the user data folder, so windows on displays with different scale factors restore where they were. - The terminal-config.json migration, its launcher variable and EBWebView portable-data detection are gone. Review fixes: - macOS reports notification permission as managed by system settings, since Electron cannot read it, and Open Settings opens the notification pane on macOS as well as Windows. - The login-shell environment timeout bounds the whole read, so a child process that keeps the shell's output open cannot delay sidecar startup. - A dropped terminal connection is shown with a translated message. - Tests cover terminal routes for authorized H5 clients with H5 enabled, and the portable folder name as a fixed value.
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the desktop app from Tauri to Electron, as decided in #174, and removes Tauri. Electron is the only desktop shell; nothing keeps compatibility with files the Tauri shell wrote.
Closes #174
Closes #173
Why
The #172 measurements showed WKWebView on macOS laying out a streaming reply about 20x slower than Chromium (about 20 ms per update, 265 ms at the slow end, against about 1 ms). The spike results are in #174 (comment) and the decisions in #174 (comment).
What changed
src/server/services/terminalService.tsruns the PTY with Bun (openptyon macOS, ConPTY on Windows) and ports the shell resolution, login-shell environment, UTF-8 locale and Bash path check from Rust./terminal, plusGET /api/terminal/default-shellandPOST /api/terminal/validate-bash-path.desktop/electron). It covers:dreamcoder://protocol with a content security policy.desktop/src/lib/shell..dmgand a Windows x64 NSIS installer.release.ymlandsmoke-test.ymlbuild and check them; Rust is no longer needed.desktop/src-tauri, the@tauri-apps/*packages, the Tauri scripts and Vite plugin,useWindowDrag, and theterminal-config.jsonmigration from refactor(desktop): thin the shell and route all shell calls through one module #179.app-region.desktop/electron/README.md, CONTRIBUTING, TROUBLESHOOTING, ROADMAP, WEB_USAGE and AGENTS.md. A CHANGELOG[Unreleased]entry says what upgrading users will see:How I tested
bun test: 1428 pass, 0 fail.cd desktop && bun run lint: clean. It now also type-checksdesktop/electron.bun run test -- --run: 125 files, 1320 passed, 4 skipped.--randomize --seed=1.bun run electron:dev):.dmg, built atddbbdcb, before the last two commits:codesign --verify --deep --strictpasses, and the sidecar hasallow-jit;/api/status,/api/sessionsand the ripgrep search work;3dc46dd.Not verified
release.yml, which builds both installers.bun testCI runs on Ubuntu only. The Windows smoke test does not open a terminal yet.