Skip to content

fix: code quality — GeneratedRegex, naming standardization, dead code removal#593

Merged
laurentiu021 merged 2 commits into
mainfrom
fix/code-quality-uniformity
May 29, 2026
Merged

fix: code quality — GeneratedRegex, naming standardization, dead code removal#593
laurentiu021 merged 2 commits into
mainfrom
fix/code-quality-uniformity

Conversation

@laurentiu021
Copy link
Copy Markdown
Owner

@laurentiu021 laurentiu021 commented May 29, 2026

Summary

  • ContextMenuService: replace 4 runtime Regex.Match/Replace calls with [GeneratedRegex] — compile-time source generation, better perf, AOT-ready
  • Naming standardization: all admin relaunch methods unified to RelaunchAsAdmin (was mixed: RelaunchElevated in 5 VMs, RequestElevation in Dashboard)
  • Naming standardization: filter properties unified to FilterText everywhere (LogsViewModel was SearchText, ServicesViewModel was Filter)
  • ConsoleViewModel: removed dead optimization branch — the clear-and-rebuild path required 1250+ excess lines which never happens (lines append one at a time)
  • Missing toasts: added completion notifications to System Health scan and App Alerts "Show Installed"
  • Updated tests to match renamed properties

Test plan

  • Build: 0 errors on both projects
  • Services tab: filter textbox still works
  • System Logs tab: search textbox still works
  • All tabs with "Run as administrator" button: still triggers UAC correctly
  • Context Menu tab: entries still show friendly names (regex patterns work)
  • System Health: toast shows after scan
  • App Alerts: toast shows after "Show Installed"

Summary by CodeRabbit

Release Notes v1.16.3

  • New Features

    • Added completion toast notifications for System Health scans and App Alerts.
  • Bug Fixes

    • Improved console output line management efficiency.
  • Chores

    • Code quality enhancements and standardized naming across views.
    • Version bumped to 1.16.3.

Review Change Stack

… removal

- ContextMenuService: replace runtime Regex with [GeneratedRegex] (4 patterns)
- Standardize admin relaunch method to RelaunchAsAdmin across all 12 VMs
- Standardize filter property to FilterText (LogsVM, ServicesVM)
- ConsoleViewModel: remove unreachable optimization branch
- Add missing toasts to SystemHealth scan and AppAlerts
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@laurentiu021, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a2cf9db-958a-4c34-8f6c-881169c3d94a

📥 Commits

Reviewing files that changed from the base of the PR and between 474946f and c6ebf0c.

📒 Files selected for processing (1)
  • SysManager/SysManager.Tests/DashboardViewModelTests.cs
📝 Walkthrough

Walkthrough

Version 1.16.3 introduces systematic naming standardization across ViewModels and their XAML bindings, compile-time regex optimization in ContextMenuService, new completion toast notifications, and simplified console trimming logic. The project version metadata is bumped accordingly.

Changes

v1.16.3 Release Updates

Layer / File(s) Summary
Version bump and release notes
SysManager/SysManager/SysManager.csproj, CHANGELOG.md
Project version fields (Version, FileVersion, AssemblyVersion) updated from 1.16.2 to 1.16.3. Release notes document code quality improvements, naming standardization, console optimization, and new toast notifications.
Command naming standardization: RelaunchAsAdmin
SysManager/SysManager/ViewModels/BulkInstallerViewModel.cs, DashboardViewModel.cs, DnsHostsViewModel.cs, PrivacyViewModel.cs, ServicesViewModel.cs, UninstallerViewModel.cs, WindowsFeaturesViewModel.cs, SysManager/SysManager/Views/BulkInstallerView.xaml, DashboardView.xaml, DnsHostsView.xaml, PrivacyView.xaml, ServicesView.xaml, UninstallerView.xaml, WindowsFeaturesView.xaml
All admin relaunch relay-command handlers renamed from RelaunchElevated (or RequestElevation) to RelaunchAsAdmin. XAML view bindings updated from RelaunchElevatedCommand/RequestElevationCommand to RelaunchAsAdminCommand across seven screens.
Property naming standardization: FilterText
SysManager/SysManager/ViewModels/LogsViewModel.cs, ServicesViewModel.cs, SysManager/SysManager.Tests/LogsViewModelExtendedTests.cs, LogsViewModelTests.cs, ServicesViewModelTests.cs, SysManager/SysManager/Views/LogsView.xaml, ServicesView.xaml
LogsViewModel switches from SearchText to FilterText property; ServicesViewModel switches from Filter to FilterText. Callback hooks wired accordingly (OnFilterTextChanged). All filtering tests across three test files updated to use the new property names. View bindings updated to bind FilterText.
ContextMenuService compile-time regex generation
SysManager/SysManager/Services/ContextMenuService.cs
Class made sealed partial to support four [GeneratedRegex]-decorated helper methods. DLL resource parsing in GetFriendlyName and camel-case insertion in SplitCamelCase now use generated regex patterns instead of inline regex construction.
Toast notifications for completion events
SysManager/SysManager/ViewModels/AppAlertsViewModel.cs, SystemHealthViewModel.cs
RefreshInstalledApps displays a toast with installed app count after loading. ScanAsync displays a completion toast with disk and RAM module counts after scanning.
Console output optimization: MaxLines trimming
SysManager/SysManager/ViewModels/ConsoleViewModel.cs
Append method's MaxLines cap enforcement simplified from conditional excess-handling to a continuous while loop that removes oldest entries until within the limit.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Rabbit's Release Rhyme
Version up and names align,
FilterText and RelaunchAsAdmin shine,
Regex patterns compile at build,
Toast notifications user-filled,
Simpler loops, a cleaner line! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% 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 pull request title accurately and concisely summarizes the three main changes: GeneratedRegex optimization, naming standardization across methods and properties, and removal of dead optimization code.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/code-quality-uniformity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@laurentiu021 laurentiu021 merged commit 202e08c into main May 29, 2026
4 of 5 checks passed
@laurentiu021 laurentiu021 deleted the fix/code-quality-uniformity branch May 29, 2026 06:48
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