Skip to content

Conversation

@idoshamun
Copy link
Member

@idoshamun idoshamun commented Jan 8, 2026

Summary

This PR implements Phase 2 of the Flexible Social Media Links refactor on the frontend. It replaces the 13 individual social media input fields with a unified, flexible socialLinks array that supports auto-detection of platforms from URLs.

Changes

  • New SocialLinksInput component - Single URL input with platform auto-detection and visual feedback ("GitHub detected ✓")
  • Updated useUserInfoForm hook - Manages socialLinks array with backwards compatibility for legacy fields
  • Extended platform detection - Added support for Threads, Bluesky, Mastodon, Roadmap, CodePen, Reddit, Hashnode
  • Updated profile display components - Both AboutMe components prefer socialLinks array with fallback to legacy fields
  • Updated TypeScript interfaces - Added UserSocialLink type and socialLinks field to user interfaces
  • Updated GraphQL queries - Added socialLinks { platform url } to relevant queries

Related Issues

  • ENG-251: Extend platformDetection.tsx with all profile social platforms
  • ENG-252: Update frontend user interfaces and GraphQL queries
  • ENG-253: Update profile display components to use socialLinks array
  • ENG-254: Refactor profile edit form to URL-only input with auto-detection

Test plan

  • Verify profile edit form shows new URL input instead of 13 individual fields
  • Test adding a GitHub URL and verify "GitHub detected ✓" feedback appears
  • Test adding LinkedIn, Twitter, YouTube URLs and verify correct detection
  • Test adding unknown URL and verify it's added as "Link"
  • Test removing links from the list
  • Verify profile display shows social links correctly
  • Verify backwards compatibility with existing users who have legacy field data

Preview domain

https://flexible-links-phase-2.preview.app.daily.dev

Adds support for user profile social platforms to the platform detection utility:

New platforms:
- Threads (threads.net)
- Bluesky (bsky.app)
- Mastodon (common instances + URL pattern detection for /@username)
- Roadmap (roadmap.sh)
- CodePen (codepen.io)
- Reddit (reddit.com)
- Hashnode (hashnode.com, hashnode.dev)

Also adds corresponding SocialMediaType enum values for the new platforms.

Closes ENG-251
Updates TypeScript interfaces and GraphQL queries to support the new
socialLinks array field:

- Add UserSocialLink interface (platform, url)
- Add socialLinks field to PublicProfile and UserProfile interfaces
- Add socialLinks to USER_BY_ID_STATIC_FIELDS_QUERY
- Add socialLinks to UPDATE_USER_PROFILE_MUTATION response
- Add socialLinks to UPDATE_USER_INFO_MUTATION response
- Mark individual social fields as @deprecated

Legacy fields kept for backwards compatibility during migration.

Closes ENG-252
Updates AboutMe components to render social links from the new array structure:

- Add PLATFORM_CONFIG mapping for icons and labels
- Add mapSocialLinksToDisplay() for converting socialLinks to display format
- Add buildLegacySocialLinks() as deprecated fallback for legacy fields
- Prefer user.socialLinks when available, fall back to legacy fields
- Support all 13 platforms with proper icons
- Unknown platforms fall back to generic LinkIcon

Backwards compatible: existing users without socialLinks populated
will still see their links from legacy fields.

Closes ENG-253
Replace 13 individual social media input fields with a unified SocialLinksInput
component that uses URL-based platform auto-detection.

- Add SocialLinksInput component with platform detection and visual feedback
- Update useUserInfoForm hook to manage socialLinks array
- Update Profile settings page to use new SocialLinksInput
- Add backwards compatibility for users with legacy individual fields
@vercel
Copy link

vercel bot commented Jan 8, 2026

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

Project Deployment Review Updated (UTC)
daily-webapp Ready Ready Preview Jan 12, 2026 8:51am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
storybook Ignored Ignored Jan 12, 2026 8:51am

@idoshamun
Copy link
Member Author

@omBratteng haven't reviewed it yet. hence it's draft. there could be some hallucinations here

- Create socialLink.tsx with shared PLATFORM_LABELS, PLATFORM_ICONS, and helper functions
- Add SocialPlatform type for exhaustive type checking on platform configurations
- Refactor SocialLinksInput, AboutMe components, and useUserInfoForm to use shared utilities
- Add missing social media icons to jobs page SocialMediaIconMap
- Reduce code duplication by ~400 lines across components
- Create generic platform system (platforms.tsx) with shared core and
  context-specific extensions for org/user profiles
- Refactor socialLink.tsx and platformDetection.tsx to use generic platform system
- Remove unused AboutMe widget component and spec file (dead code)
- Add toast notifications for better user feedback in SocialLinksInput
- Add code review guidelines to AGENTS.md for dead code cleanup
The settings page was showing different social links than the profile
page because it relied on boot endpoint data which doesn't include
socialLinks. Now fetches the full profile via GraphQL to ensure
consistency with the public profile page.
Remove all legacy individual social link fields (twitter, github, linkedin,
portfolio, youtube, stackoverflow, reddit, roadmap, codepen, mastodon,
bluesky, threads, hashnode) in favor of the flexible socialLinks array.

Changes:
- Remove legacy field fallback logic from socialLink.tsx
- Remove deprecated fields from PublicProfile and UserProfile interfaces
- Remove legacy fields from GraphQL queries/mutations
- Update ProfileLayout to extract Twitter handle from socialLinks
- Update recruiter page to use socialLinks for LinkedIn
- Remove Twitter field from registration forms
- Simplify useProfileForm and useUserInfoForm (legacy social validation)
- Update AboutMe tests to use socialLinks array format
@idoshamun idoshamun merged commit 759db10 into main Jan 12, 2026
11 checks passed
@idoshamun idoshamun deleted the flexible-links-phase-2 branch January 12, 2026 12:47
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.

3 participants