Skip to content

fix: remove left offset on right-aligned hover to prevent border clipping#305052

Open
jaydeep-pipaliya wants to merge 1 commit intomicrosoft:mainfrom
jaydeep-pipaliya:fix/hover-right-border-clipping
Open

fix: remove left offset on right-aligned hover to prevent border clipping#305052
jaydeep-pipaliya wants to merge 1 commit intomicrosoft:mainfrom
jaydeep-pipaliya:fix/hover-right-border-clipping

Conversation

@jaydeep-pipaliya
Copy link

Summary

Fixes the right border being clipped on right-aligned hover widgets when the window is narrow.

Root cause: The .monaco-hover.workbench-hover.right-aligned CSS rule had a left: 1px hack that shifted the hover 1px to the right. When the hover was already positioned at the right edge of the viewport (via computeXCordinate with HoverWindowEdgeMargin), this extra 1px offset pushed the right border outside the visible area.

Fix: Removed the left: 1px CSS offset. The JS positioning logic in computeXCordinate already handles edge margins correctly via Constants.HoverWindowEdgeMargin, making the CSS offset unnecessary.

Fixes #127438

Test plan

  • Open VS Code with a narrow window
  • Hover over a status bar item that has a long tooltip2 (markdown tooltip)
  • Verify the right border of the hover is fully visible
  • Resize the window to various widths and confirm the border remains intact
  • Verify right-aligned hovers still position correctly without wrapping issues

@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 26, 2026
…ping

The right-aligned hover had a CSS `left: 1px` hack that shifted the
hover widget 1px to the right, causing the right border to be clipped
when the window is narrow. The JS positioning logic already accounts
for edge margins via HoverWindowEdgeMargin, making this offset
unnecessary.

Fixes microsoft#127438
@jaydeep-pipaliya jaydeep-pipaliya force-pushed the fix/hover-right-border-clipping branch from 4b514e7 to 11ab120 Compare March 26, 2026 07:06
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.

StatusBarItem.tooltip2 right border doesn't show when window is narrow

2 participants