From 11c225cb68a340c8f492db74f2c9326d8b3fbe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 22 May 2026 12:35:42 +0200 Subject: [PATCH] Preserve kind casing in table title during transitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the filter's label (which has proper casing like "AiResources") when it matches the displayed entities. Fall back to the entity's kind field directly instead of lowercasing and re-capitalizing, which mangled camelCase kinds like AiResource into Airesource. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- .../src/components/CatalogTable/CatalogTable.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 3ee808b8c8..af49c0b48c 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -196,12 +196,14 @@ export const CatalogTable = (props: CatalogTableProps) => { // Derive the title's kind label from the displayed entities so the // title stays consistent with the rows during filter transitions. - const displayedKind = - entities[0]?.kind?.toLocaleLowerCase('en-US') ?? filters.kind?.value; + // Use the filter's label when it matches (it has proper casing), + // otherwise fall back to the entity's kind field directly. + const displayedKind = entities[0]?.kind ?? filters.kind?.value; const displayedKindLabel = - displayedKind === filters.kind?.value?.toLocaleLowerCase('en-US') + displayedKind?.toLocaleLowerCase('en-US') === + filters.kind?.value?.toLocaleLowerCase('en-US') ? filters.kind?.label || '' - : capitalize(displayedKind || ''); + : displayedKind || ''; const currentType = filters.type?.value || ''; const countIsCorrect = typeof totalItems === 'number' && !totalItemsLoading && !loading;