From 6c8cba1def024b167e67fafb3854f2bc0ab35b9f Mon Sep 17 00:00:00 2001 From: Oliver Bryan <04oliverbryan@gmail.com> Date: Sun, 14 Dec 2025 21:19:28 +0000 Subject: [PATCH] implemented issue identifiers (-) --- packages/frontend/src/Index.tsx | 33 ++++++++++++------- .../src/components/issue-detail-pane.tsx | 27 +++++++++++---- .../frontend/src/components/issues-table.tsx | 13 ++++---- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/packages/frontend/src/Index.tsx b/packages/frontend/src/Index.tsx index f79646a..664dccc 100644 --- a/packages/frontend/src/Index.tsx +++ b/packages/frontend/src/Index.tsx @@ -78,18 +78,27 @@ function Index() { {/* main body */}
- {/* issues list (table) */} - - {/* issue detail pane */} - {selectedIssue && ( -
- setSelectedIssue(null)} /> -
+ {selectedProject && issues.length > 0 && ( + <> + {/* issues list (table) */} + + {/* issue detail pane */} + {selectedIssue && ( +
+ setSelectedIssue(null)} + /> +
+ )} + )}
diff --git a/packages/frontend/src/components/issue-detail-pane.tsx b/packages/frontend/src/components/issue-detail-pane.tsx index 363d505..ccdc147 100644 --- a/packages/frontend/src/components/issue-detail-pane.tsx +++ b/packages/frontend/src/components/issue-detail-pane.tsx @@ -1,13 +1,28 @@ -import type { IssueRecord } from "@issue/shared"; +import type { IssueRecord, ProjectRecord } from "@issue/shared"; import { X } from "lucide-react"; import { Button } from "@/components/ui/button"; +import { issueID } from "@/lib/utils"; -export function IssueDetailPane({ issue, close }: { issue: IssueRecord; close: () => void }) { +export function IssueDetailPane({ + project, + issue, + close, +}: { + project: ProjectRecord; + issue: IssueRecord; + close: () => void; +}) { return ( -
- +
+
+ +

{issueID(project.blob, issue.number)}

+
+ + +

{issue.title}

diff --git a/packages/frontend/src/components/issues-table.tsx b/packages/frontend/src/components/issues-table.tsx index 738def6..3bef634 100644 --- a/packages/frontend/src/components/issues-table.tsx +++ b/packages/frontend/src/components/issues-table.tsx @@ -1,25 +1,26 @@ -import type { IssueRecord } from "@issue/shared"; +import type { IssueRecord, ProjectRecord } from "@issue/shared"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; -import { cn } from "@/lib/utils"; +import { cn, issueID } from "@/lib/utils"; export function IssuesTable({ + project, issues, columns = {}, issueSelectAction, className, }: { + project: ProjectRecord; issues: IssueRecord[]; columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean }; issueSelectAction?: (issue: IssueRecord) => void; className: string; }) { - if (issues.length === 0) return; return ( {(columns.id == null || columns.id === true) && ( - ID + ID )} {(columns.title == null || columns.title === true) && Title} {(columns.description == null || columns.description === true) && ( @@ -39,8 +40,8 @@ export function IssuesTable({ }} > {(columns.id == null || columns.id === true) && ( - - {String(issue.id).padStart(3, "0")} + + {issue.number.toString().padStart(3, "0")} )} {(columns.title == null || columns.title === true) && (