Repository navigation
Add identity-aware dashboard introduction - #51
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
The protected dashboard only displayed a generic page heading. New registered users and guests need an intentional introduction that acknowledges how they entered the application without duplicating authentication logic.
What changed
Welcome, Guest.Let's get stronger today.How it works
The access boundary remains the single place that resolves whether the visitor is a guest or registered user. The protected
_applayout places that resolved identity intoApplicationIdentityContextaround the application shell and TanStack Router outlet. The dashboard page reads the same value, so it does not issue another current-user request or repeat guest-session detection.Context is appropriate here because
ApplicationShellis rendered directly and can receive an identity prop, whileDashboardLandingis selected indirectly by TanStack Router inside<Outlet />. The context carries the existing identity across that nested route boundary; it does not create a second identity source or act as a general global store.The identity module also provides
useApplicationIdentity, which centralizes the missing-provider check and gives consumers a non-null, descriptive API. This avoids unsafe assertions and repeated context validation.Scope
This is the first mini-task under #40. It includes only the dashboard introduction and identity delivery needed by that introduction. Weekly activity, scheduled-workout, routines, and workout-history empty states remain separate follow-up tasks.
Testing