Skip to content

Clarify first-run login onboarding and conditional auth messaging across Web/Desktop - #2

Merged
xingh merged 1 commit into
mainfrom
copilot/apply-patch-clarify-login-onboarding
Jul 30, 2026
Merged

Clarify first-run login onboarding and conditional auth messaging across Web/Desktop#2
xingh merged 1 commit into
mainfrom
copilot/apply-patch-clarify-login-onboarding

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown

This change makes first-run account creation explicit (first user becomes admin), removes irrelevant auth UI states, and adds in-flight progress feedback during sign-in/registration. It aligns Web and Desktop login behavior so users only see messages/actions that apply to their current server state.

  • First-run onboarding clarity

    • Web and Desktop now show a dedicated first-run explainer that states the first created account is the administrator.
    • First-run primary action is explicitly “Create administrator account” (instead of generic sign-in/register affordances).
  • State-driven messaging and actions

    • Registration section is shown only when registration is open and first-run is complete.
    • Approval requirement note is shown only when approval is actually required.
    • “Pending approval” is surfaced as informational success-style feedback instead of an error state.
  • Progress feedback during auth operations

    • Added busy status label + spinner/progress indicators while login/registration is in flight.
    • Inputs and auth actions are disabled while busy to prevent duplicate submissions.
    • Busy labels are operation-specific (sign-in vs account/admin-account creation).
  • Role correctness on post-registration sign-in path

    • Web and Desktop continue to honor the role returned by identity service for the new account (no implicit admin elevation outside first registrant path).
public bool ShowRegistrationSection => !IsFirstRun && IsRegistrationOpen;

if (result.IsPendingApproval)
{
    InfoMessage = "Account created. An administrator must approve it before you can sign in.";
    return;
}

@xingh
xingh marked this pull request as ready for review July 30, 2026 22:42
Copilot AI review requested due to automatic review settings July 30, 2026 22:42
@xingh
xingh merged commit df0c61e into main Jul 30, 2026
@xingh
xingh deleted the copilot/apply-patch-clarify-login-onboarding branch July 30, 2026 22:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Web (Blazor) and Desktop (Avalonia) login experiences to be more state-driven: clearly distinguishing first-run onboarding (first user becomes admin), hiding irrelevant registration/approval messaging, and adding in-flight progress feedback during sign-in/registration.

Changes:

  • Added explicit first-run onboarding messaging and a dedicated “Create administrator account” primary action.
  • Made registration/approval UI conditional on server state, and surfaced “pending approval” as informational feedback instead of an error.
  • Added busy/progress indicators and disabled inputs/actions while auth operations are in flight.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/Sovrant.Web/wwwroot/css/sovrant.css Adds styles for first-run info box, success/info messaging, and busy status/spinner.
src/Sovrant.Web/Components/Pages/Login.razor Implements first-run explainer/action, conditional registration + approval note, and busy status UI.
src/Sovrant.Desktop/Views/LoginWindow.axaml Aligns Desktop login UI with first-run/conditional messaging and adds busy label display.
src/Sovrant.Desktop/ViewModels/LoginViewModel.cs Adds state-driven properties/messages and operation-specific busy labels for login/register flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +117 to +120
_firstRun = await IdentityService.IsFirstRunAsync().ConfigureAwait(false);
_registrationOpen = await IdentityService.IsRegistrationOpenAsync().ConfigureAwait(false);
_approvalRequired = !_firstRun && _registrationOpen
&& await IdentityService.IsApprovalRequiredAsync().ConfigureAwait(false);
Comment on lines +44 to +47
IsFirstRun = await _identity.IsFirstRunAsync().ConfigureAwait(true);
IsRegistrationOpen = await _identity.IsRegistrationOpenAsync().ConfigureAwait(true);
IsApprovalRequired = !IsFirstRun && IsRegistrationOpen
&& await _identity.IsApprovalRequiredAsync().ConfigureAwait(true);
Comment on lines +61 to +64
<TextBlock Text="{Binding InfoMessage}"
Foreground="Green"
TextWrapping="Wrap"
IsVisible="{Binding InfoMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
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.

3 participants