From 71bfc7099649f819a176bb4bee169d449cef9b16 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Sat, 5 Dec 2026 00:54:51 +0800 Subject: [PATCH] feat(github): browse and work on repository issues (#8077) * feat(github): browse and work on repository issues * fix(github): fix issue browse assignee filter, list keyboard navigation, and edge cases --- src/features/github/create/CreatePanel.tsx | 18 + src/features/github/index.ts | 38 +++ src/features/github/issues/IssueEditor.tsx | 142 ++++++++ src/features/github/issues/Issues.module.css | 63 ++++ .../github/issues/IssuesToolWindow.tsx | 123 +++++++ src/features/github/issues/actions.ts | 48 +++ src/features/github/issues/api.ts | 167 ++++++++++ src/features/github/issues/input.ts | 67 ++++ src/features/github/issues/issues.test.tsx | 281 ++++++++++++++++ src/features/github/issues/usePages.ts | 71 ++++ .../toolwindow/GithubConnectionGate.tsx | 309 ++++++++++++++++++ .../toolwindow/PullRequestsToolWindow.tsx | 305 +---------------- src/features/vcs/actions.tsx | 19 +- src/features/vcs/branchOps.ts | 22 +- src/platform/locales/text/en.json | 18 + src/platform/locales/text/zh.json | 18 + src/ui/icons.tsx | 1 + src/ui/openidea/toolwindows/githubIssues.svg | 4 + .../toolwindows/githubIssues@20x20.svg | 4 + 19 files changed, 1415 insertions(+), 303 deletions(-) create mode 100644 src/features/github/issues/IssueEditor.tsx create mode 100644 src/features/github/issues/Issues.module.css create mode 100644 src/features/github/issues/IssuesToolWindow.tsx create mode 100644 src/features/github/issues/actions.ts create mode 100644 src/features/github/issues/api.ts create mode 100644 src/features/github/issues/input.ts create mode 100644 src/features/github/issues/issues.test.tsx create mode 100644 src/features/github/issues/usePages.ts create mode 100644 src/features/github/toolwindow/GithubConnectionGate.tsx create mode 100644 src/ui/openidea/toolwindows/githubIssues.svg create mode 100644 src/ui/openidea/toolwindows/githubIssues@20x20.svg 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 (
setTitle(e.target.value)} /> + {closing && number && !templateLoading && !hasClosingReference(description, number) && ( + + )}