@@ -33,8 +33,23 @@ type RepositoryDetail = {
3333 owner : { name : string } ;
3434 branches : BranchView [ ] ;
3535 commits : CommitView [ ] ;
36- pullRequests : Array < { id : string ; title : string ; status : string ; sourceBranch : string ; targetBranch : string } > ;
37- discussions : Array < { id : string ; title : string ; channel : string ; status : string ; messages : Array < { id : string ; text : string ; author : { name : string } } > } > ;
36+ pullRequests : Array < {
37+ id : string ;
38+ title : string ;
39+ status : string ;
40+ sourceBranch : string ;
41+ targetBranch : string ;
42+ author ?: { name : string } ;
43+ reviews ?: Array < { decision : string ; reviewer : { name : string } } > ;
44+ } > ;
45+ discussions : Array < {
46+ id : string ;
47+ title : string ;
48+ channel : string ;
49+ status : string ;
50+ author ?: { name : string } ;
51+ messages : Array < { id : string ; text : string ; author : { name : string } } > ;
52+ } > ;
3853} ;
3954
4055export function RepositoryDetailPage ( { slug } : { slug : string } ) {
@@ -76,13 +91,24 @@ export function RepositoryDetailPage({ slug }: { slug: string }) {
7691 ) ;
7792 }
7893
94+ const mergedCount = repository . pullRequests . filter ( ( pr ) => pr . status === "MERGED" ) . length ;
95+ const openPrCount = repository . pullRequests . filter ( ( pr ) => pr . status === "OPEN" ) . length ;
96+ const contributors = [ ...new Set ( repository . commits . map ( ( c ) => c . author . name ) ) ] ;
97+
7998 return (
8099 < main className = "shell detail-shell" >
81100 < section className = "panel detail-header reveal-up" >
82101 < div >
83102 < Link className = "repo-link" href = "/" > Back to dashboard</ Link >
84103 < h1 > { repository . name } </ h1 >
85104 < p > { repository . description } </ p >
105+ { repository . technologyStack . length > 0 && (
106+ < div className = "stack-row" style = { { marginTop : 8 } } >
107+ { repository . technologyStack . map ( ( tech ) => (
108+ < span className = "stack-pill" key = { tech } > { tech } </ span >
109+ ) ) }
110+ </ div >
111+ ) }
86112 </ div >
87113 < div className = "detail-meta" >
88114 < span className = "language-pill" > { repository . primaryLanguage } </ span >
@@ -93,7 +119,25 @@ export function RepositoryDetailPage({ slug }: { slug: string }) {
93119 </ div >
94120 </ section >
95121
96- < section className = "detail-grid reveal-up delay-1" >
122+ < section className = "metrics-grid reveal-up delay-1" >
123+ < div className = "panel metric-card tone-mint" > < span > Pull Requests</ span > < strong > { repository . pullRequests . length } </ strong > </ div >
124+ < div className = "panel metric-card tone-ice" > < span > Merged</ span > < strong > { mergedCount } </ strong > </ div >
125+ < div className = "panel metric-card tone-sun" > < span > Open PRs</ span > < strong > { openPrCount } </ strong > </ div >
126+ < div className = "panel metric-card tone-peach" > < span > Discussions</ span > < strong > { repository . discussions . length } </ strong > </ div >
127+ </ section >
128+
129+ { contributors . length > 0 && (
130+ < section className = "panel reveal-up delay-1" style = { { marginBottom : 16 } } >
131+ < h2 > Contributors</ h2 >
132+ < div className = "stack-row" >
133+ { contributors . map ( ( name ) => (
134+ < span className = "status-pill alt" key = { name } > { name } </ span >
135+ ) ) }
136+ </ div >
137+ </ section >
138+ ) }
139+
140+ < section className = "detail-grid reveal-up delay-2" >
97141 < div className = "panel detail-panel" >
98142 < h2 > Branches</ h2 >
99143 < div className = "branch-grid" >
@@ -115,31 +159,59 @@ export function RepositoryDetailPage({ slug }: { slug: string }) {
115159 </ div >
116160
117161 < div className = "panel detail-panel" >
118- < h2 > Pull Requests</ h2 >
162+ < h2 > Pull Requests ( { repository . pullRequests . length } ) </ h2 >
119163 < div className = "mini-list" >
120164 { repository . pullRequests . map ( ( pullRequest ) => (
121165 < div className = "mini-card" key = { pullRequest . id } >
122- < strong > { pullRequest . title } </ strong >
123- < span > { pullRequest . sourceBranch } to { pullRequest . targetBranch } · { pullRequest . status } </ span >
166+ < div className = "repo-card-top" >
167+ < strong > { pullRequest . title } </ strong >
168+ < span className = { `repo-status repo-status-${ pullRequest . status . toLowerCase ( ) } ` } > { pullRequest . status } </ span >
169+ </ div >
170+ < span > { pullRequest . author ?. name ? `${ pullRequest . author . name } · ` : "" } { pullRequest . sourceBranch } → { pullRequest . targetBranch } </ span >
171+ { pullRequest . reviews && pullRequest . reviews . length > 0 && (
172+ < div className = "stack-row" style = { { marginTop : 4 } } >
173+ { pullRequest . reviews . map ( ( review , index ) => (
174+ < span key = { index } className = { `stack-pill ${ review . decision === "APPROVE" ? "tone-approve" : review . decision === "REJECT" ? "tone-reject" : "" } ` } >
175+ { review . reviewer . name } : { review . decision }
176+ </ span >
177+ ) ) }
178+ </ div >
179+ ) }
124180 </ div >
125181 ) ) }
182+ { repository . pullRequests . length === 0 && < span className = "muted-inline" > No pull requests yet.</ span > }
126183 </ div >
127- < h2 > Discussions</ h2 >
128- < div className = "mini-list" >
129- { repository . discussions . map ( ( discussion ) => (
130- < div className = "mini-card" key = { discussion . id } >
184+ </ div >
185+ </ section >
186+
187+ < section className = "panel detail-panel reveal-up delay-3" >
188+ < h2 > Discussions ({ repository . discussions . length } )</ h2 >
189+ < div className = "mini-list" >
190+ { repository . discussions . map ( ( discussion ) => (
191+ < div className = "mini-card" key = { discussion . id } >
192+ < div className = "repo-card-top" >
131193 < strong > { discussion . title } </ strong >
132- < span > { discussion . channel } · { discussion . status } </ span >
133- { discussion . messages . slice ( - 2 ) . map ( ( message ) => (
134- < span key = { message . id } > { message . author . name } : { message . text } </ span >
194+ < div className = "stack-row" >
195+ < span className = "stack-pill" > { discussion . channel } </ span >
196+ < span className = { `repo-status repo-status-${ ( discussion . status ?? "OPEN" ) . toLowerCase ( ) } ` } > { discussion . status ?? "OPEN" } </ span >
197+ </ div >
198+ </ div >
199+ { discussion . author && < span className = "muted-inline" > by { discussion . author . name } </ span > }
200+ < div className = "discussion-thread" >
201+ { discussion . messages . map ( ( message ) => (
202+ < div key = { message . id } className = "discussion-msg" >
203+ < strong > { message . author . name } </ strong >
204+ < p > { message . text } </ p >
205+ </ div >
135206 ) ) }
136207 </ div >
137- ) ) }
138- </ div >
208+ </ div >
209+ ) ) }
210+ { repository . discussions . length === 0 && < span className = "muted-inline" > No discussions yet.</ span > }
139211 </ div >
140212 </ section >
141213
142- < section className = "panel detail-panel reveal-up delay-2 " >
214+ < section className = "panel detail-panel reveal-up delay-4 " >
143215 < h2 > Commit History and Diffs</ h2 >
144216 < div className = "commit-list" >
145217 { repository . commits . map ( ( commit ) => (
0 commit comments