Skip to content

Streamline WinUI tray menu parity with WinForms - #11

Closed
shanselman with Copilot wants to merge 6 commits into
masterfrom
copilot/review-winui-code-structure
Closed

Streamline WinUI tray menu parity with WinForms#11
shanselman with Copilot wants to merge 6 commits into
masterfrom
copilot/review-winui-code-structure

Conversation

Copilot AI commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

The WinUI tray implementation needed a careful correctness pass to reduce generated noise, maintain parity with WinForms behavior, and keep the UI lean for packaging while preserving functionality targets.

  • Session routing parity: Align tray session targets with WinForms by routing non-absolute session routes through the dashboard prefix.
  • Menu actions correctness: Wire cron/service health actions consistently and prevent empty-action buttons from being active.
  • Simplification: Remove unused flyout logic and keep menu text (e.g., auto-start) consistent with expected states.

Example (session routing pattern):

var target = sessionRoute.StartsWith("http", StringComparison.OrdinalIgnoreCase)
    ? sessionRoute
    : $"{DashboardBaseUrl}/{sessionRoute}";
OpenUri(target);
Original prompt

Go through the winUI teay with a fine tooth comb. Much of this code was generated and we want to look for correctness of patterns, order of operations, remembering that our goal is a clean and simple architecture with the least number of lines of code necessary to do the job. We wanted to have parody with the winforms version, we want to look nice, we want to be easily packaged in the smallest possible, and eventually we want to get it to the level where it has similar functionality to the Mac version


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits February 1, 2026 21:22
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor WinUI code for clarity and simplicity Streamline WinUI tray menu parity with WinForms Feb 1, 2026
Copilot AI requested a review from shanselman February 1, 2026 21:28
@shanselman shanselman closed this Feb 2, 2026
@shanselman
shanselman deleted the copilot/review-winui-code-structure branch February 8, 2026 02:22
RBrid added a commit to RBrid/openclaw-windows-node that referenced this pull request May 22, 2026
Fixes from dual-model code review on user/regisb/WSLInstall1 branch.

openclaw#1 + openclaw#2 + openclaw#6: SuppressNodeAutoApprove (process-global bool, racy, idempotency-fragile) replaced with IDisposable AcquireNodeAutoApproveSuppression() using volatile int + Interlocked counter. Token Dispose is idempotent via Interlocked.Exchange. Local-loopback URL gate scopes suppression to ws://localhost / ws://127.* so manual operator connects to remote gateways still surface their pending-approval toast.

openclaw#3: ElevatedWslPlatformInstaller.RunDefaultAsync now wraps WaitForExitAsync in try/catch(OperationCanceledException), attempts best-effort Kill(entireProcessTree:true) on the launcher (will fail for the elevated child — documented), then rethrows so the engine surfaces Cancelled cleanly.

openclaw#4: ConfigureWslInstance failure remap to wsl_firstboot_config_failed_after_install is now gated on a stderr-signature check (LooksLikePostInstallKernelIssue: WslRegisterDistribution, Hyper-V, 0x80370102, kernel, vmcompute, LxssManager, instance-is-corrupted, etc). Unrelated configure failures (apt repo issues, script bugs) keep their original error code so users don't get a misleading 'reboot to fix' suggestion.

openclaw#5 + openclaw#15: New tests — Engine_SelfHeal_ResetsCancelledStatus, Engine_ConfigureFails_AfterJustInstalled_DoesNotRemapUnrelatedFailure, LooksLikePostInstallKernelIssue_MatchesKnownKernelSignatures, PairAsync_AwaitsConfiguredDelay, PairAsync_CancellationDuringDelay_Propagates.

openclaw#7: OnboardingV2Bridge now treats LocalGatewaySetupStatus.RequiresAdmin like other terminal/blocking statuses — surfaces error message via LocalizeFailureMessage and suppresses the running-phase info card.

openclaw#8: WslPlatformInstall DefaultPostInstallProbeAttempts comment rewritten to reflect real worst case (~33s, but typically 1–2 probes) rather than the misleading '6 × 500ms = 3s'.

openclaw#9: Extracted WslInstallCycleIssueCodes static class with const issue codes + IReadOnlySet<string> All. Replaced 5 duplicated string literals (top-level self-heal RemoveAll + 4 EnsureWslEnabled outcome branches) with the constants.

openclaw#10: CreateLocalOnly factory now reads OPENCLAW_PAIR_RETRY_DELAY_MS env var at wire-up and passes it as SettingsWindowsTrayNodeProvisioner pairRetryDelay so operators can tune the retry without rebuilding.

openclaw#11: LocalizeFailureMessage now exposes an isGenericFallback signal; MaybeAppendSetupDiagnosticsHint skips the 'Setup diagnostics: …' wrap when we returned the V2_Progress_GenericFailure placeholder (the generic message already directs to logs).

openclaw#13: SetupExistingGatewayClassifier.ClassifyAsync accepts an optional IOpenClawLogger so WSL probe failures surface in the diagnostic stream instead of being silently swallowed by NullLogger.

openclaw#14: ComputeInfoMessage phase predicate tightened to (status==Running && phase<=EnsureWslEnabled) so the 'Check system' hint stops once the engine moves past EnsureWslEnabled, including transient non-Running states between phases.

openclaw#16: Preflight port-probe (host-side TCP check) now runs unconditionally rather than being gated on WSL platform.State==Installed, so users find out about host-side port conflicts before spending 30+ seconds on WSL install.

Validation: build.ps1 green; Shared 1891/29 skipped, Tray 1217 (+5), Connection 229 all pass; ARM64 publish succeeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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