Skip to content

US-002#107

Merged
m-GDEV merged 18 commits intomasterfrom
US-002
Mar 6, 2026
Merged

US-002#107
m-GDEV merged 18 commits intomasterfrom
US-002

Conversation

@m-GDEV
Copy link
Owner

@m-GDEV m-GDEV commented Mar 4, 2026

Checklist

  • Responsive UI & Consistent Theme
  • Confirmation for Destructive actions
  • Helpful tooltips
  • Client-side and server-side input validation
  • Load under 3 seconds, performance optimizations (lazy loading, etc)
  • Authorized services must be authorized
  • Test happy paths and unhappy paths
  • Write unit tests for new functionality

Copilot AI review requested due to automatic review settings March 4, 2026 16:01
@deepsource-io
Copy link
Contributor

deepsource-io bot commented Mar 4, 2026

DeepSource Code Review

We reviewed changes in 29dffb1...82e6d43 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Feedback

  • Refactor without updating tests
    • Large, cross-cutting edits lowered coverage because tests targeted prior implementations instead of public behavior; they weren't adapted. Focus tests on observable contracts and add targeted unit tests for modified modules to prevent regressions.
  • Hidden cross-module coupling
    • Many files changed suggests shared responsibilities and tight coupling, so small edits ripple widely despite clean code. Extract clear interfaces and invert dependencies to confine future changes to one module.
  • Tooling green, intent missing
    • Perfect automated grades but no positives and a coverage drop mean linters pass while behavioral context is absent. Complement static checks with API-level tests, docstrings, and a changelog or migration notes so reviewers see intent and risk.

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Mar 6, 2026 10:44a.m. Review ↗
Test coverage Mar 6, 2026 10:45a.m. Review ↗

Code Coverage Summary

Language Line Coverage (New Code) Line Coverage (Overall)
Aggregate
16.3%
[⤫ below threshold]
50.7%
[▼ down 4.1% from master]
[⤫ below threshold]
C#
16.3%
50.7%
[▼ down 4.1% from master]

➟ Additional coverage metrics may have been reported. See full coverage report ↗

Copy link
Contributor

Copilot AI left a comment

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 introduces an onboarding flow for first-time setup (admin creation), refactors some shared utilities/namespaces, and expands the notification UX in the Blazor presentation layer.

Changes:

  • Add onboarding UI + API support to create an initial admin user (with shared credential validation).
  • Refactor view models into ViewModels.Pages / ViewModels.Components namespaces and update Razor inheritance/usings accordingly.
  • Revamp notifications UI (stacked notifications with details dialog + auto-clear logic) and adjust Sysinfocus stepper styling.

Reviewed changes

Copilot reviewed 56 out of 57 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
WardrobeManager.Shared/StaticResources/StaticValidators.cs Registers credentials validator and adds AuthenticationCredentialsModelValidator.
WardrobeManager.Shared/Services/MiscMethods.cs Moves MiscMethods into WardrobeManager.Shared.Services namespace and cleans usings.
WardrobeManager.Shared/Services/IMiscMethods.cs Moves IMiscMethods into WardrobeManager.Shared.Services namespace.
WardrobeManager.Shared/Models/NotificationMessage.cs Adds DialogOpen state and makes CreationDate readonly.
WardrobeManager.Shared/Models/AuthenticationCredentialsModel.cs Converts credentials model to a record with properties (instead of public fields).
WardrobeManager.Shared/Models/AdminUserCredentials.cs Removes old onboarding credentials model.
WardrobeManager.Shared.Tests/StaticResources/MiscMethodsTests.cs Updates tests to reference the new MiscMethods namespace.
WardrobeManager.Presentation/wwwroot/css/sysinfocus-styles.css Adds z-index overrides to fix Sysinfocus stepper connector rendering.
WardrobeManager.Presentation/_Imports.razor Splits view model usings into Components and Pages.
WardrobeManager.Presentation/ViewModels/Pages/WardrobeViewModel.cs Moves wardrobe view model into ViewModels.Pages namespace and trims usings.
WardrobeManager.Presentation/ViewModels/Pages/SignupViewModel.cs Adds client-side validation call prior to signup and updates namespace.
WardrobeManager.Presentation/ViewModels/Pages/OnboardingViewModel.cs Adds onboarding state machine + admin creation behavior.
WardrobeManager.Presentation/ViewModels/Pages/MainLayoutViewModel.cs Introduces a layout view model (initial onboarding redirect + theme init).
WardrobeManager.Presentation/ViewModels/Pages/LoginViewModel.cs Moves login view model into ViewModels.Pages.
WardrobeManager.Presentation/ViewModels/Pages/HomeViewModel.cs Adds new empty home view model under Pages.
WardrobeManager.Presentation/ViewModels/Pages/DashboardViewModel.cs Adds new empty dashboard view model under Pages.
WardrobeManager.Presentation/ViewModels/Pages/AddClothingItemViewModel.cs Updates namespace and adjusts validator call to be explicit generic.
WardrobeManager.Presentation/ViewModels/HomeViewModel.cs Removes old home view model from previous namespace.
WardrobeManager.Presentation/ViewModels/DashboardViewModel.cs Removes old dashboard view model from previous namespace.
WardrobeManager.Presentation/ViewModels/Components/NotificationsViewModel.cs Adds notification view model (auto-clear, formatting, dismiss).
WardrobeManager.Presentation/ViewModels/Components/NavMenuViewModel.cs Moves nav bar VM into ViewModels.Components and updates references.
WardrobeManager.Presentation/Services/Interfaces/IApiService.cs Changes onboarding method signature to Result<string> and updates param type.
WardrobeManager.Presentation/Services/Implementation/ApiService.cs Implements new onboarding API call returning Result<string>.
WardrobeManager.Presentation/Properties/launchSettings.json Adds DOTNET_WATCH_RESTART_ON_RUDE_EDIT.
WardrobeManager.Presentation/Program.cs Adds Shared.Services import (for IMiscMethods/MiscMethods).
WardrobeManager.Presentation/Pages/Test.razor Replaces test page content with stepper and notification demos.
WardrobeManager.Presentation/Pages/Public/Signup.razor Updates component inheritance to fully qualified view model type.
WardrobeManager.Presentation/Pages/Public/Onboarding.razor Implements onboarding UI with stepper + section switching.
WardrobeManager.Presentation/Pages/Public/Login.razor Updates component inheritance to fully qualified view model type.
WardrobeManager.Presentation/Pages/Public/Home.razor Updates component inheritance to fully qualified view model type.
WardrobeManager.Presentation/Pages/Authenticated/Wardrobe.razor Updates view model inheritance/alias to new namespace.
WardrobeManager.Presentation/Pages/Authenticated/Dashboard.razor Updates owning component base to fully qualified dashboard VM type.
WardrobeManager.Presentation/Pages/Authenticated/AddClothingItem.razor Updates component inheritance to fully qualified view model type.
WardrobeManager.Presentation/Layout/NavMenu.razor Updates nav menu VM type and adds a link to /test.
WardrobeManager.Presentation/Layout/MainLayout.razor Switches to MVVM layout base and wires ErrorBoundary + click handling via VM.
WardrobeManager.Presentation/Identity/CookieAuthenticationStateProvider.cs Minor whitespace cleanup.
WardrobeManager.Presentation/CustomHttpMessageHandler.cs Suppresses notifications for benign 401s from auth-state checks.
WardrobeManager.Presentation/Components/Shared/Notifications.razor Rebuilds notifications UI to use NotificationsViewModel and dialogs.
WardrobeManager.Presentation/Components/Onboarding/OnboardingSection.razor Reworks onboarding section layout and adds back/next/skip controls.
WardrobeManager.Presentation.Tests/ViewModels/WardrobeViewModelTests.cs Updates imports for new view model namespace.
WardrobeManager.Presentation.Tests/ViewModels/SignupViewModelTests.cs Updates imports and test setup for credentials model changes.
WardrobeManager.Presentation.Tests/ViewModels/NavBarViewModelTests.cs Updates imports for new VM namespaces.
WardrobeManager.Presentation.Tests/ViewModels/LoginViewModelTests.cs Updates imports for new view model namespace.
WardrobeManager.Presentation.Tests/ViewModels/HomeViewModelTests.cs Updates imports for new view model namespace.
WardrobeManager.Presentation.Tests/ViewModels/DashboardViewModelTests.cs Updates imports for new view model namespace.
WardrobeManager.Presentation.Tests/ViewModels/AddClothingItemViewModelTests.cs Updates imports for new namespaces and IMiscMethods.
WardrobeManager.Presentation.Tests/ApiServiceTests.cs Updates onboarding API tests for new credential model and Result<string> return.
WardrobeManager.Api/Services/Interfaces/IUserService.cs Updates admin-creation signature to accept AuthenticationCredentialsModel.
WardrobeManager.Api/Services/Implementation/UserService.cs Uses credentials model for admin creation instead of raw email/password params.
WardrobeManager.Api/Services/Implementation/ClothingService.cs Adds Shared.Services import (for IMiscMethods).
WardrobeManager.Api/Properties/launchSettings.json Adds DOTNET_WATCH_RESTART_ON_RUDE_EDIT.
WardrobeManager.Api/Program.cs Adds Shared.Services import.
WardrobeManager.Api/Endpoints/IdentityEndpoints.cs Validates credentials server-side before creating admin user.
WardrobeManager.Api.Tests/Services/UserServiceTests.cs Updates tests for new admin-creation method signature.
WardrobeManager.Api.Tests/Services/ClothingServiceTests.cs Adds Shared.Services import for IMiscMethods.
WardrobeManager.Api.Tests/Endpoints/IdentityEndpointsTests.cs Updates endpoint tests to use AuthenticationCredentialsModel.
Comments suppressed due to low confidence (2)

WardrobeManager.Presentation/ViewModels/Pages/SignupViewModel.cs:68

  • When loginSuccess is false, the method navigates to LoginViewModel but then continues and also posts a success notification + navigates to DashboardViewModel. Add a return after handling the failed login (or restructure control flow) so the failure path can’t fall through to the success path.
    WardrobeManager.Presentation/ViewModels/Pages/SignupViewModel.cs:56
  • SignupAsync continues to call identityService.SignupAsync even when validation fails. This will attempt server calls with invalid credentials and can lead to confusing UX. Return early when res.Success is false.

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

@m-GDEV m-GDEV merged commit 811a8a1 into master Mar 6, 2026
8 checks passed
@m-GDEV m-GDEV deleted the US-002 branch March 6, 2026 10:51
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.

2 participants