Skip to content

Commit 673de1c

Browse files
committed
fix: StatusDot shows 'Failed' state in red, parseRepoSlug handles SSH URLs
StatusDot: added 'failed' status with text-destructive/bg-destructive. Previously showed failed repos as 'Pending' with pulsing dot. parseRepoSlug: now matches both HTTPS (github.com/owner/repo) and SSH (git@github.com:owner/repo) URL formats. Skipped: function_count > 0 guard (intentional -- 0 before indexing is misleading), SortTab -> shadcn Tabs (custom component is simpler).
1 parent 6354dcc commit 673de1c

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

frontend/src/components/RepoList.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ type SortMode = 'recent' | 'name' | 'size'
3636
function parseRepoSlug(gitUrl: string): string {
3737
try {
3838
const cleaned = gitUrl.replace(/\.git$/, '')
39-
const match = cleaned.match(/github\.com\/([^/]+\/[^/]+)/)
40-
return match ? match[1] : ''
39+
// Match HTTPS: github.com/owner/repo
40+
const https = cleaned.match(/github\.com\/([^/]+\/[^/]+)/)
41+
if (https) return https[1]
42+
// Match SSH: git@github.com:owner/repo
43+
const ssh = cleaned.match(/github\.com:([^/]+\/[^/]+)/)
44+
if (ssh) return ssh[1]
45+
return ''
4146
} catch {
4247
return ''
4348
}
@@ -63,16 +68,17 @@ function timeAgo(dateStr?: string): string {
6368

6469
const StatusDot = ({ status }: { status: string }) => {
6570
const isIndexed = status === 'indexed'
71+
const isFailed = status === 'failed'
6672
return (
6773
<span className={cn(
6874
'inline-flex items-center gap-1.5 text-xs',
69-
isIndexed ? 'text-primary' : 'text-muted-foreground',
75+
isIndexed ? 'text-primary' : isFailed ? 'text-destructive' : 'text-muted-foreground',
7076
)}>
7177
<span className={cn(
7278
'w-1.5 h-1.5 rounded-full',
73-
isIndexed ? 'bg-primary' : 'bg-muted-foreground animate-pulse',
79+
isIndexed ? 'bg-primary' : isFailed ? 'bg-destructive' : 'bg-muted-foreground animate-pulse',
7480
)} />
75-
{isIndexed ? 'Indexed' : 'Pending'}
81+
{isIndexed ? 'Indexed' : isFailed ? 'Failed' : 'Pending'}
7682
</span>
7783
)
7884
}

0 commit comments

Comments
 (0)