refactor: remove dead recording handler and extract two static helpers from App.xaml.cs#493
Merged
shanselman merged 3 commits intoMay 21, 2026
Conversation
…ation strings NodeService.RecordingStateChanged was never subscribed in App.xaml.cs, so the handler and its six Activity_Recording* resource keys were unreachable at runtime. Removing them and the matching entries from all five locale resw files so localization tests remain green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The three static run-marker methods (CheckPreviousRun, MarkRunStarted, MarkRunEnded) depended only on a file path. Moving them to a dedicated class removes 37 lines from App and gives the behavior a named home. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The --uninstall CLI path (RunCliUninstallAsync, CliRedact, AttachConsole P/Invoke) had no dependency on App instance state. Moving it to a dedicated static class removes ~150 lines from App and gives the headless uninstall entry point a clear, named home. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small cleanups in App.xaml.cs with no behavior change.
OnRecordingStateChangedwas subscribed to aNodeServiceevent that no longer fires — removed the handler and its six localization keys from all five locale files.AppRunMarker(run-marker file logic) andCliUninstallHandler(headless--uninstallCLI entry point) were inline static helpers inside App.xaml.cs; both are now standalone files in the expected namespaces with no interface or dependency changes.What changed
OnRecordingStateChangedand its six localization keys removed from all locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw)AppRunMarkerextracted toServices/AppRunMarker.csCliUninstallHandlerextracted toCliUninstallHandler.csTesting
All 1212 tests pass, including
LocalizationValidationTests.Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com