Skip to content

Right align actions tree view#295266

Open
sam-shubham wants to merge 4 commits intomicrosoft:mainfrom
sam-shubham:right_align_actions_treeView
Open

Right align actions tree view#295266
sam-shubham wants to merge 4 commits intomicrosoft:mainfrom
sam-shubham:right_align_actions_treeView

Conversation

@sam-shubham
Copy link

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

📬 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

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

2 participants