Repository navigation
feat(workspace): save a link per workspace and open it from the card, status bar and a shortcut - #24856
feat(workspace): save a link per workspace and open it from the card, status bar and a shortcut#24856lucacri wants to merge 16 commits into
Conversation
There was a problem hiding this comment.
Important
One must-address gap: the new Link field is editable on folder workspaces, but saving there is silently discarded.
Reviewed changes
- Saved link on the workspace model: a new optional
workspaceUrlonWorktreeMeta/Worktree, persisted throughworktree.setwith''meaning cleared, validated as absolutehttp(s)on the CLI (--url), in the zod contract, and in the dialog. - Card and status-bar row: a
WorkspaceUrlRow(open / copy) shown above live ports on the sidebar card, activity hover card, and status-bar ports popover, rendered even when no port is live. - Open shortcut: a new rebindable
workspace.openUrlaction opens the active workspace link in Orca's browser;openWorkspacePortInBrowsernow delegates to a sharedopenUrlInWorkspaceBrowser, and a null runtime target falls back to local for direct-SSH workspaces.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| @@ -381,6 +387,7 @@ const WorktreeMetaDialog = React.memo(function WorktreeMetaDialog() { | |||
| provider={reviewProvider} | |||
| value={reviewInput} | |||
| /> | |||
| <WorktreeWorkspaceUrlField draft={workspaceUrl} onEnter={handleSave} /> | |||
There was a problem hiding this comment.
The Link field is editable for folder workspaces, but a save there is silently discarded. getFolderWorkspaceMetaUpdates whitelists a fixed key set without workspaceUrl, and neither FolderWorkspace nor folderWorkspaceToWorktree carries the field, so the dialog seeds empty, canSave passes, and updateWorktreeMeta returns { ok: true } without writing. Either support the link end-to-end for folder workspaces or render the field read-only/hidden for isFolderWorkspace, matching the Issue field.
Technical details
# Folder workspaces silently drop a saved link
## Affected sites
- `src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts:126` — `getFolderWorkspaceMetaUpdates` maps a fixed key set and omits `workspaceUrl`; with no other change, line 52 returns `{ ok: true }` early.
- `src/shared/folder-workspace-worktree.ts:29` — `folderWorkspaceToWorktree` never projects `workspaceUrl`, so the dialog always seeds empty and the card/status bar never show one.
- `src/shared/folder-workspace-types.ts:17` — `FolderWorkspace` has no `workspaceUrl`.
- `src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx:390` — field renders unconditionally; the Issue field at line 373 uses `isReadOnly={isFolderWorkspace}`.
- Main-side sites that would need the field if persisted: `src/main/ipc/worktrees/folder-workspace-model.ts`, `src/main/runtime/runtime-folder-workspace.ts`.
## Required outcome
- A link saved on a folder workspace must either persist and surface on its card/status bar, or the field must be disabled/hidden so input is not silently discarded.
## Suggested approach
- Full support: add `workspaceUrl` to `FolderWorkspace`, project it in `folderWorkspaceToWorktree`, map it in `getFolderWorkspaceMetaUpdates`, and persist it through the folder-workspace main models.
- Minimal: gate `WorktreeWorkspaceUrlField` on `!isFolderWorkspace`.There was a problem hiding this comment.
Fixed in b0fa862: the Link field is hidden on folder workspaces, orca worktree set --url rejects them with a clear error, and folder-kind repos that do persist the link now project it.
| }: WorktreeCardPortsProps): React.JSX.Element | null { | ||
| const recordFeatureInteraction = useAppStore((s) => s.recordFeatureInteraction) | ||
|
|
||
| if (ports.length === 0) { | ||
| if (ports.length === 0 && !worktree?.workspaceUrl) { |
There was a problem hiding this comment.
With this guard, the trigger now renders for a workspace that has a link but zero ports, yet its aria-label below still reads {{value0}} live {{value1}} → "0 live ports". Consider a link-aware label so the control does not announce zero ports when it is the only affordance for the saved link.
There was a problem hiding this comment.
Fixed in 2df471f: with a link and no live ports the trigger is now labelled "Workspace link". Added a test.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
59f06b9 to
7f6b66d
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a98510d1-95c7-43c4-b4b1-0ecd47c32764
📥 Commits
Reviewing files that changed from the base of the PR and between e07780d and 7f6b66d4bb08308f7f3e419384b9727c48e88d0c.
📒 Files selected for processing (15)
src/cli/handlers/worktree.tssrc/main/runtime/rpc/methods/worktree.tssrc/renderer/src/app-shell/app-command-handlers.tssrc/renderer/src/app-shell/workspace-open-url-command.tssrc/renderer/src/components/activity/activity-thread-hover-card.tsxsrc/renderer/src/components/sidebar/WorktreeMetaDialog.test.tsxsrc/renderer/src/components/sidebar/WorktreeMetaDialogDraft.tsxsrc/renderer/src/components/sidebar/WorktreeWorkspaceUrlField.tsxsrc/renderer/src/components/sidebar/use-worktree-card-secondary-details.tssrc/renderer/src/components/sidebar/worktree-card-parent-content.tsxsrc/renderer/src/components/sidebar/worktree-card-presentation.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/shared/rpc-contract/worktree-params.tssrc/shared/worktree/meta-types.tssrc/shared/worktree/types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
7f6b66d to
2d91316
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
38a9abe4-fbe9-4295-b8e4-507a81b269c6
📥 Commits
Reviewing files that changed from the base of the PR and between e07780d and 2d913164b0db2dd7af5aaa02356c4159d90a3b7c.
📒 Files selected for processing (17)
src/cli/handlers/worktree.tssrc/main/runtime/rpc/methods/worktree.tssrc/renderer/src/app-shell/app-command-handlers.tssrc/renderer/src/app-shell/workspace-open-url-command.tssrc/renderer/src/components/activity/activity-thread-hover-card.tsxsrc/renderer/src/components/sidebar/WorktreeMetaDialog.test.tsxsrc/renderer/src/components/sidebar/WorktreeMetaDialogDraft.tsxsrc/renderer/src/components/sidebar/WorktreeWorkspaceUrlField.tsxsrc/renderer/src/components/sidebar/use-worktree-card-secondary-details.tssrc/renderer/src/components/sidebar/worktree-card-parent-content.tsxsrc/renderer/src/components/sidebar/worktree-card-presentation.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/shared/keybindings/definitions-core-4.tssrc/shared/keybindings/types.tssrc/shared/rpc-contract/worktree-params.tssrc/shared/worktree/meta-types.tssrc/shared/worktree/types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
2d91316 to
baa539e
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Reject invalid workspaceUrl values in the desktop IPC handler. · meta-types.ts:86-87
src/shared/worktree/meta-types.ts:86-87
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winReject invalid
workspaceUrlvalues in the desktop IPC handler.The desktop bridge accepts arbitrary
updates, butworktrees:updateMetapersists every truthyworkspaceUrlwithout applying the HTTP(S)-only contract. A value such asfile:///...then survives in browser page state and can be admitted as an initial Orca browser URL. The system-browser path rejects it, but the Orca browser does not enforce the workspace URL contract. Validate the field before persistence.Suggested fix
import { normalizeLinkedWorkItemFields } from '../ipc-context-schemas' import { listDesktopLineageForHost } from './host-lineage-listing' import type { WorktreeIpcContext } from '../worktree-ipc-context' +import { isValidWorkspaceUrl } from '../../../../shared/workspace-url' export function registerWorktreeMetadataHandlers(context: WorktreeIpcContext): void { const { mainWindow, store, runtime } = context ipcMain.handle( @@ if (args.executionHostId !== undefined && !executionHostId) { throw new Error('Invalid execution host identity.') } + if ( + args.updates.workspaceUrl !== undefined && + args.updates.workspaceUrl !== '' && + !isValidWorkspaceUrl(args.updates.workspaceUrl) + ) { + throw new Error('Invalid workspace URL.') + } const validatedUpdates = normalizeLinkedWorkItemFields(args.updates)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
af4ce46d-373e-4280-9eb0-5f38dda2c031
📥 Commits
Reviewing files that changed from the base of the PR and between 2d913164b0db2dd7af5aaa02356c4159d90a3b7c and baa539eb17077e5fa0c6a03f41be0d288f6853c3.
📒 Files selected for processing (3)
src/cli/handlers/worktree.tssrc/main/runtime/rpc/methods/worktree.tssrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
b72abef to
1b59022
Compare
56ad19e to
25137ca
Compare
494c508 to
98efbde
Compare
c0e85ae to
30183cf
Compare
5e1b7a0 to
8fa39b1
Compare
… bar Each workspace can store one http(s) link (e.g. https://app.test/admin). The card's ports section and the status-bar ports popover show it with open and copy actions, even when no port is live. Set with `orca worktree set --url <link>`; `--url null` clears it.
Adds a rebindable 'Open Workspace Link' action (⇧⌘U on macOS, Alt+Shift+U elsewhere) that opens the active workspace's saved link in the built-in browser. It does nothing when no link is set. Direct-SSH workspaces, which have no runtime target, now open the link locally.
Adds a Link field to the workspace Update dialog, seeded from the saved link. Saving writes it only when it changed; an empty field clears it, and anything that is not an http(s) link blocks Save.
…of dropping it Project-group folder workspaces have no link field in their store, so the dialog's Link field and `orca worktree set --url` silently lost the value. Hide the field for them, reject --url with a clear error, and project the saved link for folder-kind repos, which already persist it in worktree meta.
…paceShortcutsActive
…ktreeIdempotently
8fa39b1 to
a6c737a
Compare

ELI5
Each workspace can now remember one web link — for example the address of the dev site it serves (
https://app.test/admin). Orca shows that link on the workspace card and in the status bar, and a shortcut opens it in Orca's built-in browser.What Changed
Before: the only way to reach a workspace's dev site from Orca was a detected listening port, which opens
localhost:PORT. Sites served through a local proxy or a custom domain (https://app.test, with a path) had no place to live, and nothing showed when no port was detected.After:
workspaceUrlon the worktree metadata, set three ways:http(s)URL blocks Save);orca worktree set --url <link>(--url nullclears it);worktree.setRPC (new optional, validatedworkspaceUrlparam).Mechanism: the link is stored like the other metadata fields (
WorktreeMeta→mergeWorktree→Worktree). Opening reuses the port-open path:openWorkspacePortInBrowsernow delegates to a newopenUrlInWorkspaceBrowser, so the link follows the same Orca-browser / system-browser setting, modifier escape hatch, and remote-runtime browser routing as ports. Theworktree setCLI handler and spec moved into their own files becausespecs/core.tswas already at the 300-line limit.Why
A port is the wrong key for this: the same server is often reached through a proxy on 443/80, a custom hostname, or a specific path. Storing one explicit link per workspace is the smallest model that covers those, and it needs no port detection to be useful. I first tried a per-port URL map, but it hid the link whenever the server was down or moved ports, which is exactly when you want to open it.
Linked Issue
No linked issue.
Visual Proof
Pending — screenshots of the Update dialog field, the card row, and the status-bar row to follow.
Testing
pnpm typecheckandpnpm lintpass; the changed-code quality gate reports no findings in the changed files.New tests: CLI
--urlset / clear / reject (index-worktree-set.test.ts), the Update dialog seeds and saves only an edited link and blocks a non-http link (WorktreeMetaDialog.test.tsx,WorktreeWorkspaceUrlField.test.ts), and the shortcut handler opens the link or leaves the chord alone (app-command-handlers-workspace-open-url.test.ts).Tests under
src/cli,src/main/{ipc,ports,runtime/rpc},src/renderer/src/{lib,app-shell}, the sidebar, status bar andsrc/sharedpass, exceptagent-launch-replay.test.ts, which fails identically without this change on my machine.Not yet tested by hand in the running app.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Claude Opus 5.5), reviewed by me.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
workspaceUrlis a new optional RPC field. An older host drops it silently (zod strips unknown keys), so setting a link against an old host is a no-op rather than an error.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)