-
Notifications
You must be signed in to change notification settings - Fork 45
feat(desktop): add cloud workspaces using yolocode.ai integration #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ation - add CloudSandbox type and cloudSandbox field to Worktree - create cloud-api-client.ts for yolocode E2B sandbox API (uses gh token auth) - add cloud-sandbox-create and cloud-sandbox-delete IPC channels - add New Cloud Terminal button in TabsView with blue styling - extract github repo URL from local repo path using git remote
…ow local terminals
- add WebView tab type with url field - create WebView component (iframe wrapper) - create WebViewTabView to render webview tabs - update tab store to support url and title options - add 'New Cloud Agent' button (claude chat UI at port 7030) - add 'New Cloud Terminal' button (webssh at port 8888) - both open as embedded iframe tabs instead of browser windows
- add CloudWorkspaceButton component with blue cloud icon - creates workspace with two webview tabs: Cloud Agent (7030) + Cloud Terminal (8888) - remove cloud buttons from TabsView sidebar (now in header) - cloud workspaces are created via dropdown menu like regular workspaces
… URLs iframe was blocked by electron security. webview tag is the proper way to embed external content in electron apps.
adds ?hostname=localhost&username=user to webssh URL so user doesn't have to manually enter connection details for the e2b sandbox
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR adds cloud sandbox creation and management to the desktop app. It introduces a CloudApiClient for cloud API interaction, IPC handlers for sandbox operations, new WebView tab support for embedded web content, and UI components for creating and managing cloud workspaces with integrated terminal and agent interfaces. Changes
Sequence DiagramsequenceDiagram
participant User
participant CloudWorkspaceButton as CloudWorkspaceButton<br/>(Renderer)
participant TabsStore as TabsStore<br/>(Renderer)
participant IPC as IPC Channel
participant CloudHandlers as Cloud Handlers<br/>(Main Process)
participant CloudApiClient as CloudApiClient<br/>(Main Process)
participant CloudAPI as Cloud API<br/>(External)
participant GitHub as GitHub CLI
User->>CloudWorkspaceButton: Click "Create Cloud Workspace"
CloudWorkspaceButton->>TabsStore: addTab(workspaceId, TabType.Single)
TabsStore-->>CloudWorkspaceButton: workspace created
CloudWorkspaceButton->>CloudWorkspaceButton: Derive GitHub repo URL<br/>from project
CloudWorkspaceButton->>IPC: send "cloud-sandbox-create"<br/>{name, projectId, taskDescription}
IPC->>CloudHandlers: Handle cloud-sandbox-create
CloudHandlers->>CloudHandlers: Validate project exists<br/>Get mainRepoPath
CloudHandlers->>CloudHandlers: Infer GitHub HTTPS URL<br/>from git origin
CloudHandlers->>CloudApiClient: createSandbox(params)
CloudApiClient->>GitHub: gh auth token (via CLI)
GitHub-->>CloudApiClient: auth token
CloudApiClient->>CloudAPI: POST /sandbox<br/>(auth token, repo, env vars)
CloudAPI-->>CloudApiClient: CloudSandbox object
CloudHandlers-->>IPC: response {success, sandbox}
IPC-->>CloudWorkspaceButton: sandbox created
CloudWorkspaceButton->>TabsStore: addTab(workspaceId,<br/>TabType.WebView, {url: agentURL})
TabsStore-->>CloudWorkspaceButton: Cloud Agent tab created
CloudWorkspaceButton->>TabsStore: addTab(workspaceId,<br/>TabType.WebView, {url: terminalURL})
TabsStore-->>CloudWorkspaceButton: Cloud Terminal tab created
CloudWorkspaceButton-->>User: Workspace ready with<br/>Cloud Agent & Terminal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (7)
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsx (2)
59-118: Cloud sandbox creation flow is solid, but consider routing IPC through tRPCThe overall flow (create workspace → invoke
cloud-sandbox-create→ open WebView tabs → toast success/failure) is clean and well-guarded withisCreatingand error handling. However, per the desktop guidelines, Electron IPC should go through the tRPC layer rather than callingwindow.ipcRenderer.invokedirectly. It would be preferable to expose acloudSandbox.createprocedure insrc/lib/trpcand call that here so IPC contracts remain centralized and typed in one place.
148-188: Recent projects list UI looks good; consider avoiding inline project typingThe recent-projects dropdown rendering and disabled states are wired correctly. To avoid potential drift from the backend type, you might want to derive the
projectshape fromtrpc.projects.getRecents’s inferred output type instead of repeating{ id; name; mainRepoPath }inline, but that’s purely a nicety.apps/desktop/src/renderer/stores/tabs/types.ts (1)
6-7: WebView tab typing aligns with creation logic; consider reusingCreateTabOptionsAdding
TabType.WebView,WebViewTab, and extending theTabunion all look consistent with thecreateNewTabimplementation and the new WebView UI. To keep things DRY, you could reuse theCreateTabOptionstype here instead of redefining{ url?: string; title?: string }in theaddTabsignature.Please also verify that all places switching on
tab.typenow handleTabType.WebViewto avoid unhandled variants at runtime.Also applies to: 22-25, 32-32, 41-45
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx (1)
15-20: Consider toning down logging and revisitingallowpopupsThe
console.log/console.errorcalls on every webview load/failure may be a bit noisy in production; consider routing through whatever logging/debug mechanism you use elsewhere or gating behind a dev flag. Also,allowpopups="true"broadens what the embedded content can do—please double-check that you really need popups enabled for these cloud views.Also applies to: 33-39
apps/desktop/src/main/lib/cloud-api-client.ts (3)
37-53: Synchronousgh auth tokencan block the main thread; consider caching or asyncUsing
execSync("gh auth token")on eachcreateSandbox/deleteSandboxcall will block the Electron main process while the CLI runs, which can momentarily freeze the UI. Caching the token for the app lifetime or switching to an async child_process call (or direct config file read) would reduce this impact.
37-38: Hard-coded staging URL and missing timeouts make the client environment-sensitiveThe client is currently pinned to
https://staging.yolocode.ai/api/e2b-sandboxes, and thefetchcalls don’t use any timeout/abort handling. Before shipping broadly, it’d be safer to drivebaseUrlvia configuration (env or build-time flag) and add a simple timeout (e.g.,AbortController) so a hung network call doesn’t indefinitely block IPC responses.Also applies to: 69-85, 97-115, 158-171
117-132: CloudSandbox mapping is straightforward; status and claudeHost rewrite are assumptionsThe mapping from
CreateSandboxResponsetoCloudSandboxis clear, but it hardcodesstatus: "running"and rewritesclaudeHostto port 7030 regardless of what the API returns. If the backend ever reports more nuanced statuses or changes its port scheme, you may want to derivestatusfromdata.statusand make the port rewrite conditional or driven by config.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
apps/desktop/src/main/index.ts(2 hunks)apps/desktop/src/main/lib/cloud-api-client.ts(1 hunks)apps/desktop/src/main/lib/cloud-ipcs.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx(1 hunks)apps/desktop/src/renderer/stores/tabs/helpers/tab-crud.ts(1 hunks)apps/desktop/src/renderer/stores/tabs/store.ts(1 hunks)apps/desktop/src/renderer/stores/tabs/types.ts(3 hunks)apps/desktop/src/renderer/stores/tabs/utils.ts(4 hunks)apps/desktop/src/shared/ipc-channels/worktree.ts(2 hunks)apps/desktop/src/shared/types.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/stores/tabs/types.tsapps/desktop/src/shared/ipc-channels/worktree.tsapps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-api-client.tsapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/main/lib/cloud-ipcs.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/shared/types.tsapps/desktop/src/renderer/stores/tabs/store.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsxapps/desktop/src/renderer/stores/tabs/helpers/tab-crud.tsapps/desktop/src/renderer/stores/tabs/utils.ts
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/stores/tabs/types.tsapps/desktop/src/shared/ipc-channels/worktree.tsapps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-api-client.tsapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/main/lib/cloud-ipcs.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/shared/types.tsapps/desktop/src/renderer/stores/tabs/store.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsxapps/desktop/src/renderer/stores/tabs/helpers/tab-crud.tsapps/desktop/src/renderer/stores/tabs/utils.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid usinganytype - use explicit types instead for type safety
Use camelCase for variable and function names following existing codebase patterns
Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications
Follow existing patterns and match the codebase style when writing new code
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/stores/tabs/types.tsapps/desktop/src/shared/ipc-channels/worktree.tsapps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-api-client.tsapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/main/lib/cloud-ipcs.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/shared/types.tsapps/desktop/src/renderer/stores/tabs/store.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsxapps/desktop/src/renderer/stores/tabs/helpers/tab-crud.tsapps/desktop/src/renderer/stores/tabs/utils.ts
**/components/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
**/components/**/*.tsx: Create one folder per component with structure:ComponentName/ComponentName.tsx+index.tsfor barrel export
Co-locate tests next to the component file they test (e.g.,ComponentName.test.tsx)
Co-locate dependencies (utils, hooks, constants, config, stories) next to the file using them
Use nestedcomponents/subdirectory within a parent component only if a sub-component is used 2+ times within that parent; otherwise keep it in the parent'scomponents/folder
One component per file - avoid multi-component files
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules (fs, path, os, net, etc.) in renderer process code - browser environment only
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/stores/tabs/types.tsapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/renderer/stores/tabs/store.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsxapps/desktop/src/renderer/stores/tabs/helpers/tab-crud.tsapps/desktop/src/renderer/stores/tabs/utils.ts
apps/desktop/src/renderer/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Call IPC methods using
window.ipcRenderer.invoke()with object parameters - TypeScript will infer the exact response type automatically
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsxapps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx
apps/desktop/src/main/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Node.js modules (fs, path, os, net, etc.) can be used in main process code only
Files:
apps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-api-client.tsapps/desktop/src/main/lib/cloud-ipcs.ts
apps/desktop/src/main/index.ts
📄 CodeRabbit inference engine (AGENTS.md)
Load
.envfile withoverride: trueat the start of the main process before any imports
Files:
apps/desktop/src/main/index.ts
apps/desktop/src/main/lib/*-ipcs.ts
📄 CodeRabbit inference engine (AGENTS.md)
IPC handlers must accept a single object parameter, not positional parameters, to match type-safe renderer calls
Files:
apps/desktop/src/main/lib/cloud-ipcs.ts
🧠 Learnings (10)
📚 Learning: 2025-11-24T21:33:13.244Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.244Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible
Applied to files:
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/shared/ipc-channels.ts : Define all IPC channel types with request and response interfaces before implementing handlers
Applied to files:
apps/desktop/src/shared/ipc-channels/worktree.tsapps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-ipcs.ts
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/main/**/*.{ts,tsx} : Node.js modules (fs, path, os, net, etc.) can be used in main process code only
Applied to files:
apps/desktop/src/main/index.ts
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/main/lib/*-ipcs.ts : IPC handlers must accept a single object parameter, not positional parameters, to match type-safe renderer calls
Applied to files:
apps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-ipcs.ts
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/renderer/**/*.{ts,tsx} : Never import Node.js modules (fs, path, os, net, etc.) in renderer process code - browser environment only
Applied to files:
apps/desktop/src/main/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/lib/**/*.ts : Never import Node.js modules in shared code like `src/lib/electron-router-dom.ts` - this code runs in both main and renderer processes
Applied to files:
apps/desktop/src/main/index.ts
📚 Learning: 2025-11-24T21:33:13.244Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.244Z
Learning: Applies to apps/desktop/**/*.{ts,tsx,js,jsx} : For Electron interprocess communication, ALWAYS use tRPC as defined in `src/lib/trpc`
Applied to files:
apps/desktop/src/main/index.tsapps/desktop/src/main/lib/cloud-ipcs.ts
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to apps/desktop/src/renderer/**/*.tsx : Call IPC methods using `window.ipcRenderer.invoke()` with object parameters - TypeScript will infer the exact response type automatically
Applied to files:
apps/desktop/src/main/lib/cloud-ipcs.ts
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to **/*.{ts,tsx} : Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-11-28T01:03:47.951Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.951Z
Learning: Applies to packages/ui/src/**/*.tsx : Use shadcn/ui components and TailwindCSS v4 for all UI component styling in the shared UI package
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
🧬 Code graph analysis (13)
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsx (5)
apps/desktop/src/renderer/stores/tabs/hooks.ts (1)
useAddTab(7-7)packages/ui/src/components/sonner.tsx (1)
toast(30-30)apps/desktop/src/shared/types.ts (1)
TabType(23-30)packages/ui/src/components/dropdown-menu.tsx (3)
DropdownMenu(245-245)DropdownMenuTrigger(247-247)DropdownMenuContent(248-248)packages/ui/src/components/button.tsx (1)
Button(61-61)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsx (3)
apps/desktop/src/renderer/stores/tabs/types.ts (1)
WebViewTab(22-25)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx (1)
WebView(7-42)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.ts (1)
WebView(1-1)
apps/desktop/src/renderer/stores/tabs/types.ts (2)
apps/desktop/src/shared/types.ts (3)
TabType(23-30)MosaicNode(35-35)Tab(44-56)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx (1)
WebView(7-42)
apps/desktop/src/shared/ipc-channels/worktree.ts (1)
apps/desktop/src/shared/types.ts (1)
CloudSandbox(59-67)
apps/desktop/src/main/index.ts (1)
apps/desktop/src/main/lib/cloud-ipcs.ts (1)
registerCloudHandlers(41-81)
apps/desktop/src/main/lib/cloud-api-client.ts (1)
apps/desktop/src/shared/types.ts (1)
CloudSandbox(59-67)
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsx (1)
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsx (1)
CloudWorkspaceButton(19-193)
apps/desktop/src/main/lib/cloud-ipcs.ts (1)
apps/desktop/src/main/lib/cloud-api-client.ts (1)
cloudApiClient(184-184)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (2)
apps/desktop/src/shared/types.ts (1)
TabType(23-30)apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsx (1)
WebViewTabView(8-14)
apps/desktop/src/renderer/stores/tabs/store.ts (2)
apps/desktop/src/shared/types.ts (1)
TabType(23-30)apps/desktop/src/renderer/stores/tabs/helpers/tab-crud.ts (1)
handleAddTab(6-33)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.ts (1)
WebView(1-1)
apps/desktop/src/renderer/stores/tabs/helpers/tab-crud.ts (3)
apps/desktop/src/renderer/stores/tabs/types.ts (1)
TabsState(34-38)apps/desktop/src/shared/types.ts (1)
TabType(23-30)apps/desktop/src/renderer/stores/tabs/utils.ts (2)
CreateTabOptions(11-14)createNewTab(16-74)
apps/desktop/src/renderer/stores/tabs/utils.ts (3)
apps/desktop/src/shared/types.ts (1)
TabType(23-30)apps/desktop/src/renderer/stores/tabs/types.ts (2)
Tab(32-32)WebViewTab(22-25)apps/desktop/src/renderer/stores/tabs/utils/terminal-naming.ts (1)
generateTerminalName(41-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (13)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (1)
43-43: LGTM! Better button layout.The change from
justify-betweentogap-2improves the button layout by grouping the icon and text together rather than spreading them to opposite ends. This creates a more cohesive and conventional appearance for an icon+text button.apps/desktop/src/main/index.ts (1)
5-5: Cloud IPC handler registration placement looks goodRegistering
registerCloudHandlers()alongsideregisterStorageHandlers()keeps IPC setup centralized and happens early in main startup, which is consistent with the existing pattern. No issues from this wiring alone.Also applies to: 32-32
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/index.tsx (1)
5-5: CloudWorkspaceButton integration into the top bar looks consistentImporting and rendering
<CloudWorkspaceButton className="no-drag" />next toWorkspaceDropdownmatches existing layout patterns and preserves the draggable area semantics viano-drag. No functional or guideline issues here.Also applies to: 127-129
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/index.ts (1)
1-1: Barrel export for WebView matches component structure guidelines
export { WebView } from "./WebView";is a clean barrel that fits the co-location/one-component-per-folder pattern and simplifies imports (e.g../WebView).apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebViewTabView.tsx (1)
1-14: WebViewTabView correctly wraps WebView for WebViewTabTyping
tabasWebViewTaband passingtab.urlinto<WebView />is straightforward and type-safe; the full-size container withoverflow-hiddenandbg-backgroundis appropriate for embedding the webview. Looks good as-is.apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (1)
9-9: WebViewTabView integration into TabsContent is consistent with existing tab routingThe new
TabType.WebViewbranch cleanly mirrors the existing Single/Group handling, and passingtabToRenderintoWebViewTabViewmatches theWebViewTabdiscriminated type pattern. As long asTabTypeand theTabunion define the WebView variant (which they do elsewhere in this PR), this is solid.Also applies to: 49-51
apps/desktop/src/renderer/stores/tabs/store.ts (1)
43-47: addTab options propagation looks correctExtending
addTabto accept anoptionsargument and threading it through tohandleAddTab(state, workspaceId, type, options)cleanly exposes the newCreateTabOptionswithout breaking existing callers (it’s optional and has a default type). Just ensure theTabsStoreinterface in./typesreflects the updatedaddTabsignature so TS catches any misuse.apps/desktop/src/renderer/stores/tabs/utils.ts (1)
1-1: New CreateTabOptions and WebView tab handling are coherent and enforce good invariantsThe
CreateTabOptionsshape and the updatedcreateNewTablogic look solid:
- Title selection respects an explicit
options.title, falls back to the existing terminal naming forTabType.Single, uses"Cloud Terminal"for bare WebView tabs, and keeps"New Split View"for others.- The WebView branch requiring
options.urland throwing otherwise is a good early guard, and returning aWebViewTabkeeps the union discriminant intact.This meshes well with the cloud workspace flow where you provide both
urland an explicit title from the caller.Also applies to: 11-14, 20-21, 31-40, 56-65
apps/desktop/src/shared/types.ts (1)
79-79: AddingcloudSandboxto Worktree: verify serialization and migration pathsThe new optional
cloudSandbox?: CloudSandboxproperty onWorktreeis fine type‑wise, but please double‑check that any persistence layer (JSON config, DB, IPC payloads) correctly tolerates this new field for both old and new data without breaking loading or validation.apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/CloudWorkspaceButton.tsx (1)
28-57: Sandbox name generator is simple and effectiveThe adjective–noun–timestamp scheme is deterministic enough for uniqueness and user-friendly identification; no issues from my side here.
apps/desktop/src/renderer/stores/tabs/helpers/tab-crud.ts (1)
3-13: Options plumbed through handleAddTab correctlyExtending
handleAddTabwithoptions?: CreateTabOptionsand forwarding it tocreateNewTabis clean and backward compatible with existing callers that don’t pass options.apps/desktop/src/shared/ipc-channels/worktree.ts (1)
5-5: Cloud sandbox IPC channel contracts look correct; ensure handlers stay in syncThe
cloud-sandbox-createandcloud-sandbox-deletechannel typings align with the renderer usage (name/projectId/taskDescription) and the CloudSandbox shape. This follows the shared IPC typing pattern well; just make sure the main-process handlers incloud-ipcs.tsand any tRPC wrappers use exactly these shapes sowindow.ipcRenderer.invoke/tRPC calls remain type-safe end to end.Also applies to: 184-204
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/WebView/WebView.tsx (1)
7-29: WebView lifecycle wiring and cleanup look correctThe ref handling and event listener setup/teardown are solid and should avoid leaks or stale handlers when the URL changes or the component unmounts.
9b12289 to
910f825
Compare
… access adds githubToken field to sandbox creation request so the e2b sandbox can clone private repositories using the user's github credentials
7c2b521 to
e4cbbfc
Compare
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
…tes sandbox with branch
Summary
<webview>tag instead of iframe to properly embed external URLsArchitecture
TabType.CloudwithcreateCloudTab()factory that extracts sandbox ID from URL for tab namingcloud.createSandbox,cloud.deleteSandbox,cloud.listSandboxes, etc.)WorkspaceItemfetches its own cloud status viagetWorktreeCloudStatusquery (30s polling)Auth
Currently uses user's GitHub token (
gh auth token) which is sent to yolocode API. Users will need to authenticate with yolocode directly instead.Setup
Requires
CLAUDE_CODE_OAUTH_TOKENin.envfile. Get it by running:TODO