From e670193fae25fe1f1f0ecc9de7fd287964138e2f Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 31 May 2026 10:39:25 -0700 Subject: [PATCH] Add GitHub label management link (#3884) * Add GitHub label management link * chore: drop unreachable PR label link --------- Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com> --- .../src/components/GitHubItemDialog.tsx | 74 ++++++++++++++++++- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/GitHubItemDialog.tsx b/src/renderer/src/components/GitHubItemDialog.tsx index 7f81e1327..3673336ab 100644 --- a/src/renderer/src/components/GitHubItemDialog.tsx +++ b/src/renderer/src/components/GitHubItemDialog.tsx @@ -38,6 +38,7 @@ import { Plus, RefreshCw, Send, + Settings, UndoDot, Users, Wrench, @@ -179,6 +180,27 @@ function parseOwnerRepoFromItemUrl(url: string): GitHubOwnerRepo | null { } } +function getGitHubRepositoryLabelsUrl(itemUrl: string): string | null { + try { + const parsed = new URL(itemUrl) + if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') { + return null + } + const segments = parsed.pathname.split('/').filter(Boolean) + if (segments.length < 2) { + return null + } + // Why: label management is repository-scoped; preserving the origin keeps + // GitHub Enterprise URLs working while navigating away from the issue path. + parsed.pathname = `/${segments[0]}/${segments[1]}/labels` + parsed.search = '' + parsed.hash = '' + return parsed.toString() + } catch { + return null + } +} + const MonacoCodeExcerpt = lazy(() => import('@/components/editor/MonacoCodeExcerpt')) export type ItemDialogTab = 'conversation' | 'checks' | 'files' @@ -4102,6 +4124,37 @@ async function runPullRequestStateUpdate(args: { } } +function GitHubLabelsSettingsLink({ + url, + separated, + onOpen +}: { + url: string | null + separated?: boolean + onOpen?: () => void +}): React.JSX.Element | null { + if (!url) { + return null + } + + return ( +