Open
Conversation
11 tasks
There was a problem hiding this comment.
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.
Author
|
Added and tested fixes as suggested by @copilot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Verified against a working gateway with a lot of menu items! :)
Written with the help of Codex, checked and tested by Nich