[2026-01-21] Guest Mode: Auth State & UI Implementation
Task Metadata
Date: 2026-01-21
Status: Complete
Objective
Goal: Permanently enable the Dashboard for unauthenticated users and implement a "Guest" auth state to support offline logging.
- Trigger: Guest Mode Architecture requires the UI to be accessible without a login session.
- Current State: The
Authenticatorgate prevents access to/trackfor unauthenticated users.
Technical Strategy
We will adopt a "Null Object" pattern for the guest user to simplify component logic and remove the hard auth gate in Tracker.tsx.
- Key Decisions:
- GUEST_USER Constant: Define a standard user object for guests.
- Auth Guard Removal: Modify
Tracker.tsxto render the dashboard by default, showing theAuthenticatoronly when "Sign In" is explicitly clicked. - Conditional UI: Update
HeaderandDashboardto adapt based on whether the user is a guest (e.g., showing "Sign In" instead of "Sign Out").
- Files Modified:
frontend/src/pages/Tracker.tsx: Removed the mandatoryAuthenticatorwrap.frontend/src/pages/Dashboard.tsx: AddedGUEST_USERand handled conditional session fetching.frontend/src/components/Header.tsx: Added support for guest state (Sign In button).
Execution Plan
- Step 1: Modify
Header.tsxto toggle between "Sign In" (Guest) and "Sign Out" (Auth). - Step 2: Define
GUEST_USERconstant and updateDashboard.tsx. - Step 3: Modify
Tracker.tsxto remove the Auth Guard.
Execution Notes
- Implementation: Successfully transitioned to a "Guest First" UI where the dashboard is the default entry point.
- Documentation: Updated
docs/architecture/decisions/006_guest_mode_architecture/index.mdto reflect these UI changes.
User Approval & Key Learnings
Key Learnings
- The "Null Object" pattern for the guest user significantly reduced conditional logic (ternaries/null checks) in child components.