From bb8ad4f0fabfb78eff835c64e7182285db34e942 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 22 Jun 2026 23:15:50 +0000 Subject: [PATCH] Use rich object property key fallback Co-Authored-By: Paperclip --- ui/src/components/IssueProperties.test.tsx | 2 +- ui/src/components/IssueProperties.tsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/src/components/IssueProperties.test.tsx b/ui/src/components/IssueProperties.test.tsx index 6e5de76ecfe..4b1f8454ee0 100644 --- a/ui/src/components/IssueProperties.test.tsx +++ b/ui/src/components/IssueProperties.test.tsx @@ -1811,7 +1811,7 @@ describe("IssueProperties", () => { pill: { providerKey: "github", objectType: "pull_request", - displayKey: "Github Pull Request", + displayKey: null, iconKey: "github", statusCategory: "succeeded", statusIconKey: "git-merge", diff --git a/ui/src/components/IssueProperties.tsx b/ui/src/components/IssueProperties.tsx index 5c268b82300..632617f0acf 100644 --- a/ui/src/components/IssueProperties.tsx +++ b/ui/src/components/IssueProperties.tsx @@ -195,10 +195,20 @@ function sortExternalObjectGroups(groups: IssueExternalObjectGroup[]) { }); } +function externalObjectRowDisplayKey(group: IssueExternalObjectGroup): string { + const { pill } = group; + const displayKey = pill.displayKey?.trim(); + if (displayKey) return displayKey; + if (pill.providerKey === "github") { + if (pill.objectType === "pull_request") return "Github Pull Request"; + if (pill.objectType === "issue") return "Github Issue"; + } + return `${externalObjectProviderLabel(pill.providerKey)} ${externalObjectTypeLabel(pill.objectType)}`; +} + function externalObjectRowLabel(group: IssueExternalObjectGroup): React.ReactNode { const { pill } = group; - const displayKey = pill.displayKey?.trim() - || `${externalObjectProviderLabel(pill.providerKey)} ${externalObjectTypeLabel(pill.objectType)}`; + const displayKey = externalObjectRowDisplayKey(group); const Icon = externalObjectIconForKey(pill.iconKey); return (