Use rich object property key fallback

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-06-23 00:35:05 +00:00
1 parent f6ba07fe1c
commit bb8ad4f0fa
2 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -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",
+12 -2
View File
@@ -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 (
<span className="inline-flex min-w-0 items-center gap-1">