Skip to content

refactor: remove dead recording handler and extract two static helpers from App.xaml.cs#493

Merged
shanselman merged 3 commits into
openclaw:masterfrom
AlexAlves87:refactor/app-dead-code-cleanup
May 21, 2026
Merged

refactor: remove dead recording handler and extract two static helpers from App.xaml.cs#493
shanselman merged 3 commits into
openclaw:masterfrom
AlexAlves87:refactor/app-dead-code-cleanup

Conversation

@AlexAlves87
Copy link
Copy Markdown
Contributor

Summary

Three small cleanups in App.xaml.cs with no behavior change.

OnRecordingStateChanged was subscribed to a NodeService event that no longer fires — removed the handler and its six localization keys from all five locale files.

AppRunMarker (run-marker file logic) and CliUninstallHandler (headless --uninstall CLI 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

  • OnRecordingStateChanged and its six localization keys removed from all locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw)
  • AppRunMarker extracted to Services/AppRunMarker.cs
  • CliUninstallHandler extracted to CliUninstallHandler.cs

Testing

dotnet build src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj -r win-x64
dotnet test

All 1212 tests pass, including LocalizationValidationTests.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

AlexAlves87 and others added 3 commits May 21, 2026 08:47
…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>
@shanselman shanselman merged commit 190a53f into openclaw:master May 21, 2026
18 checks passed
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