Commit 61ec3f9
authored
Optimize GitHub Avatars with Next.js Image Component (#8184)
## Description
GitHub avatar images across 7 components were rendered using raw HTML
<img> tags, bypassing Next.js built-in image optimization. This resulted
in:
No automatic WebP/AVIF format conversion
No lazy loading out of the box
No responsive sizing
Higher bandwidth usage and slower LCP (Largest Contentful Paint) scores
The next.config.ts already had both avatars.githubusercontent.com and
github.com configured under remotePatterns, meaning the optimization
infrastructure was ready — just not being used.
Every GitHub avatar across the dashboard, leaderboard, burnout analyzer,
and developer arena will now be:
Served as WebP/AVIF automatically where the browser supports it
Lazy loaded by default (images below the fold don't block rendering)
Properly sized to avoid layout shift (explicit width/height on every
<Image>)
Fixes #3696
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [x] 📐 Pillar 2 — Geometric SVG Improvement
- [x] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
- [x] My commits follow the Conventional Commits format (e.g.,
`feat(themes): ...`, `fix(calculate): ...`).
- [x] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have started the repo.
- [x] I have made sure that i have only one commit to merge in this PR.
- [x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard (no raw elements, smooth animations, correct fonts).
- [x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.7 files changed
Lines changed: 33 additions & 26 deletions
File tree
- components
- burnout
- dashboard
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
723 | 725 | | |
724 | 726 | | |
725 | 727 | | |
726 | | - | |
| 728 | + | |
727 | 729 | | |
728 | 730 | | |
| 731 | + | |
| 732 | + | |
729 | 733 | | |
730 | 734 | | |
731 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
225 | | - | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 117 | + | |
124 | 118 | | |
125 | | - | |
126 | | - | |
| 119 | + | |
| 120 | + | |
127 | 121 | | |
128 | | - | |
129 | | - | |
| 122 | + | |
| 123 | + | |
130 | 124 | | |
| 125 | + | |
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
| |||
261 | 256 | | |
262 | 257 | | |
263 | 258 | | |
264 | | - | |
| 259 | + | |
265 | 260 | | |
266 | 261 | | |
267 | 262 | | |
| |||
0 commit comments