Skip to content

Right align actions tree view#295266

Merged
alexr00 merged 9 commits intomicrosoft:mainfrom
sam-shubham:right_align_actions_treeView
Feb 17, 2026
Merged

Right align actions tree view#295266
alexr00 merged 9 commits intomicrosoft:mainfrom
sam-shubham:right_align_actions_treeView

Conversation

@sam-shubham
Copy link
Contributor

Fixes #251722

TreeView: Keep actions aligned during horizontal scrolling

On top of the initial offset computation introduced by @alexr00, this PR completes and stabilizes the right-aligned action behavior for TreeViews with horizontal scrolling.

Changes

  • Keep actions aligned to the viewport’s right edge during horizontal scroll.
  • Prevent applying the offset to nodes that do not contain action items
    (.monaco-list-row:has(.actions .action-item)).
  • Ensure correct alignment without requiring an initial scroll.
  • Preserve hover / selected / focused background consistency.
  • Reset --list-scroll-right-offset when horizontal scrolling is disabled.
  • Register --list-scroll-right-offset in vscode-known-variables.json.

Result

  • Action buttons remain visually fixed while content scrolls.
  • Nodes without actions are unaffected.
  • No initial scroll required for correct alignment.
  • Fully theme-aware and scoped to horizontal-scrolling TreeViews only.

Preview

Screen.Recording.2026-02-14.at.3.56.39.AM.mov

alexr00 and others added 4 commits February 13, 2026 23:53
Offset actions using --list-scroll-right-offset so they remain
aligned to the viewport edge. Apply only to rows containing
action items and adjust spacing for correct visual alignment.
@vs-code-engineering
Copy link

vs-code-engineering bot commented Feb 13, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@joaomoreno

Matched files:

  • src/vs/base/browser/ui/list/listView.ts

@benibenj

Matched files:

  • src/vs/base/browser/ui/list/listView.ts

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/views/media/views.css

@alexr00
Copy link
Member

alexr00 commented Feb 16, 2026

Thanks for continuing to work on this!

It looks like the actions are leaving some extra space after them:

image

Maybe for the file decoration?

image

I think if the file decoration isn't showing, then we shouldn't leave the space.

@sam-shubham
Copy link
Contributor Author

Thanks for continuing to work on this!

It looks like the actions are leaving some extra space after them:

image

Maybe for the file decoration?

image

I think if the file decoration isn't showing, then we shouldn't leave the space.

Thanks for review will fix this asap and will ping you👍

@sam-shubham
Copy link
Contributor Author

Hii @alexr00 , fixed it in the last commit — just added a CSS check for actions on nodes that have file decorations.

Before

Screen.Recording.2026-02-17.at.6.48.39.AM.mov

After

Screen.Recording.2026-02-17.at.6.50.14.AM.mov

Note

Didn’t add any new decoration to npmScripts — just used it to replicate the behavior for testing.

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

Thank you for helping out with this!

@alexr00 alexr00 enabled auto-merge (squash) February 17, 2026 15:40
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
@alexr00 alexr00 merged commit a102af4 into microsoft:main Feb 17, 2026
17 of 18 checks passed
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.

Proposal: Keep NPM Scripts buttons within viewport

3 participants