From f2ee8a0ec389ea38b2937984afd719d77b09d430 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 19 Feb 2026 15:39:28 -0800 Subject: [PATCH 1/3] fix: include subpath in repo labels for branch and remote branch cards The repo labels displayed on BranchCard and RemoteBranchCard were missing the subpath suffix (e.g. 'org/repo/sub-dir'). This was a regression where the repoLabelsByProject map in ProjectHome.svelte only used repo.githubRepo without appending repo.subpath, and the fallback in ProjectSection.svelte's repoLabelForBranch() similarly used project.githubRepo without project.subpath. Fixed all 4 occurrences in ProjectHome.svelte where the repo label map is built (hydration, project creation, repo addition, branch deletion) and the fallback in ProjectSection.svelte to conditionally append the subpath, matching the format already used in the action settings UI side panel. --- .../lib/features/projects/ProjectHome.svelte | 40 +++++++++++++++++-- .../features/projects/ProjectSection.svelte | 7 +++- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/staged/src/lib/features/projects/ProjectHome.svelte b/staged/src/lib/features/projects/ProjectHome.svelte index 18ecbc9..0d3a4e2 100644 --- a/staged/src/lib/features/projects/ProjectHome.svelte +++ b/staged/src/lib/features/projects/ProjectHome.svelte @@ -197,7 +197,15 @@ branchesByProject = new Map(branchesByProject).set(project.id, branches); repoLabelsByProject = new Map(repoLabelsByProject).set( project.id, - new Map(repos.map((repo) => [repo.id, repo.githubRepo] as const)) + new Map( + repos.map( + (repo) => + [ + repo.id, + repo.subpath ? `${repo.githubRepo}/${repo.subpath}` : repo.githubRepo, + ] as const + ) + ) ); } catch (e) { console.error(`[ProjectHome] Failed to hydrate project '${project.id}':`, e); @@ -319,7 +327,15 @@ branchesByProject = new Map(branchesByProject).set(project.id, branches); repoLabelsByProject = new Map(repoLabelsByProject).set( project.id, - new Map(repos.map((repo) => [repo.id, repo.githubRepo] as const)) + new Map( + repos.map( + (repo) => + [ + repo.id, + repo.subpath ? `${repo.githubRepo}/${repo.subpath}` : repo.githubRepo, + ] as const + ) + ) ); startInitialBranchSetup(project.id, branches); showNewProjectModal = false; @@ -423,7 +439,15 @@ branchesByProject = new Map(branchesByProject).set(projectId, branches); repoLabelsByProject = new Map(repoLabelsByProject).set( projectId, - new Map(repos.map((repo) => [repo.id, repo.githubRepo] as const)) + new Map( + repos.map( + (repo) => + [ + repo.id, + repo.subpath ? `${repo.githubRepo}/${repo.subpath}` : repo.githubRepo, + ] as const + ) + ) ); startInitialBranchSetup(projectId, branches); } catch (e) { @@ -626,7 +650,15 @@ branchesByProject = new Map(branchesByProject).set(branch.projectId, branches); repoLabelsByProject = new Map(repoLabelsByProject).set( branch.projectId, - new Map(repos.map((repo) => [repo.id, repo.githubRepo] as const)) + new Map( + repos.map( + (repo) => + [ + repo.id, + repo.subpath ? `${repo.githubRepo}/${repo.subpath}` : repo.githubRepo, + ] as const + ) + ) ); } else { await commands.deleteBranch(branch.id); diff --git a/staged/src/lib/features/projects/ProjectSection.svelte b/staged/src/lib/features/projects/ProjectSection.svelte index c8bdff5..f799c69 100644 --- a/staged/src/lib/features/projects/ProjectSection.svelte +++ b/staged/src/lib/features/projects/ProjectSection.svelte @@ -93,8 +93,11 @@ }); function repoLabelForBranch(branch: Branch): string | null { - if (!branch.projectRepoId) return project.githubRepo; - return repoLabelsById.get(branch.projectRepoId) ?? project.githubRepo; + const fallback = project.subpath + ? `${project.githubRepo}/${project.subpath}` + : project.githubRepo; + if (!branch.projectRepoId) return fallback; + return repoLabelsById.get(branch.projectRepoId) ?? fallback; } From 05cbac79503ce4e4c1fb9b5fe33b385f43e3255c Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 19 Feb 2026 15:44:14 -0800 Subject: [PATCH 2/3] fix: include subpath in repo labels on project list cards The repo labels displayed on project cards in ProjectsList.svelte were missing the subpath suffix (e.g. 'org/repo/sub-dir'). This is the same issue fixed in commit f2ee8a0 for BranchCard and RemoteBranchCard. Fixed both the repos.map() path and the project.githubRepo fallback to conditionally append the subpath when present. --- staged/src/lib/features/projects/ProjectsList.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/staged/src/lib/features/projects/ProjectsList.svelte b/staged/src/lib/features/projects/ProjectsList.svelte index b9c29fc..d1bd5c0 100644 --- a/staged/src/lib/features/projects/ProjectsList.svelte +++ b/staged/src/lib/features/projects/ProjectsList.svelte @@ -338,8 +338,14 @@ {/if}
{repos.length > 0 - ? repos.map((r) => r.githubRepo).join(', ') - : (project.githubRepo ?? 'No repo attached')} + ? repos + .map((r) => (r.subpath ? `${r.githubRepo}/${r.subpath}` : r.githubRepo)) + .join(', ') + : project.githubRepo + ? project.subpath + ? `${project.githubRepo}/${project.subpath}` + : project.githubRepo + : 'No repo attached'}
From abe055cf3eb227a6927ba75ab9ccb6bc2564d227 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 19 Feb 2026 16:02:52 -0800 Subject: [PATCH 3/3] refactor: extract reusable RepoLabel component with contrast styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a shared RepoLabel.svelte component that displays repo paths with the last segment (repo name or subpath) in full contrast (--text-primary) and preceding segments muted (--text-muted). This makes the most distinguishing part of the path pop out visually. The component accepts githubRepo and optional subpath props, splitting the path to emphasize the final segment: block/staged → 'block/' muted + 'staged' primary block/staged + ui → 'block/staged/' muted + 'ui' primary Refactored the data flow to pass structured {githubRepo, subpath} objects instead of pre-formatted strings through repoLabelsByProject, enabling the component to apply contrast styling at render time. Updated all 5 locations where repo labels are displayed: - BranchCardHeaderInfo (branch cards via ProjectSection) - ProjectsList (project cards) - ActionsPreferencesModal (action settings sidebar) - RepoSearchInput (recent repos and search results) Also fixes excludeRepos to correctly extract githubRepo for comparison against nameWithOwner, and removes the now-unused contextLabel function and context-repo/context-subpath CSS classes from ActionsPreferencesModal. --- .../lib/features/branches/BranchCard.svelte | 2 +- .../branches/BranchCardHeaderInfo.svelte | 7 ++- .../features/branches/RemoteBranchCard.svelte | 2 +- .../lib/features/projects/ProjectHome.svelte | 30 +++++----- .../features/projects/ProjectSection.svelte | 12 ++-- .../lib/features/projects/ProjectsList.svelte | 25 ++++---- .../features/projects/RepoSearchInput.svelte | 12 +--- .../settings/ActionsPreferencesModal.svelte | 18 +----- staged/src/lib/shared/RepoLabel.svelte | 60 +++++++++++++++++++ 9 files changed, 108 insertions(+), 60 deletions(-) create mode 100644 staged/src/lib/shared/RepoLabel.svelte diff --git a/staged/src/lib/features/branches/BranchCard.svelte b/staged/src/lib/features/branches/BranchCard.svelte index 468e83d..8d47adf 100644 --- a/staged/src/lib/features/branches/BranchCard.svelte +++ b/staged/src/lib/features/branches/BranchCard.svelte @@ -88,7 +88,7 @@ interface Props { branch: Branch; - repoLabel?: string | null; + repoLabel?: { githubRepo: string; subpath: string | null } | null; deleting?: boolean; worktreeError?: string; onDelete?: () => void; diff --git a/staged/src/lib/features/branches/BranchCardHeaderInfo.svelte b/staged/src/lib/features/branches/BranchCardHeaderInfo.svelte index 0b87b51..2a766f0 100644 --- a/staged/src/lib/features/branches/BranchCardHeaderInfo.svelte +++ b/staged/src/lib/features/branches/BranchCardHeaderInfo.svelte @@ -1,9 +1,10 @@ + +{#if prefix}{prefix}{/if}{emphasis} + +