Skip to content

Add guest profile exit menu - #50

Merged
rd-code-23 merged 1 commit into
mainfrom
feature/dashboard
Aug 23, 2026
Merged

rd-code-23 merged 1 commit into
mainfrom
feature/dashboard

Conversation

@rd-code-23

Copy link
Copy Markdown
Owner

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

  • Made the current identity area an accessible profile-menu trigger on desktop and mobile.
  • Added an Exit guest menu action for guest identities.
  • Clear the temporary guest-session marker and replace the current route with the welcome page when the user exits.
  • Keep the full guest status visible on desktop while using the compact identity presentation on mobile.
  • Added a project convention that non-trivial JSX logic belongs in named values in the component body, with blank lines separating logical groups.

How it works

The protected pathless application layout owns navigation and guest-session cleanup. It only passes onExitGuest when 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 removes goforlift.guest from 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

  • Added interaction coverage that opens the profile menu, exits guest mode, verifies the session marker is cleared, and confirms navigation to the welcome page.
  • Updated responsive identity assertions for the compact mobile presentation.
  • Confirmed authenticated identities do not expose the guest exit action.

Verification run:

  • pnpm typecheck
  • pnpm test — 67 tests passed (48 API, 19 web)
  • pnpm lint
  • Prettier checks for all changed files

The root pnpm format:check currently reports unrelated pre-existing formatting differences in 36 untouched files; this PR does not rewrite them.

@rd-code-23
rd-code-23 merged commit 4db5a17 into main Aug 23, 2026
1 check passed
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.

1 participant