Repository navigation
fix(onboarding): added signout button in the bottom right corner - #68
Conversation
gkhngyk
left a comment
There was a problem hiding this comment.
Thanks for picking this one up, Sourabh — the component design is clean and mounting it once in the layout is the right call.
One critical thing to fix before this can merge, plus two small nits.
Critical: existing placeholder is still rendered (overlap)
There's already a placeholder SignOutLink in web/src/app/[locale]/(onboarding)/dashboard/onboarding/page.tsx:72 that's rendered in six step views (lines 997, 1090, 1177, 1346, 1428, 1586). It uses the exact same fixed bottom-6 right-6 position and styling as your new button — so as it stands the PR would render two stacked Sign out buttons on every onboarding step.
Fix: remove all six <SignOutLink /> usages in page.tsx and the function definition at line 72 (it'll be orphaned once the call sites go). That makes the new layout-level button the single source of truth — which was the whole point of mounting it in the layout.
Nits (optional)
-
layout.tsxquote-style churn — the diff reformats three existing import lines from double quotes to single quotes. The rest ofweb/src/components/auth/uses double quotes, so reverting those three lines would shrink the diff to just the meaningful change and keeps the file consistent with its neighbors. -
Hardcoded English toast — the button label uses
tAuth('signOut')but the error toast is a fixed English string. Not a blocker since sign-out errors are rare, but anauth.signOutErrorkey would match the rest of the component.
Let me know once the overlap is resolved and I'll re-review. Thanks again!
Hey, thanks for the detailed review — nits are addressed! On the critical item: I looked through Could you double-check? If you're still seeing it on your end, a quick snippet or the exact line range would help me track it down. Happy to clean it up if it's there — just want to make sure I'm not deleting the wrong thing. |
|
You're right — I went back and checked, the file on Both nits are addressed cleanly. Approving and merging. Thanks for the careful work! |
What Changed And Why
Added a new shared client component: onboarding-sign-out-button.tsx.
It renders a fixed bottom-right Sign out button with the LogOut icon, muted styling, hover treatment, focus ring, and a disabled state while sign-out is in progress.
Mounted that button once in the onboarding layout: layout.tsx.
This makes it appear across the whole onboarding flow without repeating the same markup in every step.
The sign-out handler uses Supabase auth.signOut() and then does window.location.href = '/sign-in'.
The reason for the full-page navigation is to force the server-rendered auth layout to read the cleared session immediately, instead of relying on a client-side route transition.
This approach avoids reusing a full marketing header.
It keeps sign-out as a quiet escape hatch rather than giving it top-level visual priority or duplicating branding already present in onboarding.
How To Test The Change
Screenshot
This closes issue #58