Skip to content

Commit 8803db4

Browse files
committed
Improve dashboard with more relevant metrics
1 parent bea4d2b commit 8803db4

26 files changed

+6330
-1801
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ repos:
3939
- id: typos
4040
args: []
4141

42+
- repo: local
43+
hooks:
44+
- id: nextjs-lint
45+
name: Next.js Lint
46+
entry: bash -c 'cd dashboard && npm run lint'
47+
language: system
48+
files: '^dashboard/'
49+
types_or: [javascript, jsx, ts, tsx]
50+
pass_filenames: false
51+
4252
ci:
4353
autofix_commit_msg: |
4454
[pre-commit.ci] Add auto fixes from pre-commit.com hooks
@@ -48,4 +58,5 @@ ci:
4858
autoupdate_branch: ''
4959
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
5060
autoupdate_schedule: weekly
61+
skip: [nextjs-lint]
5162
submodules: false

dashboard/app/globals.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,44 @@ body {
101101
.animate-slide-up {
102102
animation: slide-up 0.6s ease-out;
103103
}
104+
105+
/* Enhanced Select Dropdown Styling */
106+
select {
107+
font-weight: 500;
108+
}
109+
110+
select:focus {
111+
box-shadow: 0 0 0 3px rgba(138, 37, 201, 0.1);
112+
}
113+
114+
select option {
115+
padding: 12px 16px;
116+
background-color: white;
117+
color: #1e293b;
118+
font-weight: 500;
119+
transition: all 0.15s ease;
120+
}
121+
122+
@media (prefers-color-scheme: dark) {
123+
select option {
124+
background-color: #1e293b;
125+
color: #f1f5f9;
126+
}
127+
128+
select option:checked {
129+
background: linear-gradient(90deg, rgba(235, 8, 138, 0.2) 0%, rgba(138, 37, 201, 0.2) 100%);
130+
color: #EB088A;
131+
font-weight: 600;
132+
}
133+
}
134+
135+
select option:checked {
136+
background: linear-gradient(90deg, rgba(235, 8, 138, 0.1) 0%, rgba(138, 37, 201, 0.1) 100%);
137+
color: #EB088A;
138+
font-weight: 600;
139+
}
140+
141+
select option:hover {
142+
background: linear-gradient(90deg, rgba(138, 37, 201, 0.08) 0%, rgba(49, 60, 255, 0.08) 100%);
143+
}
104144
}

dashboard/app/page.tsx

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { redirect } from 'next/navigation'
22
import { isAuthenticated, getCurrentUser } from '@/lib/session'
33
import { fetchTraceIndex, traceIndexToPRSummaries, enrichPRSummaries, computeMetricsFromPRSummaries } from '@/lib/data-fetcher'
44
import OverviewTable from '@/components/overview-table'
5-
import MetricsCharts from '@/components/metrics-charts'
5+
import PRVelocityChart from '@/components/pr-velocity-chart'
66
import PerformanceMetrics from '@/components/performance-metrics'
77
import type { PRSummary, BotMetrics } from '@/lib/types'
88
import { Activity } from 'lucide-react'
9-
import Link from 'next/link'
109

1110
export const dynamic = 'force-dynamic'
1211
export const revalidate = 0
@@ -90,12 +89,12 @@ export default async function DashboardPage() {
9089
No Data Available
9190
</h2>
9291
<p className="text-slate-600 dark:text-slate-400 mb-4">
93-
The bot hasn't processed any PRs yet. Data will appear here once the bot starts monitoring and fixing PRs.
92+
The bot hasn&apos;t processed any PRs yet. Data will appear here once the bot starts monitoring and fixing PRs.
9493
</p>
9594
<div className="text-sm text-slate-500 dark:text-slate-500">
9695
<p>Trigger the bot workflow to fix a PR:</p>
9796
<code className="block mt-2 p-2 bg-slate-100 dark:bg-slate-800 rounded text-xs">
98-
gh workflow run fix-remote-pr.yml --field target_repo="VectorInstitute/repo-name" --field pr_number="123"
97+
gh workflow run fix-remote-pr.yml --field target_repo=&quot;VectorInstitute/repo-name&quot; --field pr_number=&quot;123&quot;
9998
</code>
10099
</div>
101100
</div>
@@ -142,88 +141,11 @@ export default async function DashboardPage() {
142141

143142
<div className="max-w-7xl mx-auto px-4 md:px-8 pb-8">
144143
<div className="space-y-8">
145-
146-
{/* Key Metrics Cards */}
147-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
148-
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6">
149-
<div className="flex items-center justify-between">
150-
<div>
151-
<p className="text-sm font-medium text-gray-500 dark:text-gray-400">
152-
Total PRs Scanned
153-
</p>
154-
<p className="text-3xl font-bold text-gray-900 dark:text-white mt-2">
155-
{metrics.stats.total_prs_scanned}
156-
</p>
157-
</div>
158-
<div className="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center">
159-
<svg className="w-6 h-6 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
160-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
161-
</svg>
162-
</div>
163-
</div>
164-
</div>
165-
166-
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6">
167-
<div className="flex items-center justify-between">
168-
<div>
169-
<p className="text-sm font-medium text-gray-500 dark:text-gray-400">
170-
Auto-Merged
171-
</p>
172-
<p className="text-3xl font-bold text-green-600 dark:text-green-400 mt-2">
173-
{metrics.stats.prs_auto_merged}
174-
</p>
175-
</div>
176-
<div className="w-12 h-12 bg-green-100 dark:bg-green-900/30 rounded-lg flex items-center justify-center">
177-
<svg className="w-6 h-6 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
178-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
179-
</svg>
180-
</div>
181-
</div>
182-
</div>
183-
184-
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6">
185-
<div className="flex items-center justify-between">
186-
<div>
187-
<p className="text-sm font-medium text-gray-500 dark:text-gray-400">
188-
Bot Fixed
189-
</p>
190-
<p className="text-3xl font-bold text-vector-magenta mt-2">
191-
{metrics.stats.prs_bot_fixed}
192-
</p>
193-
</div>
194-
<div className="w-12 h-12 bg-vector-magenta/10 rounded-lg flex items-center justify-center">
195-
<svg className="w-6 h-6 text-vector-magenta" fill="none" stroke="currentColor" viewBox="0 0 24 24">
196-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
197-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
198-
</svg>
199-
</div>
200-
</div>
201-
</div>
202-
203-
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6">
204-
<div className="flex items-center justify-between">
205-
<div>
206-
<p className="text-sm font-medium text-gray-500 dark:text-gray-400">
207-
Success Rate
208-
</p>
209-
<p className="text-3xl font-bold text-vector-violet mt-2">
210-
{(metrics.stats.success_rate * 100).toFixed(0)}%
211-
</p>
212-
</div>
213-
<div className="w-12 h-12 bg-vector-violet/10 rounded-lg flex items-center justify-center">
214-
<svg className="w-6 h-6 text-vector-violet" fill="none" stroke="currentColor" viewBox="0 0 24 24">
215-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
216-
</svg>
217-
</div>
218-
</div>
219-
</div>
220-
</div>
221-
222144
{/* Performance Metrics */}
223145
<PerformanceMetrics metrics={metrics} />
224146

225-
{/* Charts */}
226-
<MetricsCharts metrics={metrics} />
147+
{/* PR Velocity Chart */}
148+
<PRVelocityChart prSummaries={prSummaries} />
227149

228150
{/* Recent PRs Table */}
229151
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6">

dashboard/app/pr/[repo]/[number]/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { fetchPRTrace } from '@/lib/data-fetcher'
44
import { notFound } from 'next/navigation'
55
import AgentTimeline from '@/components/agent-timeline'
66
import FailureAnalysis from '@/components/failure-analysis'
7-
import PerformanceMetrics from '@/components/performance-metrics'
87
import { Clock, GitBranch, User, ExternalLink } from 'lucide-react'
98

109
export const dynamic = 'force-dynamic'

dashboard/components/agent-timeline.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
Info,
1212
ChevronDown,
1313
ChevronRight,
14-
Code,
1514
FileEdit,
1615
Search,
1716
Terminal,
@@ -36,7 +35,7 @@ export default function AgentTimeline({ events }: AgentTimelineProps) {
3635
setExpandedEvents(newExpanded)
3736
}
3837

39-
const getEventIcon = (type: string, tool?: string, parsedType?: string) => {
38+
const getEventIcon = (type: string, tool?: string) => {
4039
// For TOOL_RESULT events, show check icon
4140
if (type === 'TOOL_RESULT') {
4241
return <CheckCircle className="w-5 h-5 text-green-600 dark:text-green-400" />
@@ -123,7 +122,7 @@ export default function AgentTimeline({ events }: AgentTimelineProps) {
123122
<div className="flex items-start space-x-3">
124123
{/* Icon */}
125124
<div className="flex-shrink-0 mt-0.5">
126-
{getEventIcon(event.type, event.tool || parsed.metadata?.tool, parsed.type)}
125+
{getEventIcon(event.type, event.tool || parsed.metadata?.tool)}
127126
</div>
128127

129128
{/* Content */}

dashboard/components/code-diff-viewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function CodeDiffViewer({
2121
const [isExpanded, setIsExpanded] = useState(false)
2222
const [showDiff, setShowDiff] = useState(!!oldCode)
2323
const [copied, setCopied] = useState(false)
24-
const [isDark, setIsDark] = useState(true)
24+
const isDark = true
2525

2626
const handleCopy = async () => {
2727
try {

dashboard/components/failure-analysis.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default function FailureAnalysis({ failure }: FailureAnalysisProps) {
144144
</div>
145145
{!showFullLogs && hasMoreLogs && (
146146
<p className="text-xs text-gray-500 dark:text-gray-400 mt-2">
147-
Showing first 50 lines. Click "Show All" to see complete logs.
147+
Showing first 50 lines. Click &quot;Show All&quot; to see complete logs.
148148
</p>
149149
)}
150150
</div>

0 commit comments

Comments
 (0)