|
88 | 88 | {@const isArchived = wt.archived} |
89 | 89 | {@const isBusy = isRemoving || isInitializing} |
90 | 90 | {@const hasLabel = !!wt.label} |
| 91 | + {@const hasBadgeRow = isArchived || isCreating || isInitializing || isClosed || wt.prs.length > 0 || !!wt.linearIssue || wt.source === "oneshot"} |
91 | 92 | <li class="mb-0.5 group relative {isBusy ? 'opacity-40 pointer-events-none' : ''}"> |
92 | 93 | <button |
93 | 94 | type="button" |
|
101 | 102 | onselect(wt.branch); |
102 | 103 | }} |
103 | 104 | > |
104 | | - <span class="flex items-center gap-1.5 pr-5 flex-wrap"> |
105 | | - <div class="flex items-center gap-2 max-w-[90%] min-w-0"> |
106 | | - {#if row.depth > 0} |
107 | | - <span class="shrink-0 text-muted/60">↳</span> |
108 | | - {/if} |
109 | | - <span class="min-w-0 flex flex-col"> |
110 | | - <span class="font-medium truncate">{wt.label ?? wt.branch}</span> |
111 | | - {#if hasLabel} |
112 | | - <span class="text-[10px] leading-tight text-muted truncate">{wt.branch}</span> |
| 105 | + <span class="flex min-w-0 items-start gap-2 pr-5"> |
| 106 | + {#if row.depth > 0} |
| 107 | + <span class="shrink-0 text-muted/60">↳</span> |
| 108 | + {/if} |
| 109 | + <span class="min-w-0 flex flex-1 flex-col gap-1"> |
| 110 | + <span class="flex min-w-0 items-center gap-1.5" data-worktree-name-row> |
| 111 | + <span class="min-w-0 flex flex-1 flex-col"> |
| 112 | + <span class="font-medium truncate">{wt.label ?? wt.branch}</span> |
| 113 | + {#if hasLabel} |
| 114 | + <span class="text-[10px] leading-tight text-muted truncate">{wt.branch}</span> |
| 115 | + {/if} |
| 116 | + </span> |
| 117 | + {#if !isCreating && !isInitializing && !isClosed} |
| 118 | + <span class="shrink-0"><AgentStatusIcon status={wt.agent} size={14} /></span> |
| 119 | + {/if} |
| 120 | + {#if notifiedBranches.has(wt.branch)} |
| 121 | + <span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span> |
113 | 122 | {/if} |
114 | 123 | </span> |
115 | | - {#if wt.source === "oneshot"} |
116 | | - <span |
117 | | - class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-edge text-muted" |
118 | | - title="Created by the oneshot CLI" |
119 | | - > |
120 | | - oneshot |
121 | | - </span> |
122 | | - {/if} |
123 | | - {#if isArchived} |
124 | | - <span class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-edge text-muted"> |
125 | | - archived |
| 124 | + {#if hasBadgeRow} |
| 125 | + <span class="flex min-w-0 flex-wrap items-center gap-1.5" data-worktree-badge-row> |
| 126 | + {#if wt.source === "oneshot"} |
| 127 | + <span |
| 128 | + class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-edge text-muted" |
| 129 | + title="Created by the oneshot CLI" |
| 130 | + > |
| 131 | + oneshot |
| 132 | + </span> |
| 133 | + {/if} |
| 134 | + {#if isArchived} |
| 135 | + <span class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-edge text-muted"> |
| 136 | + archived |
| 137 | + </span> |
| 138 | + {/if} |
| 139 | + {#if isCreating} |
| 140 | + <span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"> |
| 141 | + <span class="spinner"></span> |
| 142 | + {worktreeCreationPhaseLabel(wt.creationPhase)}... |
| 143 | + </span> |
| 144 | + {:else if isInitializing} |
| 145 | + <span class="shrink-0 text-[10px] text-muted">opening...</span> |
| 146 | + {:else if isClosed} |
| 147 | + <span class="shrink-0 text-[10px] text-muted">closed</span> |
| 148 | + {/if} |
| 149 | + {#each wt.prs as pr (pr.repo)} |
| 150 | + <PrBadge {pr} /> |
| 151 | + {/each} |
| 152 | + {#if wt.linearIssue} |
| 153 | + <LinearBadge issue={wt.linearIssue} clickable={false} /> |
| 154 | + {/if} |
126 | 155 | </span> |
127 | 156 | {/if} |
128 | | - {#if isCreating} |
129 | | - <span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"> |
130 | | - <span class="spinner"></span> |
131 | | - {worktreeCreationPhaseLabel(wt.creationPhase)}... |
132 | | - </span> |
133 | | - {:else if isInitializing} |
134 | | - <span class="shrink-0 text-[10px] text-muted">opening...</span> |
135 | | - {:else if isClosed} |
136 | | - <span class="shrink-0 text-[10px] text-muted">closed</span> |
137 | | - {:else} |
138 | | - <span class="shrink-0"><AgentStatusIcon status={wt.agent} size={14} /></span> |
139 | | - {/if} |
140 | | - {#if notifiedBranches.has(wt.branch)} |
141 | | - <span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span> |
142 | | - {/if} |
143 | | - </div> |
144 | | - {#each wt.prs as pr (pr.repo)} |
145 | | - <PrBadge {pr} /> |
146 | | - {/each} |
147 | | - {#if wt.linearIssue} |
148 | | - <LinearBadge issue={wt.linearIssue} clickable={false} /> |
149 | | - {/if} |
| 157 | + </span> |
150 | 158 | </span> |
151 | 159 | <span class="flex gap-2 text-[11px] text-muted items-center flex-wrap"> |
152 | 160 | {#if wt.agentLabel ?? wt.agentName} |
|
0 commit comments