@@ -2,11 +2,10 @@ import { redirect } from 'next/navigation'
22import { isAuthenticated , getCurrentUser } from '@/lib/session'
33import { fetchTraceIndex , traceIndexToPRSummaries , enrichPRSummaries , computeMetricsFromPRSummaries } from '@/lib/data-fetcher'
44import OverviewTable from '@/components/overview-table'
5- import MetricsCharts from '@/components/metrics-charts '
5+ import PRVelocityChart from '@/components/pr-velocity-chart '
66import PerformanceMetrics from '@/components/performance-metrics'
77import type { PRSummary , BotMetrics } from '@/lib/types'
88import { Activity } from 'lucide-react'
9- import Link from 'next/link'
109
1110export const dynamic = 'force-dynamic'
1211export 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' 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=" VectorInstitute/repo-name" --field pr_number=" 123"
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" >
0 commit comments