diff --git a/.gitignore b/.gitignore index f638e00..faa78aa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ artifacts/ # IDE .vs/ +.idea/ .vscode/* !.vscode/launch.json !.vscode/tasks.json diff --git a/FAQ.md b/FAQ.md index 8335f7f..aad2689 100644 --- a/FAQ.md +++ b/FAQ.md @@ -73,6 +73,10 @@ There is no separate activate button in Play. The selected character in the char `Home.razor` + `Home.razor.cs` now act as a small gateway that switches between loading, anonymous auth, and workspace views. Authenticated application state and behavior were moved into `Components/Pages/Workspace.razor`, while reusable concern UI remains under `Components/Pages/HomeControls/`. +## Why does the workspace header sometimes show "Loading user..." briefly? + +`Workspace` initializes authenticated session data after the first render (`OnAfterRenderAsync`). During that first render pass, the header now intentionally shows a null-safe fallback label instead of dereferencing user fields before `/api/me` has been loaded. + ## Why is auth form state kept in `AuthSection` instead of `Home`? Auth inputs, validation, and submit workflows are transient UI concerns, so they now live in `AuthSection`. `Home` keeps shared session/workspace state and cross-control refresh/orchestration only. diff --git a/FRONTEND_PROGRESS.md b/FRONTEND_PROGRESS.md index 3cec15b..aadc277 100644 --- a/FRONTEND_PROGRESS.md +++ b/FRONTEND_PROGRESS.md @@ -9,6 +9,7 @@ Tracking against `UX.md` tasks and decisions. - Legacy TypeScript frontend/runtime artifacts: removed - Home was simplified to a minimal gateway (`Loading` / `Anonymous` / `Workspace`) in a single `Home.razor.cs` class. - The authenticated workspace shell/state/behavior was moved to `Components/Pages/Workspace.razor`. +- Workspace header user identity rendering is now null-safe during first render (`Loading user...` fallback until `/api/me` loads). - Concern controls now own their local form state and mutation workflows; the workspace host handles shared cross-control state refresh. - Skill create/edit flow is now owned by `CharacterPanel` (where characters and their skills are presented together). diff --git a/RpgRoller/Components/Pages/Workspace.razor b/RpgRoller/Components/Pages/Workspace.razor index dc1542d..c55d1d3 100644 --- a/RpgRoller/Components/Pages/Workspace.razor +++ b/RpgRoller/Components/Pages/Workspace.razor @@ -25,7 +25,14 @@
Tabletop utility cockpit
@User!.DisplayName (@User.Username)
+ @if (User is null) + { +Loading user...
+ } + else + { +@User.DisplayName (@User.Username)
+ }Campaign: @(SelectedCampaignName ?? "No campaign selected")
Active: @(ActiveCharacterName ?? "None selected")