From 55464314bbfdc0e468fd541594f1b1363d2fe940 Mon Sep 17 00:00:00 2001
From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
Date: Sat, 5 Dec 2026 00:49:35 +0800
Subject: [PATCH] fix(github): fix issue browse assignee filter, list keyboard
navigation, and edge cases
---
src/features/github/create/CreatePanel.tsx | 10 +-
src/features/github/index.ts | 4 +-
src/features/github/issues/IssueEditor.tsx | 24 +-
src/features/github/issues/Issues.module.css | 11 +-
.../github/issues/IssuesToolWindow.tsx | 24 +-
src/features/github/issues/actions.ts | 15 +-
src/features/github/issues/api.ts | 56 +++--
src/features/github/issues/input.ts | 30 ++-
src/features/github/issues/issues.test.tsx | 227 +++++++++++++++++-
src/features/github/issues/usePages.ts | 24 +-
10 files changed, 365 insertions(+), 60 deletions(-)
diff --git a/src/features/github/create/CreatePanel.tsx b/src/features/github/create/CreatePanel.tsx
index 0b1c57ade3..7dbf70ff43 100644
--- a/src/features/github/create/CreatePanel.tsx
+++ b/src/features/github/create/CreatePanel.tsx
@@ -24,7 +24,8 @@ import {
T,
type MenuItem,
} from "@/ui";
-import { issueForBranch } from "../issues/input";
+import { connectedRoot } from "../data/repository";
+import { hasClosingReference, issueForBranch } from "../issues/input";
import { openPullRequest } from "../toolwindow/open";
import { ChangesPanel } from "./ChangesPanel";
import { DirectionSelector } from "./DirectionSelector";
@@ -109,7 +110,10 @@ function TextPanel() {
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, head.name) : null;
+ const number =
+ direction && head?.kind === "local"
+ ? issueForBranch({ ...direction.baseRepo, root: direction.baseRepo.root ?? connectedRoot() }, head.name)
+ : null;
const closing = number ? `Closes #${number}` : null;
return (
@@ -120,7 +124,7 @@ function TextPanel() {
value={title}
onChange={(e) => setTitle(e.target.value)}
/>
- {closing && !templateLoading && !description.split("\n").includes(closing) && (
+ {closing && number && !templateLoading && !hasClosingReference(description, number) && (
);
- const comments = page.items.flatMap((item) => item.comments.nodes);
- const seen = new Set(comments.map((c) => c.id));
+ const seen = new Set();
+ const comments: IssueComment[] = [];
+ for (const item of page.items) {
+ for (const c of item.comments.nodes) {
+ if (seen.has(c.id)) continue;
+ seen.add(c.id);
+ comments.push(c);
+ }
+ }
return (
@@ -72,7 +79,18 @@ function Discussion({ connection, number }: { connection: GHConnection; number:
{issue.assignees.nodes.map((u) => (
@{u.login}
))}
-