Polish Cmd+J supporting-text chip and port label (#2559)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-21 14:52:11 -07:00
committed by GitHub
co-authored by Orca
parent 8da3a8c751
commit ba0bae0a0d
3 changed files with 7 additions and 7 deletions
@@ -989,8 +989,8 @@ export default function WorktreeJumpPalette(): React.JSX.Element | null {
</span>
</div>
{entry.match.supportingText && (
<div className="mt-1.5 flex min-w-0 items-start gap-2 text-[12px] leading-5 text-muted-foreground/88">
<span className="shrink-0 rounded-full border border-border/45 bg-background/45 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.12em] text-muted-foreground/75">
<div className="mt-1.5 flex min-w-0 items-center gap-2 text-[12px] leading-5 text-muted-foreground/88">
<span className="inline-flex h-[18px] shrink-0 items-center rounded border border-border bg-foreground/[0.04] px-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">
{entry.match.supportingText.label}
</span>
<span className="truncate">
@@ -212,8 +212,8 @@ describe('worktree-palette-search', () => {
expect(results[0].matchedField).toBe('port')
expect(results[0].supportingText).toEqual({
label: 'Port',
text: ':3000 vite',
matchRange: { start: 1, end: 5 }
text: '3000 · vite',
matchRange: { start: 0, end: 4 }
})
})
})
@@ -188,15 +188,15 @@ export function searchWorktrees(
const portText = String(port.port)
const portIndex = portText.indexOf(numericQuery)
if (portIndex !== -1) {
const label = `:${portText}${port.processName ? ` ${port.processName}` : ''}`
const label = port.processName ? `${portText} · ${port.processName}` : portText
results.push(
makeResult(worktree.id, 'port', {
supportingText: {
label: 'Port',
text: label,
matchRange: {
start: 1 + portIndex,
end: 1 + portIndex + numericQuery.length
start: portIndex,
end: portIndex + numericQuery.length
}
}
})