feat(KB-022): add GitHub issue status badges to task cards

- Extend core types with GitHub issue tracking fields (issueNumber, issueStatus, lastIssueSync)
- Add TaskStore.getTaskGitHubIssueInfo() to fetch issue details from GitHub API
- Create server-side API endpoint for issue status lookup with caching
- Build GitHubBadge component with color-coded status indicators (open/closed)
- Integrate badges into TaskCard with hover state linking to GitHub issues
- Add CSS styles for badge positioning and visual polish
- Include comprehensive tests for GitHubBadge and TaskCard badge rendering
This commit is contained in:
gsxdsm
2026-03-29 20:12:13 -07:00
parent 37afb24d60
commit b935f310ce
12 changed files with 930 additions and 30 deletions

View File

@@ -271,6 +271,23 @@ export function refreshPrStatus(id: string): Promise<PrInfo> {
});
}
// --- Issue Management API ---
/** Re-export IssueInfo type for convenience */
export type { IssueInfo } from "@kb/core";
/** Fetch cached issue status for a task */
export function fetchIssueStatus(id: string): Promise<{ issueInfo: import("@kb/core").IssueInfo; stale: boolean }> {
return api<{ issueInfo: import("@kb/core").IssueInfo; stale: boolean }>(`/tasks/${id}/issue/status`);
}
/** Force refresh issue status from GitHub */
export function refreshIssueStatus(id: string): Promise<import("@kb/core").IssueInfo> {
return api<import("@kb/core").IssueInfo>(`/tasks/${id}/issue/refresh`, {
method: "POST",
});
}
// --- Git Management API ---
/** Current git status */