Skip to content

Fix tray menu toggle flicker#545

Merged
shanselman merged 2 commits into
openclaw:masterfrom
kenehong:kenehong/tray-menu-flicker
May 26, 2026
Merged

Fix tray menu toggle flicker#545
shanselman merged 2 commits into
openclaw:masterfrom
kenehong:kenehong/tray-menu-flicker

Conversation

@kenehong
Copy link
Copy Markdown
Contributor

@kenehong kenehong commented May 26, 2026

image

Summary

The tray menu rebuilt fresh WinUI toggles on each open, which exposed the default switch reposition animation as a visible off-to-on flicker. This change keeps the standard WinUI switch visuals while making the tray menu switch state apply instantly.

  • Add a tray-menu-local ToggleSwitch template that preserves the WinUI switch dimensions, radii, and theme resources.
  • Remove the RepositionThemeAnimation path only for tray menu toggles, so the connection and permissions toggles do not flicker when menus open.
  • Route the gateway connection and permissions toggles through a shared helper so state updates stay centralized.
  • Resolve the menu-local style from the TrayMenuWindow instance so the popup can open reliably after scoping the style locally.

XAML review notes

  • Uses existing ToggleSwitch* theme resources for Light/Dark/High Contrast behavior.
  • Scopes the style to TrayMenuWindow to avoid broad app-wide control template changes.
  • Does not alter the public ToggleSwitch shape, brushes, or sizing.

Validation

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore

Add a tray-menu-specific ToggleSwitch style that preserves the WinUI control shape while removing the default switch reposition animation that flickers on menu open. Wire the tray connection and permissions toggles through the shared helper so their state updates remain centralized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 26, 2026

Codex review: needs real behavior proof before merge. Reviewed May 26, 2026, 4:55 PM ET / 20:55 UTC.

Summary
The branch adds a tray-menu-local ToggleSwitch template and helper methods so gateway connection and permission toggles use an instant tray-scoped switch state update.

Reproducibility: no. high-confidence runtime reproduction was established in this read-only review. Source inspection supports the reported path because current main creates fresh tray-menu toggles on menu build, but the visible flicker itself needs a Windows tray UI capture.

Review metrics: 1 noteworthy metric.

  • Custom tray template: 142 XAML lines added. Replacing the standard ToggleSwitch internals in the tray menu makes visual and interaction proof important before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach a short redacted recording showing the tray menu opening with the gateway connection and permissions toggles already in their correct states and no visible flicker.
  • Keep the reported ./build.ps1, shared tests, and tray tests current after any further changes.

Proof guidance:
Needs stronger real behavior proof before merge: The PR body contains a still tray-menu image, but it does not show open-time no-flicker behavior or permissions toggles; add a redacted short recording or live UI proof, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.

Mantis proof suggestion
A short visible Windows tray capture would directly verify the flicker fix and custom ToggleSwitch template in the real UI. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify the Windows tray menu opens with gateway connection and permissions toggles already in their correct states and no visible flicker.

Risk before merge

  • The attached still image does not prove the temporal no-flicker behavior when the tray menu opens, and it does not cover the permissions flyout toggles.
  • The PR adds a 142-line local ToggleSwitch template, so theme, high-contrast, focus, and interaction parity still need real Windows UI proof before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Merge after a short redacted recording of the real Windows tray menu shows connection and permissions toggles opening in the correct state with no visible flicker, with validation kept current.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
Contributor or maintainer action is needed to attach real tray-menu proof; no narrow ClawSweeper code repair is identified.

Security
Cleared: The diff is limited to tray UI XAML/C# and does not touch secrets, auth, dependencies, CI, install scripts, or package resolution.

Review details

Best possible solution:

Merge after a short redacted recording of the real Windows tray menu shows connection and permissions toggles opening in the correct state with no visible flicker, with validation kept current.

Do we have a high-confidence way to reproduce the issue?

No high-confidence runtime reproduction was established in this read-only review. Source inspection supports the reported path because current main creates fresh tray-menu toggles on menu build, but the visible flicker itself needs a Windows tray UI capture.

Is this the best way to solve the issue?

Unclear. The implementation is narrow and tray-scoped, but the submitted proof does not yet confirm that it fixes flicker without template regressions in the real tray UI.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 9de9b5ba0f8a.

Label changes

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body contains a still tray-menu image, but it does not show open-time no-flicker behavior or permissions toggles; add a redacted short recording or live UI proof, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority tray UX bugfix PR with limited blast radius, currently blocked by insufficient real behavior proof.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body contains a still tray-menu image, but it does not show open-time no-flicker behavior or permissions toggles; add a redacted short recording or live UI proof, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body contains a still tray-menu image, but it does not show open-time no-flicker behavior or permissions toggles; add a redacted short recording or live UI proof, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

What I checked:

Likely related people:

  • shanselman: git blame ties the current gateway connection toggle, permissions toggle row, and connection sync code to commit d9e0c20. (role: introduced current tray menu implementation; confidence: high; commits: d9e0c200bed6; files: src/OpenClaw.Tray.WinUI/Services/TrayMenuStateBuilder.cs, src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml.cs, src/OpenClaw.Tray.WinUI/App.xaml.cs)
  • ranjeshj: Recent current-main history includes tray disconnected behavior and tray cleanup commits touching the same App.xaml.cs and TrayMenuStateBuilder.cs surface. (role: recent tray connection contributor; confidence: medium; commits: 6d8541e57008, 59ff8cef337d; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Services/TrayMenuStateBuilder.cs)
  • bkudiess: Commit e9d5454 added an adjacent System tools permission toggle in the tray menu. (role: recent adjacent tray toggle contributor; confidence: medium; commits: e9d545423e38; files: src/OpenClaw.Tray.WinUI/Services/TrayMenuStateBuilder.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels May 26, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 26, 2026

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@kenehong kenehong marked this pull request as draft May 26, 2026 19:55
Use the tray menu window instance to resolve the local ToggleSwitch style after scoping it to TrayMenuWindow resources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. label May 26, 2026
@kenehong kenehong marked this pull request as ready for review May 26, 2026 20:19
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label May 26, 2026
@shanselman shanselman merged commit 4133ae1 into openclaw:master May 26, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants