Repository navigation
refactor(tray): extract TrayTooltipBuilder from App.xaml.cs - #376
Merged
shanselman merged 1 commit intoMay 14, 2026
Merged
shanselman merged 1 commit into
shanselman merged 1 commit into
Conversation
BuildTrayTooltip read eight App fields to assemble the tray icon tooltip string. This moves that logic into a dedicated TrayTooltipBuilder, following the same snapshot pattern established by CommandCenterStateBuilder. - Add TrayStateSnapshot (8 fields: status, activity, channels, nodes, node service, auth failure, last check time, settings) - Add TrayTooltipBuilder — receives a snapshot, delegates to TrayTooltipFormatter.FitShellTooltip for the 127-char shell limit - Replace BuildTrayTooltip body in App with a two-line delegation; add CaptureTraySnapshot alongside it No observable behaviour change: tooltip content, truncation, and all three call sites (InitializeTrayIcon ×2, UpdateTrayIcon) are unchanged. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
23 tasks
10 of 16 tasks
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
BuildTrayTooltipinApp.xaml.csread eight fields directly toassemble the tray icon tooltip string. This moves that logic into a
dedicated
TrayTooltipBuilder, following the snapshot patternestablished by
CommandCenterStateBuilderin PR #297.What changed
TrayStateSnapshot— an 8-field record (status, activity,channels, nodes, local node fallback, auth failure message, last check
time, settings) following the same structure as
AppStateSnapshot.NodeServiceis not held in the snapshot;GetLocalNodeInfo()iscalled once at capture time and the result stored as
LocalNodeFallbackTrayTooltipBuilder— receives a snapshot, contains the tooltipassembly logic, delegates to
TrayTooltipFormatter.FitShellTooltipfor the 127-char Windows shell limit
BuildTrayTooltipbody inApp.xaml.cswith a two-linedelegation; add
CaptureTraySnapshotalongside itactivity (no override), warning count conditions, node counting,
local node fallback, channel counting, truncation, and topology display
Testing
dotnet build src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj -r win-x64 --nologodotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --nologo— 15 new tests, all passingcount, node count, warning count, and last check time as before; with
active agent activity the activity text overrides the status line as expected
Notes
No observable behaviour change. The snapshot captures the same fields
that
BuildTrayTooltipwas reading directly, in the same call context(UI thread).
Co-Authored-By: Claude Sonnet 4.6 [email protected]