Add desktop workspace open flow#2544
Conversation
- launch the installed desktop app from `t3 --app` - forward workspace paths from Electron to the web UI - bootstrap new projects when opening a missing workspace
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| const bootstrapWorkspacePath = pendingOpenWorkspacePath; | ||
| pendingOpenWorkspacePath = null; | ||
| const captureBackendLogs = !isDevelopment; |
There was a problem hiding this comment.
🟡 Medium src/main.ts:1513
pendingOpenWorkspacePath is cleared to null at line 1514 before the backend process is confirmed to be running. If the backend crashes immediately and triggers a restart (lines 1589 or 1610), the workspace path is already lost, so the restarted backend opens without the user's intended workspace. Consider only clearing pendingOpenWorkspacePath after the backend successfully signals it is listening.
- const bootstrapWorkspacePath = pendingOpenWorkspacePath;
- pendingOpenWorkspacePath = null;
const captureBackendLogs = !isDevelopment;🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/desktop/src/main.ts around lines 1513-1515:
`pendingOpenWorkspacePath` is cleared to `null` at line 1514 before the backend process is confirmed to be running. If the backend crashes immediately and triggers a restart (lines 1589 or 1610), the workspace path is already lost, so the restarted backend opens without the user's intended workspace. Consider only clearing `pendingOpenWorkspacePath` after the backend successfully signals it is listening.
Evidence trail:
apps/desktop/src/main.ts lines 1513-1514: pendingOpenWorkspacePath captured and cleared. Lines 1538-1540: value written to bootstrap stream. Lines 1575-1590 (child.on('error')): calls scheduleBackendRestart(). Lines 1592-1611 (child.on('exit')): calls scheduleBackendRestart(). Lines 1460-1470 (scheduleBackendRestart): calls startBackend() after delay. Line 244: initial assignment from CLI args. Line 612: assignment in dispatchOpenWorkspace(). No other assignments — nothing in the restart path restores the value.
| import { Prompt } from "effect/unstable/cli"; | ||
| import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; | ||
|
|
||
| const DESKTOP_APP_NAMES = ["T3 Code (Alpha)", "T3 Code (Nightly)"] as const; |
There was a problem hiding this comment.
🟠 High src/desktopAppLauncher.ts:5
On macOS, desktopAppLaunchCommands uses DESKTOP_APP_NAMES which only contains ['T3 Code (Alpha)', 'T3 Code (Nightly)'], but the Windows PowerShell script hardcodes all three variants including the stable 'T3 Code'. This means macOS users with the stable release installed will be told the app is not installed and prompted for fallback options, even though the app exists. Consider adding 'T3 Code' to DESKTOP_APP_NAMES so macOS tries the stable release name.
-const DESKTOP_APP_NAMES = ["T3 Code (Alpha)", "T3 Code (Nightly)"] as const;
+const DESKTOP_APP_NAMES = ["T3 Code", "T3 Code (Alpha)", "T3 Code (Nightly)"] as const;🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/server/src/desktopAppLauncher.ts around line 5:
On macOS, `desktopAppLaunchCommands` uses `DESKTOP_APP_NAMES` which only contains `['T3 Code (Alpha)', 'T3 Code (Nightly)']`, but the Windows PowerShell script hardcodes all three variants including the stable `'T3 Code'`. This means macOS users with the stable release installed will be told the app is not installed and prompted for fallback options, even though the app exists. Consider adding `'T3 Code'` to `DESKTOP_APP_NAMES` so macOS tries the stable release name.
Evidence trail:
apps/server/src/desktopAppLauncher.ts line 5: DESKTOP_APP_NAMES only contains Alpha and Nightly. Line 6: DESKTOP_APP_NAME = 'T3 Code' defined but unused for launch. Lines 60-63: macOS uses DESKTOP_APP_NAMES.map(). Line 68: Windows PowerShell includes 'T3 Code' in $names. Commit: REVIEWED_COMMIT.
t3 --appWhat Changed
Why
UI Changes
Checklist
Note
Add desktop workspace open flow via
--t3-open-pathCLI arg anddesktop:open-workspaceIPC--t3-open-pathCLI flag to the desktop Electron main process; on launch it resolves the path, passescwdandautoBootstrapProjectFromCwdto the backend, and sends adesktop:open-workspaceIPC event to the renderer window.t3launches route--t3-open-pathto the existing window instead of starting a new instance.--appflag to the server CLI (apps/server/src/cli.ts) that attempts to launch the desktop app via platform-specific commands, with an interactive fallback to open GitHub releases, start the web UI, or exit.DesktopOpenWorkspaceBootstrapto the web app root route; it handlesdesktop:open-workspaceevents by finding or creating a project and thread for the given path, then navigating to that thread.DesktopBridgecontract withonOpenWorkspaceand updates all stubs and the preload bridge accordingly.📊 Macroscope summarized e8f6c83. 7 files reviewed, 2 issues evaluated, 0 issues filtered, 2 comments posted
🗂️ Filtered Issues