Skip to content

Add identity-aware dashboard introduction - #51

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

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

Conversation

@rd-code-23

Copy link
Copy Markdown
Owner

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

  • Replaced the generic dashboard heading with an identity-aware introduction.
  • Guests see Welcome, Guest.
  • Registered users see their display name, falling back to their email when no display name exists.
  • Added the onboarding message Let's get stronger today.
  • Made the identity already resolved by the protected application layout available to nested route pages through a narrowly scoped React context.
  • Added focused tests for guest and registered-user wording and updated affected integration assertions.

How it works

The access boundary remains the single place that resolves whether the visitor is a guest or registered user. The protected _app layout places that resolved identity into ApplicationIdentityContext around 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 ApplicationShell is rendered directly and can receive an identity prop, while DashboardLanding is 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

  • Added direct coverage for guest and registered-user greetings.
  • Updated the welcome-to-guest-dashboard and application-shell integration expectations.
  • Verified all 21 web tests pass.
  • Verified web type-checking, ESLint, changed-file formatting, and diff checks.

@rd-code-23
rd-code-23 merged commit d6f0387 into main Aug 24, 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