Skip to content

feat(onboarding): render social avatar on verify-socials SocialRow - #1886

Merged
sweetmantech merged 1 commit into
mainfrom
feat/verify-socials-pfp
Jul 27, 2026
Merged

feat(onboarding): render social avatar on verify-socials SocialRow#1886
sweetmantech merged 1 commit into
mainfrom
feat/verify-socials-pfp

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What

In the verify-socials onboarding step, SocialRow rendered platform + @handle · N followers but no profile image, even though the avatar field is now populated. This renders each connected social's avatar so users can visually confirm the auto-match.

Changes

  • components/Onboarding/SocialRow.tsx — add the shared shadcn Avatar (circular, radius-full per DESIGN.md) before the platform/handle text.
    • AvatarImage from social.avatar when present.
    • AvatarFallback to the handle/platform initial when avatar is null — achromatic chrome, no color introduced.

Render-side only; mirrors the sibling RosterArtistRow avatar pattern.

Verification

  • pnpm exec tsc --noEmit — clean for SocialRow.tsx.
  • pnpm exec eslint components/Onboarding/SocialRow.tsx — clean.
  • Screenshot: pending — the verify-socials step requires an authenticated account with a claimed roster + matched socials to reach; not captured in this render-only change. Follow-up visual check recommended on preview.

Targets main. Part of chat#1885 (converge/polish onboarding backlog — verify-socials pfp row).

🤖 Generated with Claude Code


Summary by cubic

Render profile images for connected socials in the verify-socials step so users can visually confirm the auto-match. Adds the shared shadcn Avatar to components/Onboarding/SocialRow.tsx, showing social.avatar before the text and falling back to the uppercase first letter of the handle/platform when missing (refs chat#1885).

Written for commit 64c7474. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview Jul 27, 2026 8:17pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

SocialRow now renders each matched social account with its avatar when available, or an uppercase initial derived from the username or platform. Existing platform, handle, and follower-count values remain displayed.

Changes

Social row avatar rendering

Layer / File(s) Summary
Avatar display and fallback
components/Onboarding/SocialRow.tsx
Adds avatar components, computes a username/platform initial fallback, and updates the row layout to display the avatar alongside existing social metadata.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A social row gains a friendly face,
Or initials step in with grace.
Handles remain, counts still flow,
While tiny avatars steal the show.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Solid & Clean Code ⚠️ Warning AvatarFallback still uses an untrimmed username, so whitespace or '@' can render a blank initial and the new logic stays brittle. Normalize the username before deriving the initial (trim, strip leading @, then fall back to platform or '?'); consider a tiny reusable helper.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/verify-socials-pfp

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds profile image display to social rows in onboarding for visual confirmation. Bounded render-only change using existing avatar components.

Re-trigger cubic

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Preview verification — 2026-07-27

Preview: https://chat-krmd757p9-recoup.vercel.app — built from c1e734cf (PR head, sha-filtered deployment, state success).

⚠️ Tested via /onboarding/roster, not /setup/socials — and that matters. See "Needs a rebase" below.

Results

# Check Expected Actual Result
1 Avatars render on matched socials image per social 79 images, 77 loaded, 0 broken across a 22-artist roster
2 AvatarImage path real profile photo Twitter / Spotify / YouTube rows render i.scdn.co + arweave.net photos
3 AvatarFallback path initial, no broken image TikTok → C, Instagram → Z (from username), no broken-image icon
4 Layout with avatar added platform + handle + followers still readable, truncation intact row reads size-9 avatar → platform → @handle · N followers, edit pencil right-aligned
5 Cold-start account (no matched socials) component simply doesn't render "No profiles were auto-matched" — zero SocialRows

Both branches of the change are visible in one frame — Charlie Zaa has photos on Twitter/Spotify/YouTube and initials on TikTok/Instagram:

verify-socials with real avatars and initial fallbacks

Cold-start account, manually-added Spotify profile — fallback only:

fallback initial on a manually added social

⚠️ Needs a rebase before merge

This branch is from 2026-07-22 and has no app/setup/ directory at all/setup/socials returns "Page not found" on its own preview. The only route to SocialRow on this build is /onboarding/roster, which was deleted from main today by chat#1887 (merged, 7168ac66) and is now a 308 into /setup/artists.

So the verification above is real — the component change is route-independent and correct — but it was exercised on a route that no longer exists. Rebase onto main, then re-check at /setup/socials, which is the canonical path post-#1887. The diff itself (one file, SocialRow.tsx) shouldn't conflict; only the surrounding route context changed.

Pre-existing bug this surfaced (not caused by this PR)

Black Dave MK2 → Spotify renders @artist · 0 followers with an A initial — on real production data. The handle parsed to the literal string "artist" (so the fallback initial is A, from username, not from the artist name), and the follower count is zero.

I reproduced the same thing independently: on a fresh account I added a Spotify profile through the in-flow search, picked Ana Bárbara (1.8M followers), and the saved row came back @artist · 0 followers with an A initial too. So it isn't one bad legacy row — the add-social path doesn't resolve handle, follower count, or avatar.

This corroborates what chat#1897 already flags as partial ("pfp + follower-count confirmation still needs an api/Apify resolve path"), and adds a detail worth carrying there: the handle is wrong too, not just the pfp and count. It also means this PR's fallback is doing real work — those rows would otherwise be a broken image.

Nothing to change here; SocialRow renders exactly what it's given.

Each auto-matched social now shows its profile image (the `avatar`
field, now populated) so users can visually confirm the match. Falls
back to the handle/platform initial when no avatar is present. Uses the
shared shadcn Avatar (circular, achromatic fallback) per DESIGN.md.

Refs chat#1885.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/Onboarding/SocialRow.tsx`:
- Around line 37-40: Update the initial calculation in SocialRow to trim and
normalize the username before deriving its first character, so values like "@"
or whitespace are treated as missing. When no usable username remains, fall back
to the platform and then "?"; preserve the existing removal of a leading @ and
uppercase behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd438481-7d36-4c9b-aa46-3f71903c04ab

📥 Commits

Reviewing files that changed from the base of the PR and between 7168ac6 and 64c7474.

📒 Files selected for processing (1)
  • components/Onboarding/SocialRow.tsx

Comment on lines +37 to +40
const initial = (social.username || platform || "?")
.replace(/^@/, "")
.charAt(0)
.toUpperCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Guarantee a visible fallback for incomplete usernames.

A truthy username such as "@" or whitespace currently produces an empty or blank AvatarFallback. Trim and normalize the username before selecting its initial, then fall back to the platform or "?".

Proposed fix
-  const initial = (social.username || platform || "?")
-    .replace(/^`@/`, "")
-    .charAt(0)
-    .toUpperCase();
+  const initialSource =
+    social.username?.trim().replace(/^@+/, "") || platform.trim();
+  const initial = initialSource.charAt(0).toUpperCase() || "?";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const initial = (social.username || platform || "?")
.replace(/^@/, "")
.charAt(0)
.toUpperCase();
const initialSource =
social.username?.trim().replace(/^@+/, "") || platform.trim();
const initial = initialSource.charAt(0).toUpperCase() || "?";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/Onboarding/SocialRow.tsx` around lines 37 - 40, Update the initial
calculation in SocialRow to trim and normalize the username before deriving its
first character, so values like "@" or whitespace are treated as missing. When
no usable username remains, fall back to the platform and then "?"; preserve the
existing removal of a leading @ and uppercase behavior.

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Rebased onto main, re-verified at the canonical route — 2026-07-27

Resolves the staleness flagged in my previous comment. That verification was run on /onboarding/roster, a route chat#1887 deleted from main earlier today; this one runs on /setup/socials.

The rebase

c1e734cf64c7474c, rebased onto main (7168ac66) and force-pushed with --force-with-lease.

Check Result
Rebase Clean — 1 commit replayed, no conflicts
Diff vs main Still exactly one file: components/Onboarding/SocialRow.tsx +22/−7, unchanged by the rebase
Tests 68 files / 257 tests pass
tsc --noEmit 8 errors, all pre-existing baseline (SpotifyDeepResearchResult.tsx, extractSendEmailResults.test.ts); none in SocialRow

Routes on the new preview — https://chat-dhhg4zgwh-recoup.vercel.app

Path Before rebase After rebase
/setup/socials 404 "Page not found" HTTP 200
/setup/artists 404 HTTP 200 ✅
/onboarding/roster rendered the flow 308 → /setup/artists (inherits #1887) ✅

Re-verification at /setup/socials

Signed in on the rebased preview and loaded the canonical route directly — it deep-links straight to the socials step, no roster walk needed.

# Check Actual Result
1 Avatars load 76 images, 68 loaded, 0 broken
2 AvatarImage path photos from i.scdn.co, yt3.googleusercontent.com, pbs.twimg.com, p19-common-sign.tiktokcdn-us.com, arweave.net
3 AvatarFallback path Instagram/TikTok/Twitter → A, Apple Music → U; no broken-image icons
4 Row layout size-9 avatar → platform → @handle · N followers, pencil right-aligned, truncation intact

verify-socials at /setup/socials after rebase

Five distinct CDN hosts resolve, which is the useful signal here — the avatar field is populated per-platform from different upstreams, not just Spotify.

Still open (unchanged by the rebase, not this PR's to fix)

Ana Bárbara → Apple Music reads @us · 0 followers with a U initial — the handle parsed from the URL path segment. Same class of bug as the @artist · 0 followers Spotify rows in my previous comment, reproduced independently on a fresh account via the in-flow Spotify search. The add/match path doesn't resolve handle, follower count, or avatar; chat#1897 owns it, and the note there should cover the handle too, not just pfp + count.

This PR renders exactly what it's given, and its fallback is what keeps those rows from showing a broken image.

@sweetmantech
sweetmantech merged commit bbd5165 into main Jul 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant