Skip to content

feat: add WinUI test project with extracted shared helpers - #45

Merged
shanselman merged 1 commit into
masterfrom
feat/winui-test-project
Mar 17, 2026
Merged

shanselman merged 1 commit into
masterfrom
feat/winui-test-project

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Extract testable pure logic from WinUI tray app into shared helpers and create comprehensive test coverage.

New shared helpers (src/OpenClaw.Shared/)

  • MenuDisplayHelper — status icons, channel icons (delegates to ChannelHealth.IsHealthyStatus/IsIntermediateStatus), text truncation, provider formatting, toggle logic
  • DeepLinkParser — pure openclaw:// URI parser with DeepLinkResult record
  • MenuPositioner — tray popup positioning calculations (no Win32 deps)
  • SettingsData — public serializable settings model with ToJson()/FromJson()

New test project (tests/OpenClaw.Tray.Tests/)

93 tests across 4 files:

  • MenuDisplayHelperTests — status icons, channel icons (all statuses + case insensitivity + edge cases), truncation, provider formatting, toggle
  • DeepLinkParserTests — URI parsing, query params, edge cases
  • MenuPositionerTests — positioning for all monitor/cursor scenarios
  • SettingsRoundTripTests — JSON serialization, defaults, backward compat

WinUI refactored to use shared helpers

Updated App.xaml.cs, DeepLinkHandler.cs, TrayMenuWindow.xaml.cs, SettingsManager.cs

Review

Dual-model code review (Opus + Codex) — both found same issue (missing connecting/reconnecting in channel icons). Fixed by delegating to ChannelHealth helpers.

All 568 tests pass (475 shared + 93 tray).

Closes #43

Extract testable pure logic from WinUI tray app into shared helpers:
- MenuDisplayHelper: status icons, text truncation, provider formatting
- DeepLinkParser: URI parsing for openclaw:// deep links
- MenuPositioner: tray popup positioning calculations

Create tests/OpenClaw.Tray.Tests with comprehensive coverage for
all extracted helpers plus settings serialization round-trips.

Closes #43
@github-actions github-actions Bot mentioned this pull request Mar 17, 2026
36 tasks
@shanselman
shanselman merged commit bc140e9 into master Mar 17, 2026
14 checks passed
@shanselman
shanselman deleted the feat/winui-test-project branch March 17, 2026 04:40
shanselman pushed a commit that referenced this pull request Mar 18, 2026
The 93-test Tray test suite (added in PR #45) was never wired up
to the CI workflow — only OpenClaw.Shared.Tests ran. This adds
build + run steps for OpenClaw.Tray.Tests so all 571 tests are
validated on every push and pull request.

Co-authored-by: Copilot <[email protected]>
shanselman added a commit that referenced this pull request Mar 18, 2026
The 93-test Tray test suite (added in PR #45) was never wired into CI. Adds build + run steps for OpenClaw.Tray.Tests so all 571 tests validate on every push/PR.

Closes #58

Co-authored-by: Copilot <[email protected]>
vixco pushed a commit to vixco/openclaw-windows-node that referenced this pull request Aug 16, 2026
The 93-test Tray test suite (added in PR openclaw#45) was never wired up
to the CI workflow — only OpenClaw.Shared.Tests ran. This adds
build + run steps for OpenClaw.Tray.Tests so all 571 tests are
validated on every push and pull request.

Co-authored-by: Copilot <[email protected]>
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.

Add WinUI test project for tray app coverage

1 participant