Skip to content

Fix: reserve dropdown popup scrollbar width to avoid suffix text crop…#253

Open
aniketsahu07 wants to merge 2 commits into
microsoft:mainfrom
aniketsahu07:fix/dropdown-popup-scrollbar-padding
Open

Fix: reserve dropdown popup scrollbar width to avoid suffix text crop…#253
aniketsahu07 wants to merge 2 commits into
microsoft:mainfrom
aniketsahu07:fix/dropdown-popup-scrollbar-padding

Conversation

@aniketsahu07
Copy link
Copy Markdown

@aniketsahu07 aniketsahu07 commented May 23, 2026

On some Linux (GTK) setups the dropdown popup's suffix text gets cropped when a vertical scrollbar appears. This change ensures the popup reserves the scrollbar width when sizing the content.

What I changed

In com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java:

  • Compute the scrolled content size and add the vertical scrollbar width to contentSize.x before setting the container size and min size.

How to test

  • In a GTK Linux environment, open the model dropdown that previously showed cropped suffix text.
  • Confirm the suffix is fully visible when the popup shows a vertical scrollbar.

Notes

  • Small, low-risk UI fix; no public API changes.

Closes #113

Copilot AI review requested due to automatic review settings May 23, 2026 13:28
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@aniketsahu07 aniketsahu07 requested a review from Copilot May 23, 2026 17:03
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +159 to +164
int scrollBarWidth = 0;
if (scrolledComposite.getVerticalBar() != null) {
scrollBarWidth = scrolledComposite.getVerticalBar().getSize().x;
}
// Reserve space for the vertical scrollbar to avoid cropping suffix text on GTK/Linux
contentSize.x += scrollBarWidth;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks — good catch. I removed the scrollbar-width reservation from the initial sizing in open() and now only reserve the scrollbar width inside constrainHeightIfNeeded() when the popup becomes scrollable. This avoids double-reserving the width and prevents the dropdown from becoming wider than necessary. PTAL.

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.

Detailed model information on dropdown hover is cropped on Linux

2 participants