From 5e78d748eeff6ec67d73037d6702e99bdddfceaf Mon Sep 17 00:00:00 2001 From: AndyMik90 Date: Wed, 11 Feb 2026 19:55:30 +0100 Subject: [PATCH] fix(ideation): guard against non-string properties in IdeaCard badges Prevent "Objects are not valid as a React child" crash when the AI backend returns malformed idea data with object properties where strings are expected. Co-Authored-By: Claude Opus 4.6 --- .../src/renderer/components/ideation/IdeaCard.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/frontend/src/renderer/components/ideation/IdeaCard.tsx b/apps/frontend/src/renderer/components/ideation/IdeaCard.tsx index dbc2da93..1fb89079 100644 --- a/apps/frontend/src/renderer/components/ideation/IdeaCard.tsx +++ b/apps/frontend/src/renderer/components/ideation/IdeaCard.tsx @@ -88,32 +88,32 @@ export function IdeaCard({ idea, isSelected, onClick, onConvert, onGoToTask, onD {idea.status} )} - {isCodeImprovementIdea(idea) && ( + {isCodeImprovementIdea(idea) && typeof (idea as CodeImprovementIdea).estimatedEffort === 'string' && ( {(idea as CodeImprovementIdea).estimatedEffort} )} - {isUIUXIdea(idea) && ( + {isUIUXIdea(idea) && typeof (idea as UIUXImprovementIdea).category === 'string' && ( {UIUX_CATEGORY_LABELS[(idea as UIUXImprovementIdea).category]} )} - {isDocumentationGapIdea(idea) && ( + {isDocumentationGapIdea(idea) && typeof (idea as DocumentationGapIdea).category === 'string' && ( {DOCUMENTATION_CATEGORY_LABELS[(idea as DocumentationGapIdea).category]} )} - {isSecurityHardeningIdea(idea) && ( + {isSecurityHardeningIdea(idea) && typeof (idea as SecurityHardeningIdea).severity === 'string' && ( {(idea as SecurityHardeningIdea).severity} )} - {isPerformanceOptimizationIdea(idea) && ( + {isPerformanceOptimizationIdea(idea) && typeof (idea as PerformanceOptimizationIdea).impact === 'string' && ( {(idea as PerformanceOptimizationIdea).impact} impact )} - {isCodeQualityIdea(idea) && ( + {isCodeQualityIdea(idea) && typeof (idea as CodeQualityIdea).severity === 'string' && ( {(idea as CodeQualityIdea).severity}