From e86768823ee226661c8519ea52d5f734fbe3f8c2 Mon Sep 17 00:00:00 2001 From: Jiayuan Zhang Date: Tue, 24 Mar 2026 18:12:06 +0800 Subject: [PATCH] refactor: remove repository field from issues The repository JSONB column on the issue table is unused. This removes it end-to-end: migration to drop the column, sqlc queries, Go handler/ service/daemon/protocol structs, TypeScript types, and the RepositoryEditor UI component. Co-Authored-By: Claude Opus 4.6 --- .../app/(dashboard)/issues/[id]/page.test.tsx | 1 - apps/web/app/(dashboard)/issues/[id]/page.tsx | 109 ------------------ apps/web/app/(dashboard)/issues/page.test.tsx | 1 - packages/types/src/api.ts | 2 - packages/types/src/issue.ts | 5 - server/internal/daemon/daemon.go | 5 +- server/internal/daemon/daemon_test.go | 18 +-- server/internal/daemon/prompt.go | 38 +----- server/internal/daemon/types.go | 8 -- server/internal/handler/issue.go | 19 --- server/internal/service/task.go | 13 --- server/migrations/001_init.up.sql | 1 - .../007_drop_issue_repository.down.sql | 1 + .../007_drop_issue_repository.up.sql | 1 + server/pkg/db/generated/issue.sql.go | 24 ++-- server/pkg/db/generated/models.go | 1 - server/pkg/db/queries/issue.sql | 5 +- server/pkg/protocol/messages.go | 8 -- 18 files changed, 18 insertions(+), 242 deletions(-) create mode 100644 server/migrations/007_drop_issue_repository.down.sql create mode 100644 server/migrations/007_drop_issue_repository.up.sql diff --git a/apps/web/app/(dashboard)/issues/[id]/page.test.tsx b/apps/web/app/(dashboard)/issues/[id]/page.test.tsx index 6e23b41f..01408cf7 100644 --- a/apps/web/app/(dashboard)/issues/[id]/page.test.tsx +++ b/apps/web/app/(dashboard)/issues/[id]/page.test.tsx @@ -106,7 +106,6 @@ const mockIssue: Issue = { parent_issue_id: null, acceptance_criteria: [], context_refs: [], - repository: null, position: 0, due_date: "2026-06-01T00:00:00Z", created_at: "2026-01-15T00:00:00Z", diff --git a/apps/web/app/(dashboard)/issues/[id]/page.tsx b/apps/web/app/(dashboard)/issues/[id]/page.tsx index 76e56bca..1e2aa91d 100644 --- a/apps/web/app/(dashboard)/issues/[id]/page.tsx +++ b/apps/web/app/(dashboard)/issues/[id]/page.tsx @@ -5,7 +5,6 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { ChevronRight, - GitBranch, Link2, Pencil, Send, @@ -270,110 +269,6 @@ function ContextRefsEditor({ ); } -// --------------------------------------------------------------------------- -// Repository Editor -// --------------------------------------------------------------------------- - -function RepositoryEditor({ - repository, - onUpdate, -}: { - repository: { url: string; branch?: string; path?: string } | null; - onUpdate: (updates: Partial) => void; -}) { - const [open, setOpen] = useState(false); - const [url, setUrl] = useState(""); - const [branch, setBranch] = useState(""); - const [path, setPath] = useState(""); - - const handleOpen = (v: boolean) => { - if (v) { - setUrl(repository?.url ?? ""); - setBranch(repository?.branch ?? ""); - setPath(repository?.path ?? ""); - } - setOpen(v); - }; - - const save = () => { - if (!url.trim()) { - onUpdate({ repository: null }); - } else { - onUpdate({ - repository: { - url: url.trim(), - branch: branch.trim() || undefined, - path: path.trim() || undefined, - }, - }); - } - setOpen(false); - }; - - const clear = () => { - onUpdate({ repository: null }); - setOpen(false); - }; - - return ( - - - {repository ? ( - <> - - {repository.branch ?? "main"} - - ) : ( - None - )} - - -
Repository
-
- setUrl(e.target.value)} - placeholder="https://github.com/org/repo" - className="text-xs" - autoFocus - /> - setBranch(e.target.value)} - placeholder="Branch" - className="text-xs" - /> - setPath(e.target.value)} - placeholder="Path" - className="text-xs" - /> -
-
- {repository && ( - - )} - -
-
-
- ); -} - // --------------------------------------------------------------------------- // Page // --------------------------------------------------------------------------- @@ -712,10 +607,6 @@ export default function IssueDetailPage({ - - - -