Skip to content

fix: include subpath in repo labels for branch and remote branch cards#224

Merged
matt2e merged 3 commits intomainfrom
sub-dir-3
Feb 20, 2026
Merged

fix: include subpath in repo labels for branch and remote branch cards#224
matt2e merged 3 commits intomainfrom
sub-dir-3

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Feb 19, 2026

When a repo has a subpath configured, the repo labels displayed on branch and remote branch cards now include the subpath (e.g. owner/repo/subpath instead of just owner/repo). This fix updates all four places in ProjectHome.svelte where repoLabelsByProject is built, as well as the repoLabelForBranch fallback in ProjectSection.svelte.

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.
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.
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.
@matt2e matt2e merged commit 2bb9503 into main Feb 20, 2026
3 checks passed
@matt2e matt2e deleted the sub-dir-3 branch February 20, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments