-
Notifications
You must be signed in to change notification settings - Fork 291
feat: add profile preview mode toggle with reusable hook for all profile components #5379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Co-authored-by: omBratteng <[email protected]>
Co-authored-by: omBratteng <[email protected]>
|
@copilot Use query param |
Co-authored-by: omBratteng <[email protected]>
Done in commit 9508fc0. Changes:
The toggle is now in the sidebar and uses shallow routing to update the URL without full page reload. |
|
@copilot Convert it to a re-usable hook, and make sure that it is applied to ProfileUserStack |
…ents Co-authored-by: omBratteng <[email protected]>
Done in commit 62ad485. Changes:
The hook centralizes the preview logic: when |
Co-authored-by: omBratteng <[email protected]>
|
@copilot Ensure that the preview widget properly breaks the text so that the toggle is not pushed outside of the widget. |
Co-authored-by: omBratteng <[email protected]>
Done in commit d4078df. Fixed the text wrapping by:
The toggle switch now stays in place and text wraps properly within the widget boundaries. |


Changes
Added toggle widget on user profile page that allows viewing profile as a visitor would see it. Only visible when viewing your own profile.
Implementation:
ProfilePreviewTogglecomponent with Switch control and proper text wrappingProfileHeaderto accept optionalisSameUserprop overrideProfileWidgetscomponent?preview=truefor state managementuseProfilePreviewhook that centralizes preview logicisOwnerBehavior in preview mode:
UI improvements:
min-w-0andflex-1for responsive text handlingshrink-0classbreak-wordson description textUI:
Toggle in sidebar (preview OFF):

Toggle in sidebar with preview ON (note

?preview=truein URL):Files changed:
packages/shared/src/components/profile/ProfilePreviewToggle.tsx(new - with responsive layout)packages/shared/src/components/profile/ProfilePreviewToggle.spec.tsx(new)packages/shared/src/components/profile/ProfileHeader.tsx(modified)packages/shared/src/hooks/profile/useProfilePreview.ts(new - reusable hook)packages/shared/src/features/profile/hooks/useUserStack.ts(modified - uses hook)packages/shared/src/features/profile/hooks/useUserTools.ts(modified - uses hook)packages/shared/src/features/profile/hooks/useHotTakes.ts(modified - uses hook)packages/shared/src/features/profile/hooks/useUserWorkspacePhotos.ts(modified - uses hook)packages/shared/src/features/profile/components/ProfileWidgets/ProfileWidgets.tsx(modified - uses hook)packages/shared/src/features/profile/components/experience/UserExperiencesList.tsx(modified - hides edit links)packages/webapp/pages/[userId]/index.tsx(modified)Events
No new tracking events.
Experiment
No new experiments.
Manual Testing
On those affected packages:
Did you test the modified components media queries?
Did you test on actual mobile devices?
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Preview domain
https://copilot-add-widget-preview-toggl.preview.app.daily.dev