From 0f7b8a5a9eeddad62fad833bdbb472a19bf4bb19 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Tue, 26 May 2026 15:24:28 +0100 Subject: [PATCH] fix(ui): fix crashes, dark theme tokens, Invalid Date bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FocusGroupSession: add missing DiscussionGuideViewer import (was crashing) - PersonaProfile: wrap TabsTrigger in TabsList (RovingFocusGroup crash) - Dashboard: fix Invalid Date bug — tx.ts vs tx.created_at field mismatch - ParticipantPanel, UserCard, SyntheticUsers: replace hardcoded light-mode colors (bg-blue-50, text-slate-*, bg-white) with dark theme tokens - AutonomousDashboard, NotesPanel, QuickNoteModal: same dark theme sweep Co-Authored-By: Claude Sonnet 4.6 --- src/components/UserCard.tsx | 8 +- src/components/dashboard/Dashboard.tsx | 9 +- .../AutonomousDashboard.tsx | 32 +- .../CollapsibleDiscussionGuide.tsx | 20 +- .../DiscussionGuideViewer.tsx | 168 ++--- .../focus-group-session/DiscussionPanel.tsx | 34 +- .../focus-group-session/NotesPanel.tsx | 16 +- .../focus-group-session/ParticipantPanel.tsx | 18 +- .../focus-group-session/QuickNoteModal.tsx | 2 +- .../focus-group-session/RoundTable3D.tsx | 669 ++++++++++++++++++ .../persona/PersonaAttitudinalProfile.tsx | 259 ++++--- src/components/persona/PersonaProfile.tsx | 145 ++-- src/components/persona/PersonaSidebar.tsx | 266 +++---- src/pages/FocusGroupSession.tsx | 304 ++++---- src/pages/SyntheticUsers.tsx | 6 +- 15 files changed, 1328 insertions(+), 628 deletions(-) create mode 100644 src/components/focus-group-session/RoundTable3D.tsx diff --git a/src/components/UserCard.tsx b/src/components/UserCard.tsx index 6b7688cc..77b971a3 100755 --- a/src/components/UserCard.tsx +++ b/src/components/UserCard.tsx @@ -139,7 +139,7 @@ export default function UserCard({ {/* AI-Synthesized Bio */}
{currentPersona.aiSynthesizedBio ? ( -

+

{currentPersona.aiSynthesizedBio} {currentPersona.aiSynthesizedBio.length > 150 && '...'}

@@ -157,7 +157,7 @@ export default function UserCard({ {currentPersona.qualitativeAttributes.slice(0, 3).map((attribute, index) => ( {attribute} @@ -177,7 +177,7 @@ export default function UserCard({ return ( @@ -186,7 +186,7 @@ export default function UserCard({ ); })} {currentPersona.folder_ids.length > 2 && ( - + {currentPersona.folder_ids.length - 2} more diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index 5157addb..b536e2b8 100755 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -27,7 +27,8 @@ interface Transaction { type: string; amount: number; balance_after: number; - created_at: string; + ts?: string; + created_at?: string; description?: string; } @@ -71,8 +72,10 @@ const TX_TYPE_COLORS: Record = { refund: 'text-blue-400', }; -function formatDate(iso: string) { +function formatDate(iso: string | undefined) { + if (!iso) return '—'; const d = new Date(iso); + if (isNaN(d.getTime())) return '—'; return d.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }); } @@ -362,7 +365,7 @@ const Dashboard = () => {

{TX_TYPE_LABELS[tx.type] || tx.type}

-

{formatDate(tx.created_at)}

+

{formatDate(tx.ts ?? tx.created_at)}

diff --git a/src/components/focus-group-session/AutonomousDashboard.tsx b/src/components/focus-group-session/AutonomousDashboard.tsx index 0402ba17..58a29113 100755 --- a/src/components/focus-group-session/AutonomousDashboard.tsx +++ b/src/components/focus-group-session/AutonomousDashboard.tsx @@ -202,30 +202,30 @@ const AutonomousDashboard = ({ switch (sentiment) { case 'positive': return 'text-green-600'; case 'negative': return 'text-red-600'; - default: return 'text-gray-600'; + default: return 'text-muted-foreground'; } }; const getHealthColor = (health: string) => { switch (health) { case 'excellent': return 'text-green-600'; - case 'good': return 'text-blue-600'; + case 'good': return 'text-primary'; case 'fair': return 'text-amber-600'; case 'poor': return 'text-red-600'; - default: return 'text-gray-600'; + default: return 'text-muted-foreground'; } }; if (!isVisible) return null; return ( -

+
{/* Header */} -
+
- -

AI Dashboard

+ +

AI Dashboard

- Indicators: + Indicators:
{conversationState.conversation_health.indicators.map((indicator, index) => ( @@ -344,16 +344,16 @@ const AutonomousDashboard = ({
-
+
{analytics.overview.active_participants}
-
Active
+
Active
{analytics.overview.participant_messages}
-
Messages
+
Messages
@@ -372,7 +372,7 @@ const AutonomousDashboard = ({ )} {analytics.participation.quiet_participants.length > 0 && ( -
+
Quiet: {analytics.participation.quiet_participants.length} participant(s)
)} @@ -482,8 +482,8 @@ const AutonomousDashboard = ({
{insights.next_suggested_action && ( -
-
+
+
Suggestion: {insights.next_suggested_action}
@@ -505,7 +505,7 @@ const AutonomousDashboard = ({
{analytics.recommendations.map((rec, index) => ( -
+
{rec}
))} diff --git a/src/components/focus-group-session/CollapsibleDiscussionGuide.tsx b/src/components/focus-group-session/CollapsibleDiscussionGuide.tsx index 42a0beba..e2445e76 100755 --- a/src/components/focus-group-session/CollapsibleDiscussionGuide.tsx +++ b/src/components/focus-group-session/CollapsibleDiscussionGuide.tsx @@ -84,28 +84,28 @@ const CollapsibleDiscussionGuide: React.FC = ({ const hasStructuredGuide = discussionGuide && typeof discussionGuide === 'object' && discussionGuide.sections; return ( -
+
- +
-

Discussion Guide

+

Discussion Guide

{!isOpen && ( - + Click to Edit )}
{hasStructuredGuide && ( -

+

{discussionGuide.title} • {discussionGuide.total_duration} minutes

)} @@ -130,16 +130,16 @@ const CollapsibleDiscussionGuide: React.FC = ({ )} {isOpen ? ( - + ) : ( - + )}
-
+
diff --git a/src/components/focus-group-session/DiscussionGuideViewer.tsx b/src/components/focus-group-session/DiscussionGuideViewer.tsx index baf10d22..5fa45b9c 100755 --- a/src/components/focus-group-session/DiscussionGuideViewer.tsx +++ b/src/components/focus-group-session/DiscussionGuideViewer.tsx @@ -254,8 +254,8 @@ const DroppableContainer: React.FC = ({ ref={setNodeRef} className={cn( className, - isOver && allowed && "ring-2 ring-blue-500 bg-blue-50/50", - isOver && !allowed && "ring-2 ring-red-400 opacity-50" + isOver && allowed && "ring-2 ring-primary bg-primary/10", + isOver && !allowed && "ring-2 ring-red-500/50 opacity-50" )} > {children} @@ -1035,16 +1035,16 @@ const DiscussionGuideViewer: React.FC = React.memo(( return ( {({ setActivatorNodeRef, attributes, listeners, isDragging }) => ( -
+
{/* Drag handle replaces the arrow buttons */}
@@ -1064,7 +1064,7 @@ const DiscussionGuideViewer: React.FC = React.memo(( {item.time_limit && ( -
+
= React.memo(( {itemType === 'question' && (
-