Skip to content

Bugfix/issue 82 tray menu overflow - #83

Merged
shanselman merged 4 commits into
openclaw:masterfrom
NichUK:bugfix/issue-82-tray-menu-overflow
Apr 1, 2026
Merged

shanselman merged 4 commits into
openclaw:masterfrom
NichUK:bugfix/issue-82-tray-menu-overflow

Conversation

@NichUK

@NichUK NichUK commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #82

Summary
The tray menu could grow taller than the visible screen area when there were many sections and items. In that state, items at the bottom of the menu could fall off-screen, including Exit, making the menu impossible to fully use.

Root Cause
The menu window was being sized to the full content height without correctly constraining it to the current monitor work area. On high-DPI displays, the sizing logic also mixed physical pixels and view-scaled units, so the popup could still exceed the usable visible height even after an initial clamp. The ScrollViewer existed, but it never got the correct bounded viewport needed to make overflow scrollable and reachable.

Fix
Constrain the tray menu height to the current monitor work area before sizing the popup window.
Convert monitor work-area height from physical pixels to view units using the current window DPI so the clamp is correct on scaled displays.
Make the tray menu ScrollViewer use an explicitly visible vertical scrollbar so overflow is discoverable and usable.

Tests
Added regression coverage for the sizing behavior:

  • menu height is clamped to the available work area
  • pixel-to-view-unit conversion is correct for high-DPI scenarios
  • positioning with a clamped oversized menu remains within the visible work area
  • tray menu markup requires a visible vertical scrollbar
    Verified against a working gateway with a lot of menu items! :)

Written with the help of Codex, checked and tested by Nich

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes tray menu usability when many items make the popup taller than the visible monitor work area (Issue #82), especially on high-DPI displays, by constraining height correctly and making overflow discoverable via a visible scrollbar.

Changes:

  • Clamp tray menu popup height to the current monitor work area, with pixel-to-view-unit DPI conversion.
  • Update tray menu XAML to force a visible vertical scrollbar and disable horizontal scrollbar.
  • Add regression tests for sizing/clamping logic and for the XAML scrollbar requirement.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/OpenClaw.Tray.Tests/TrayMenuWindowMarkupTests.cs Adds a markup regression test ensuring the tray menu ScrollViewer shows a visible vertical scrollbar.
tests/OpenClaw.Tray.Tests/MenuPositionerTests.cs Adds tests for menu height clamping and pixel-to-view-unit conversion behavior.
src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml.cs Updates sizing logic to clamp height to monitor work area using new helper methods.
src/OpenClaw.Tray.WinUI/Windows/TrayMenuWindow.xaml Forces visible vertical scrollbar for discoverable overflow behavior.
src/OpenClaw.Shared/MenuSizingHelper.cs Introduces shared helper methods for DPI conversion and height clamping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NichUK

NichUK commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

Added and tested fixes as suggested by @copilot.

@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
12 tasks
@shanselman
shanselman merged commit b511e50 into openclaw:master Apr 1, 2026
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.

Overheight menu doesn't scroll vertically

3 participants