Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,11 @@ const AgentManagerContent: Component = () => {
return firstOrderedTitle(sessions, worktreeTabOrder()[wt.id], wt.branch)
}

const worktreeSubtitle = (wt: WorktreeState): string | undefined => {
const label = worktreeLabel(wt)
return label !== wt.branch ? wt.branch : undefined
}

const isStaleWorktree = (worktreeId: string): boolean => staleWorktreeIds().has(worktreeId)

/** True when any session in the given ID list is actively working (busy/retry and not blocked by permissions/questions). */
Expand Down Expand Up @@ -2322,6 +2327,7 @@ const AgentManagerContent: Component = () => {
<WorktreeItem
worktree={wt}
label={worktreeLabel(wt)}
subtitle={worktreeSubtitle(wt)}
active={selection() === wt.id}
pendingDelete={pendingDelete() === wt.id}
busy={busyWorktrees().has(wt.id)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interface WorktreeItemProps {
worktree: WorktreeState
/** Display label (resolved from label, first session title, or branch). */
label: string
/** Branch name shown as subtitle when it differs from the label. */
subtitle?: string
active: boolean
pendingDelete: boolean
busy: boolean
Expand Down Expand Up @@ -262,8 +264,11 @@ export const WorktreeItem: Component<WorktreeItemProps> = (props) => {
</div>
</div>
</div>
{/* Row 2: always rendered for consistent height; PR badge or skeleton */}
{/* Row 2: branch subtitle + PR badge */}
<div class="am-wt-row2">
<Show when={props.subtitle}>
<span class="am-worktree-subtitle">{props.subtitle}</span>
</Show>
<Show
when={props.pr}
fallback={
Expand Down
29 changes: 23 additions & 6 deletions packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
}

.am-local-item-active .am-local-branch {
color: var(--text-on-interactive-base);
opacity: 0.7;
color: color-mix(in srgb, var(--text-on-interactive-base) 70%, transparent);
}

.am-local-item-active .am-stat-files {
Expand Down Expand Up @@ -92,8 +91,8 @@
}

.am-local-branch {
font-size: var(--font-size-small);
color: var(--text-weak);
font-size: 10px;
color: var(--text-weaker);
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -258,10 +257,25 @@ button.am-section-toggle:hover .am-section-label {
.am-wt-row2 {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 6px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: PR badges regress to left alignment when no subtitle is rendered

Removing the row's right alignment shifts the PR badge and loading skeleton to the left for worktrees whose label already matches the branch, because those rows do not render props.subtitle. Keeping the badge pinned to the end preserves the previous layout for existing worktrees while still allowing the new subtitle to occupy the left side when it is present.

min-height: 14px;
}

.am-worktree-subtitle {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 10px;
color: var(--text-weaker);
line-height: 1.2;
min-width: 0;
}

.am-worktree-item-active .am-worktree-subtitle {
color: color-mix(in srgb, var(--text-on-interactive-base) 70%, transparent);
}

.am-worktree-item:hover {
background: var(--surface-inset-base-hover);
}
Expand Down Expand Up @@ -373,7 +387,8 @@ button.am-section-toggle:hover .am-section-label {
background: color-mix(in srgb, var(--surface-critical-strong) 25%, transparent);
}

.am-worktree-pending-delete .am-worktree-branch {
.am-worktree-pending-delete .am-worktree-branch,
.am-worktree-pending-delete .am-worktree-subtitle {
opacity: 0.5;
transition: opacity 200ms ease;
}
Expand Down Expand Up @@ -490,6 +505,7 @@ button.am-section-toggle:hover .am-section-label {
animation: am-skeleton-pulse 1.5s ease-in-out infinite;
animation-delay: 0.3s;
opacity: 0;
margin-left: auto;
}

.am-stat-files {
Expand Down Expand Up @@ -520,6 +536,7 @@ button.am-section-toggle:hover .am-section-label {
font-weight: 500;
font-variant-numeric: tabular-nums;
transition: background 150ms ease;
margin-left: auto;
}
.am-pr-badge:hover {
background: color-mix(in srgb, var(--pr-accent) 25%, transparent);
Expand Down
Loading