Repository navigation
Add guest profile exit menu - #50
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Guest users could enter the application but had no clear, conventional way to leave guest mode. An always-visible exit control also competed with the identity text in the narrow desktop sidebar and was unclear on mobile when only its icon was visible.
What changed
How it works
The protected pathless application layout owns navigation and guest-session cleanup. It only passes
onExitGuestwhen the resolved identity is a guest. The application shell uses that callback to decide whether its profile menu should expose the guest exit action. Selecting the action removesgoforlift.guestfrom session storage and navigates to/with history replacement, so the exited application page is not retained as the active history entry.The profile menu is local UI state inside each responsive identity summary. The exit condition is calculated before JSX as
shouldShowGuestMenu, keeping the returned markup focused on structure.Why this design
Logout and exit actions are conventionally grouped under a user profile control, so the behavior is discoverable without permanently occupying navigation space. Session cleanup remains in the route layout because it coordinates application-level navigation, while the shell remains responsible for presentation and interaction.
This PR intentionally implements only guest exit. Registered-user logout remains a separate flow because it must invalidate the server-side session and handle CSRF correctly.
Testing
Verification run:
pnpm typecheckpnpm test— 67 tests passed (48 API, 19 web)pnpm lintThe root
pnpm format:checkcurrently reports unrelated pre-existing formatting differences in 36 untouched files; this PR does not rewrite them.