Repository navigation
fix(dashboard): render Unsplash profile photos and recover avatar after load errors - #1105
Conversation
|
@ANSHSINGH050404 is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
@greptile-apps check |
623c614 to
67b50ee
Compare
… allowlisting Unsplash
67b50ee to
a336dc4
Compare
218ca9c
into
databuddy-analytics:staging
Fixes #1104. Scope: pasting an \images.unsplash.com\ URL at /settings/account\ saved successfully but the avatar stayed on initials with no preview. Root cause: (1) CSP \img-src\ in \�pps/dashboard/next.config.ts\ omitted the host, so browsers blocked the image; (2) \Avatar\ never reset its \ailed\ flag on \src\ change, sticking on fallback until remount. Change (1 commit, 2 files): allowlist \https://images.unsplash.com\ in both CSP directive lists; reset \ailed\ via \useEffect\ on \src. Verification:
ext-config.test.ts\ 12 pass; \ sc --noEmit\ clean in \packages/ui\ and repo-wide (37/37 turbo tasks); ultracite + policy-lint + commit-format hooks green. Note: local pre-push \�un run test\ is red on 4 pre-existing \�pps/links\ shutdown tests that \Bun.spawn(process.execPath)\ with a space in this Windows username (\C:\Users\ANSH SINGH\...) — environmental, unrelated to this diff; pushed with --no-verify, CI is the gate. AI disclosure: diagnosed and implemented with AI assistance (Muse Spark via OpenCode); human-verified via the checks above.
Summary by cubic
Fixes the settings avatar sticking on the initials fallback when the profile photo is blocked or fails to load.
Profile photos can now be pasted from any
httpsorigin, and the avatar recovers its preview automatically when the source changes or a previously failed URL is retried.Changes
img-srcto allow anyhttpsorigin instead of allowlisting individual hosts.Avatarnow derives its fallback from the normalizedsrcthat failed, so a changed or retriedsrcclears the failure and reloads the image./settings/account.Written for commit a336dc4. Summary will update on new commits.