diff --git a/src/features/github/create/CreatePanel.tsx b/src/features/github/create/CreatePanel.tsx index 54c50f9ea2..7dbf70ff43 100644 --- a/src/features/github/create/CreatePanel.tsx +++ b/src/features/github/create/CreatePanel.tsx @@ -24,6 +24,8 @@ import { T, type MenuItem, } from "@/ui"; +import { connectedRoot } from "../data/repository"; +import { hasClosingReference, issueForBranch } from "../issues/input"; import { openPullRequest } from "../toolwindow/open"; import { ChangesPanel } from "./ChangesPanel"; import { DirectionSelector } from "./DirectionSelector"; @@ -106,6 +108,13 @@ function TextPanel() { const title = useCreatePr((s) => s.title); const description = useCreatePr((s) => s.description); const templateLoading = useCreatePr((s) => s.templateLoading); + const direction = useCreatePr((s) => s.direction); + const head = direction?.headBranch; + const number = + direction && head?.kind === "local" + ? issueForBranch({ ...direction.baseRepo, root: direction.baseRepo.root ?? connectedRoot() }, head.name) + : null; + const closing = number ? `Closes #${number}` : null; return (