fix: show loader instead of login form when demo mode is active#1588
Conversation
Prevents the login form from flashing on screen when /login?mode=demo is loaded, while app.component handles the demo login API call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the login page to avoid briefly rendering the login form when mode=demo is present in the query string, showing a loader instead while the app initiates demo login.
Changes:
- Add
isDemoModederived fromActivatedRoutequery params to drive demo-mode UI. - Render a demo loader (
mat-spinner+ message) instead of the login form when demo mode is active. - Skip Google One Tap initialization when demo mode is active.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
frontend/src/app/components/login/login.component.ts |
Adds demo-mode flag, imports spinner module, and gates Google One Tap init. |
frontend/src/app/components/login/login.component.html |
Introduces @if (isDemoMode) branch to show a loader instead of the login form. |
frontend/src/app/components/login/login.component.css |
Adds styling for the demo loader layout/text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @if (isDemoMode) { | ||
| <div class="wrapper background-decoration"> | ||
| <div class="login-page demo-loader"> | ||
| <mat-spinner diameter="48"></mat-spinner> | ||
| <p class="mat-body-1 demo-loader__text">Loading demo account...</p> |
There was a problem hiding this comment.
New demo-mode branch introduces UI/behavior (show spinner + hide login form when mode=demo) but there is no corresponding unit test. Please extend login.component.spec.ts to cover mode=demo (e.g., set query params to demo, assert spinner/loader text is rendered and the login form is not, and optionally assert Google One Tap init is skipped).
Prevents the login form from flashing on screen when /login?mode=demo is loaded, while app.component handles the demo login API call.