Skip to content

Commit 95f4120

Browse files
committed
Add collapsible sections for Test Prompts Overview and Model Performance Comparison
- Added state management for expanding/collapsing sections - Both sections default to expanded state - Added chevron icons that rotate based on expansion state - Improves UI by allowing users to focus on specific data
1 parent 84ee957 commit 95f4120

File tree

2 files changed

+45
-15
lines changed

2 files changed

+45
-15
lines changed

src/components/Dashboard.tsx

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import PromptSummary from './PromptSummary';
2626

2727
export default function Dashboard() {
2828
const [isTestResultsExpanded, setIsTestResultsExpanded] = useState(false);
29+
const [isPromptsExpanded, setIsPromptsExpanded] = useState(true);
30+
const [isModelComparisonExpanded, setIsModelComparisonExpanded] = useState(true);
2931
const { data: runs, isLoading: runsLoading } = useQuery({
3032
queryKey: ['benchmarkRuns'],
3133
queryFn: fetchBenchmarkRuns,
@@ -153,14 +155,28 @@ export default function Dashboard() {
153155
/>
154156
</div>
155157

156-
{/* Model Comparison Table */}
158+
{/* Model Comparison Table - Collapsible */}
157159
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 mb-8">
158-
<div className="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
159-
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">
160-
Model Performance Comparison
161-
</h2>
160+
<div
161+
className="px-6 py-4 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"
162+
onClick={() => setIsModelComparisonExpanded(!isModelComparisonExpanded)}
163+
>
164+
<div className="flex items-center justify-between">
165+
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">
166+
Model Performance Comparison
167+
</h2>
168+
<button className="p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors">
169+
{isModelComparisonExpanded ? (
170+
<ChevronUp className="h-5 w-5 text-gray-500 dark:text-gray-400" />
171+
) : (
172+
<ChevronDown className="h-5 w-5 text-gray-500 dark:text-gray-400" />
173+
)}
174+
</button>
175+
</div>
162176
</div>
163-
<ModelComparisonTable performance={performance || []} />
177+
{isModelComparisonExpanded && (
178+
<ModelComparisonTable performance={performance || []} />
179+
)}
164180
</div>
165181

166182
{/* Category Breakdown and Recent Runs */}
@@ -169,17 +185,31 @@ export default function Dashboard() {
169185
<RecentRuns runs={runs || []} />
170186
</div>
171187

172-
{/* Prompt Summary */}
188+
{/* Prompt Summary - Collapsible */}
173189
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 mb-8">
174-
<div className="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
175-
<div className="flex items-center">
176-
<FileText className="h-5 w-5 text-gray-500 dark:text-gray-400 mr-2" />
177-
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">
178-
Test Prompts Overview
179-
</h2>
190+
<div
191+
className="px-6 py-4 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"
192+
onClick={() => setIsPromptsExpanded(!isPromptsExpanded)}
193+
>
194+
<div className="flex items-center justify-between">
195+
<div className="flex items-center">
196+
<FileText className="h-5 w-5 text-gray-500 dark:text-gray-400 mr-2" />
197+
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">
198+
Test Prompts Overview
199+
</h2>
200+
</div>
201+
<button className="p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors">
202+
{isPromptsExpanded ? (
203+
<ChevronUp className="h-5 w-5 text-gray-500 dark:text-gray-400" />
204+
) : (
205+
<ChevronDown className="h-5 w-5 text-gray-500 dark:text-gray-400" />
206+
)}
207+
</button>
180208
</div>
181209
</div>
182-
<PromptSummary runId={latestRun?.run_id} />
210+
{isPromptsExpanded && (
211+
<PromptSummary runId={latestRun?.run_id} />
212+
)}
183213
</div>
184214

185215
{/* Detailed Test Results - Collapsible */}

src/services/database-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
export const DATABASE_CONFIG = {
44
fileSize: 491520,
55
chunkSize: 4096,
6-
lastUpdated: '2025-09-19T15:05:28.676Z'
6+
lastUpdated: '2025-09-19T15:07:15.252Z'
77
};

0 commit comments

Comments
 (0)