File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ function fetchAllDiscussions() {
3636 body
3737 url
3838 upvoteCount
39- comments { totalCount }
39+ comments(first: 10) {
40+ totalCount
41+ nodes {
42+ author { login avatarUrl }
43+ body
44+ createdAt
45+ }
46+ }
4047 }
4148 pageInfo { hasNextPage endCursor }
4249 }
@@ -74,11 +81,22 @@ function main() {
7481 continue
7582 }
7683
77- feedback [ anchorId ] = {
84+ const entry = {
7885 upvotes : d . upvoteCount ,
7986 comments : d . comments . totalCount ,
8087 url : d . url ,
8188 }
89+
90+ if ( d . comments . nodes && d . comments . nodes . length > 0 ) {
91+ entry . recentComments = d . comments . nodes . map ( ( c ) => ( {
92+ author : c . author ? c . author . login : 'ghost' ,
93+ avatar : c . author ? c . author . avatarUrl : '' ,
94+ body : c . body ,
95+ date : c . createdAt ,
96+ } ) )
97+ }
98+
99+ feedback [ anchorId ] = entry
82100 mapped ++
83101 }
84102
Original file line number Diff line number Diff line change 22 "socratic-method" : {
33 "upvotes" : 2 ,
44 "comments" : 1 ,
5- "url" : " https://github.com/LLM-Coding/Semantic-Anchors/discussions/291"
5+ "url" : " https://github.com/LLM-Coding/Semantic-Anchors/discussions/291" ,
6+ "recentComments" : [
7+ {
8+ "author" : " rdmueller" ,
9+ "avatar" : " https://avatars.githubusercontent.com/u/1856308?u=2c7443f52b575e8b3aefbc3007aea8b3cccac00f&v=4" ,
10+ "body" : " works best for me to clarify requirements" ,
11+ "date" : " 2026-03-18T12:25:31Z"
12+ }
13+ ]
614 },
715 "yagni" : {
816 "upvotes" : 1 ,
Original file line number Diff line number Diff line change @@ -277,8 +277,30 @@ export async function loadAnchorContent(anchorId) {
277277 ? fb . url
278278 : null
279279 if ( safeFeedbackUrl ) {
280+ const commentsHtml =
281+ fb . recentComments && fb . recentComments . length > 0
282+ ? `
283+ <div class="feedback-comments">
284+ ${ fb . recentComments
285+ . map (
286+ ( c ) => `
287+ <div class="feedback-comment">
288+ <img src="${ escapeHtml ( c . avatar ) } " alt="${ escapeHtml ( c . author ) } " class="feedback-avatar" width="24" height="24" />
289+ <div class="feedback-comment-body">
290+ <span class="feedback-author">${ escapeHtml ( c . author ) } </span>
291+ <p class="feedback-text">${ escapeHtml ( c . body ) } </p>
292+ </div>
293+ </div>
294+ `
295+ )
296+ . join ( '' ) }
297+ </div>
298+ `
299+ : ''
300+
280301 const feedbackHtml = `
281302 <div class="feedback-section">
303+ ${ commentsHtml }
282304 <div class="feedback-actions">
283305 <a href="${ escapeHtml ( safeFeedbackUrl ) } " target="_blank" rel="noopener noreferrer" class="feedback-btn feedback-btn-vote">
284306 <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
Original file line number Diff line number Diff line change @@ -196,6 +196,30 @@ body {
196196 @apply dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700;
197197}
198198
199+ .feedback-comments {
200+ @apply mb-4 space-y-3;
201+ }
202+
203+ .feedback-comment {
204+ @apply flex gap-3 items-start;
205+ }
206+
207+ .feedback-avatar {
208+ @apply rounded-full flex-shrink-0;
209+ }
210+
211+ .feedback-comment-body {
212+ @apply min-w-0;
213+ }
214+
215+ .feedback-author {
216+ @apply text-sm font-medium text-[var (--color-text )];
217+ }
218+
219+ .feedback-text {
220+ @apply text-sm text-[var (--color-text-secondary )] mt-0.5 mb-0;
221+ }
222+
199223.feedback-hint {
200224 @apply mt-2 text-xs text-gray-400 dark:text-gray-500;
201225}
You can’t perform that action at this time.
0 commit comments