From 58d9571f3bc1793b2089b8b2fa98f2a4923c15f6 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Fri, 20 Mar 2026 14:07:28 +1100 Subject: [PATCH 1/4] feat(ui): add Open In dropdown to diff viewer pane headers Add an "Open In" dropdown button to the after-pane (current view) header in the diff viewer. Shows available editors that can open the file, filtered to exclude terminals and Finder (directory-only openers). - Add afterHeaderExtra snippet prop to DiffViewer for extensible headers - Create OpenInDropdown component with click-to-toggle dropdown - Pass worktreePath from BranchCard through DiffModal to construct full file paths for opening Co-Authored-By: Claude Opus 4.6 (1M context) --- .../lib/features/branches/BranchCard.svelte | 2 + .../src/lib/features/diff/DiffModal.svelte | 10 ++ .../lib/features/diff/OpenInDropdown.svelte | 169 ++++++++++++++++++ .../src/lib/components/DiffViewer.svelte | 12 +- 4 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 apps/staged/src/lib/features/diff/OpenInDropdown.svelte diff --git a/apps/staged/src/lib/features/branches/BranchCard.svelte b/apps/staged/src/lib/features/branches/BranchCard.svelte index e3e1a0a8..4a958ca7 100644 --- a/apps/staged/src/lib/features/branches/BranchCard.svelte +++ b/apps/staged/src/lib/features/branches/BranchCard.svelte @@ -1189,6 +1189,7 @@ commits={timeline?.commits} baseBranchLabel={formatBaseBranch(branch.baseBranch)} branchLabel={branch.branchName} + worktreePath={branch.worktreePath} {projectName} githubRepo={repoLabel?.headRepo ?? repoLabel?.githubRepo} subpath={repoLabel?.subpath} @@ -1211,6 +1212,7 @@ commits={timeline?.commits} baseBranchLabel={formatBaseBranch(branch.baseBranch)} branchLabel={branch.branchName} + worktreePath={branch.worktreePath} {projectName} githubRepo={repoLabel?.headRepo ?? repoLabel?.githubRepo} subpath={repoLabel?.subpath} diff --git a/apps/staged/src/lib/features/diff/DiffModal.svelte b/apps/staged/src/lib/features/diff/DiffModal.svelte index 0e3fc09a..fd591c52 100644 --- a/apps/staged/src/lib/features/diff/DiffModal.svelte +++ b/apps/staged/src/lib/features/diff/DiffModal.svelte @@ -24,6 +24,7 @@ import DiffCommitSessionLauncher from './DiffCommitSessionLauncher.svelte'; import DiffReferenceSection from './DiffReferenceSection.svelte'; import ConfirmDialog from '../../shared/ConfirmDialog.svelte'; + import OpenInDropdown from './OpenInDropdown.svelte'; import { createDiffViewerState } from './diffViewerState.svelte'; import { createReviewState } from './reviewState.svelte'; import { createSearchState } from '@builderbot/diff-viewer/state'; @@ -71,6 +72,8 @@ baseBranchLabel?: string; /** Branch name for label display when switching to branch scope. */ branchLabel?: string; + /** Worktree path for "Open In" file actions. */ + worktreePath?: string | null; /** Project name to display in title bar. */ projectName?: string; /** GitHub repo (e.g., "owner/repo") to display in title bar. */ @@ -92,6 +95,7 @@ commits, baseBranchLabel, branchLabel, + worktreePath = null, projectName, githubRepo, subpath, @@ -769,6 +773,11 @@