Skip to content

fix: add uniform elevation banners to remaining 5 admin-required pages#506

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/elevation-banners-remaining
May 22, 2026
Merged

fix: add uniform elevation banners to remaining 5 admin-required pages#506
laurentiu021 merged 1 commit into
mainfrom
fix/elevation-banners-remaining

Conversation

@laurentiu021
Copy link
Copy Markdown
Owner

@laurentiu021 laurentiu021 commented May 22, 2026

Completes uniform elevation banner coverage. All 10 admin-required pages now have identical design: grey banner with reason + blue button (not elevated), green banner with confirmation (elevated).

Summary by CodeRabbit

  • New Features

    • Added administrator privilege elevation support across multiple screens.
    • Added visual status indicators showing whether the app is running with administrator privileges.
    • Added "Run as administrator" buttons in system management screens for easy elevation when needed.
  • UI/UX Improvements

    • Enhanced screen layouts with elevation status banners providing clear feedback on privilege level.

Review Change Stack

Apply the same Surface2/green banner pattern (matching WindowsUpdateView,
PrivacyView, WindowsFeaturesView, DnsHostsView, ServicesView) to:
- CleanupView (replaced old orange warning banner)
- SystemHealthView
- PerformanceView
- NetworkRepairView
- AppBlockerView

Each page shows a grey banner with shield icon + reason when not elevated,
and a green confirmation banner when elevated. ViewModels that were missing
IsElevated/RelaunchAsAdminCommand have been updated accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ff417b64-ce8e-4387-b5bb-e77e991af273

📥 Commits

Reviewing files that changed from the base of the PR and between de48e7e and c3c542c.

📒 Files selected for processing (8)
  • SysManager/SysManager/ViewModels/AppBlockerViewModel.cs
  • SysManager/SysManager/ViewModels/NetworkRepairViewModel.cs
  • SysManager/SysManager/ViewModels/PerformanceViewModel.cs
  • SysManager/SysManager/Views/AppBlockerView.xaml
  • SysManager/SysManager/Views/CleanupView.xaml
  • SysManager/SysManager/Views/NetworkRepairView.xaml
  • SysManager/SysManager/Views/PerformanceView.xaml
  • SysManager/SysManager/Views/SystemHealthView.xaml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & unit tests
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (8)
SysManager/SysManager/ViewModels/PerformanceViewModel.cs (1)

10-10: LGTM!

Also applies to: 31-31, 59-59, 548-553

SysManager/SysManager/ViewModels/AppBlockerViewModel.cs (1)

35-40: LGTM!

SysManager/SysManager/ViewModels/NetworkRepairViewModel.cs (1)

19-19: LGTM!

Also applies to: 27-27, 30-35

SysManager/SysManager/Views/AppBlockerView.xaml (1)

16-16: LGTM!

Also applies to: 29-54, 56-56, 64-64, 73-73, 87-87

SysManager/SysManager/Views/CleanupView.xaml (1)

29-31: LGTM!

Also applies to: 33-40, 42-43, 45-53

SysManager/SysManager/Views/NetworkRepairView.xaml (1)

14-14: LGTM!

Also applies to: 24-50

SysManager/SysManager/Views/PerformanceView.xaml (1)

17-17: LGTM!

Also applies to: 29-53, 56-56, 67-67, 80-80, 311-311

SysManager/SysManager/Views/SystemHealthView.xaml (1)

29-53: LGTM!


📝 Walkthrough

Walkthrough

This PR adds elevation state tracking and admin relaunch capability across the application by introducing observable IsElevated properties and RelaunchAsAdmin commands in ViewModels, and displaying conditional elevation-status banners in XAML views that prompt users to "Run as administrator" when the app lacks elevated privileges.

Changes

Elevation Status and Admin Relaunch Support

Layer / File(s) Summary
PerformanceViewModel elevation support
SysManager/SysManager/ViewModels/PerformanceViewModel.cs
Adds using SysManager.Helpers, introduces [ObservableProperty] IsElevated property initialized during InitAsync via AdminHelper.IsElevated(), and implements [RelayCommand] RelaunchAsAdmin() to trigger admin relaunch and shut down the application on success.
AppBlocker and NetworkRepair ViewModel elevation commands
SysManager/SysManager/ViewModels/AppBlockerViewModel.cs, SysManager/SysManager/ViewModels/NetworkRepairViewModel.cs
Adds [RelayCommand] RelaunchAsAdmin() to AppBlockerViewModel, and introduces observable IsElevated, IsRepairing, RepairStatus, and RepairNeedsReboot properties to NetworkRepairViewModel with corresponding relaunch command.
Elevation status banners across all views
SysManager/SysManager/Views/AppBlockerView.xaml, SysManager/SysManager/Views/CleanupView.xaml, SysManager/SysManager/Views/NetworkRepairView.xaml, SysManager/SysManager/Views/PerformanceView.xaml, SysManager/SysManager/Views/SystemHealthView.xaml
Each view adds a grid row for conditional elevation banners: non-elevated state shows "Run as administrator" button bound to RelaunchAsAdminCommand with explanatory text; elevated state displays confirmation message. Visibility is controlled by IsElevated binding using FlexVis and inverse converters. Content areas are reindexed to accommodate the new banner rows.

Sequence Diagram

sequenceDiagram
  participant App as Application
  participant PerformanceVM as PerformanceViewModel
  participant AdminHelper
  participant View as PerformanceView

  App->>PerformanceVM: InitAsync()
  PerformanceVM->>AdminHelper: IsElevated()
  AdminHelper-->>PerformanceVM: elevation status
  PerformanceVM->>PerformanceVM: _isElevated = status
  PerformanceVM-->>View: notify IsElevated property change
  View->>View: render elevation banner

  rect rgba(100, 200, 255, 0.5)
  User->>View: click "Run as administrator"
  View->>PerformanceVM: RelaunchAsAdminCommand
  PerformanceVM->>AdminHelper: RelaunchAsAdmin()
  AdminHelper-->>PerformanceVM: success
  PerformanceVM->>App: Application.Current.Shutdown()
  end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • laurentiu021/SystemManager#502: Adds the same RelaunchAsAdmin command and elevation banner pattern to DnsHostsViewModel and DnsHostsView, extending admin-relaunch support to another feature area.
  • laurentiu021/SystemManager#468: Modifies the same ViewModel classes (AppBlockerViewModel, NetworkRepairViewModel, PerformanceViewModel) to add sealed keyword declarations, changing the class-level structure where this PR adds new members.

Poem

🐰 With banners bright and buttons clear,
"Run as admin!" calls out here,
Elevation tracked, commands in hand,
System managers across the land,
Now know when they need higher ground!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding uniform elevation banners to five remaining admin-required pages to complete the elevation UI pattern across all 10 pages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/elevation-banners-remaining

Comment @coderabbitai help to get the list of available commands and usage tips.

@laurentiu021 laurentiu021 merged commit 5e3afd3 into main May 22, 2026
5 checks passed
@laurentiu021 laurentiu021 deleted the fix/elevation-banners-remaining branch May 22, 2026 11:29
laurentiu021 added a commit that referenced this pull request May 22, 2026
Apply the same Surface2/green banner pattern (matching WindowsUpdateView,
PrivacyView, WindowsFeaturesView, DnsHostsView, ServicesView) to:
- CleanupView (replaced old orange warning banner)
- SystemHealthView
- PerformanceView
- NetworkRepairView
- AppBlockerView

Each page shows a grey banner with shield icon + reason when not elevated,
and a green confirmation banner when elevated. ViewModels that were missing
IsElevated/RelaunchAsAdminCommand have been updated accordingly.

Co-authored-by: laurentiu021 <laurentiu021@users.noreply.github.com>
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.

1 participant