Skip to content

Bugfix/issue 82 tray menu overflow#83

Open
NichUK wants to merge 4 commits intoopenclaw:masterfrom
NichUK:bugfix/issue-82-tray-menu-overflow
Open

Bugfix/issue 82 tray menu overflow#83
NichUK wants to merge 4 commits intoopenclaw:masterfrom
NichUK:bugfix/issue-82-tray-menu-overflow

Conversation

@NichUK
Copy link

@NichUK NichUK commented Mar 20, 2026

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

Copy link

Copilot AI left a comment

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
Copy link
Author

NichUK commented Mar 21, 2026

Added and tested fixes as suggested by @copilot.

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

2 participants