The AtmosphereConf talks your skyline missed
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: address code review feedback on network attention display

- Clamp ScoreDetail percentage to max 99 so engaged talks never show 100%
- Distinguish real HTTP errors (429, 5xx) from expected 401/504 in useCrawlData
- Replace O(n²) talks.find with Map lookup in ScoredTalksGrid memo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+19 -9
+2 -1
src/components/scored-talks-grid.tsx
··· 23 23 return talks.map((talk) => ({ talk, score: null })); 24 24 } 25 25 const scores = rankTalks({ talks, mentions, followCount }); 26 + const talksByRkey = new Map(talks.map((t) => [t.rkey, t])); 26 27 return scores.map((score) => ({ 27 - talk: talks.find((t) => t.rkey === score.rkey)!, 28 + talk: talksByRkey.get(score.rkey)!, 28 29 score, 29 30 })); 30 31 }, [talks, mentions, followCount]);
+1 -1
src/components/ui/lume-card.tsx
··· 30 30 } 31 31 32 32 // engaged — show percentage 33 - const pct = Math.round(score.layer1.attentionInverse * 100); 33 + const pct = Math.min(99, Math.round(score.layer1.attentionInverse * 100)); 34 34 return ( 35 35 <div className="text-label-sm text-on-surface-variant"> 36 36 {pct}% of your network missed this
+16 -7
src/hooks/useCrawlData.ts
··· 35 35 try { 36 36 const res = await fetch("/api/crawl"); 37 37 if (!res.ok) { 38 - // 401 = not authenticated, 504 = timeout — treat as "no data" 39 38 if (!cancelled) { 40 - setData({ 41 - mentions: null, 42 - followCount: 0, 43 - loading: false, 44 - error: null, 45 - }); 39 + if (res.status === 401 || res.status === 504) { 40 + // Not authenticated or timeout — treat as "no data" 41 + setData({ 42 + mentions: null, 43 + followCount: 0, 44 + loading: false, 45 + error: null, 46 + }); 47 + } else { 48 + setData({ 49 + mentions: null, 50 + followCount: 0, 51 + loading: false, 52 + error: `Crawl failed: ${res.status} ${res.statusText}`, 53 + }); 54 + } 46 55 } 47 56 return; 48 57 }