Skip to content

Add desktop workspace open flow#2544

Draft
juliusmarminge wants to merge 1 commit intomainfrom
feature/desktop-workspace-open
Draft

Add desktop workspace open flow#2544
juliusmarminge wants to merge 1 commit intomainfrom
feature/desktop-workspace-open

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 6, 2026

  • 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

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add desktop workspace open flow via --t3-open-path CLI arg and desktop:open-workspace IPC

  • Adds a --t3-open-path CLI flag to the desktop Electron main process; on launch it resolves the path, passes cwd and autoBootstrapProjectFromCwd to the backend, and sends a desktop:open-workspace IPC event to the renderer window.
  • Enforces single-instance locking so subsequent t3 launches route --t3-open-path to the existing window instead of starting a new instance.
  • Adds --app flag 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.
  • Adds DesktopOpenWorkspaceBootstrap to the web app root route; it handles desktop:open-workspace events by finding or creating a project and thread for the given path, then navigating to that thread.
  • Extends the DesktopBridge contract with onOpenWorkspace and 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

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1fd07308-838a-4e59-a08e-41932a5c24cc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/desktop-workspace-open

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels May 6, 2026
Comment thread apps/desktop/src/main.ts
Comment on lines +1513 to 1515
const bootstrapWorkspacePath = pendingOpenWorkspacePath;
pendingOpenWorkspacePath = null;
const captureBackendLogs = !isDevelopment;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant