Skip to content

fix(onboarding): added signout button in the bottom right corner - #68

Merged
gkhngyk merged 3 commits into
ansvisor:mainfrom
sourabh-31:fix/onboarding-signout
May 21, 2026
Merged

gkhngyk merged 3 commits into
ansvisor:mainfrom
sourabh-31:fix/onboarding-signout

Conversation

@sourabh-31

Copy link
Copy Markdown
Contributor

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


  1. Sign in and enter onboarding. Confirm Sign out appears in the bottom-right on every onboarding step.
  2. Resize the viewport to a short height, around 600px, and scroll longer steps like topics/prompts. Confirm the button stays fixed and visible.
  3. Use Tab until the button is focused. Confirm the focus ring appears and Enter/Space activates it.
  4. Click Sign out. Confirm you land on /sign-in and the session is cleared.
  5. Try opening onboarding or dashboard again after signing out. Confirm you are no longer authenticated.
  6. Sign in with a different account and confirm onboarding starts fresh.
  7. Toggle dark mode and verify the muted text, hover background, and focus styles still look correct.

Screenshot


image

This closes issue #58

@gkhngyk gkhngyk 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.

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)

  1. layout.tsx quote-style churn — the diff reformats three existing import lines from double quotes to single quotes. The rest of web/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.

  2. 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 an auth.signOutError key would match the rest of the component.

Let me know once the overlap is resolved and I'll re-review. Thanks again!

@sourabh-31

Copy link
Copy Markdown
Contributor Author

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)

  1. layout.tsx quote-style churn — the diff reformats three existing import lines from double quotes to single quotes. The rest of web/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.
  2. 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 an auth.signOutError key 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 web/src/app/[locale]/(onboarding)/dashboard/onboarding/page.tsx but couldn't find the SignOutLink definition at line 72 or any of the six call sites you mentioned. It's possible the file has shifted since your review, or it may have been removed in a prior commit.

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.

@gkhngyk

gkhngyk commented May 21, 2026

Copy link
Copy Markdown
Contributor

You're right — I went back and checked, the file on main doesn't have that placeholder. No overlap, nothing else to fix.

Both nits are addressed cleanly. Approving and merging. Thanks for the careful work!

@gkhngyk
gkhngyk merged commit d7b3907 into ansvisor:main May 21, 2026
@gkhngyk gkhngyk mentioned this pull request May 26, 2026
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.

2 participants