Skip to content

WIP: keep actions visible when tree has horizontal scroll#294532

Draft
alexr00 wants to merge 1 commit intomainfrom
alexr00/provincial-guineafowl
Draft

WIP: keep actions visible when tree has horizontal scroll#294532
alexr00 wants to merge 1 commit intomainfrom
alexr00/provincial-guineafowl

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Feb 11, 2026

Fixes #251722

Copilot AI review requested due to automatic review settings February 11, 2026 10:28
@alexr00 alexr00 self-assigned this Feb 11, 2026
Copy link
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

Adjusts list rendering + styling so action toolbars in custom view trees remain reachable when the tree content is wider than the viewport (horizontal scrolling), addressing #251722.

Changes:

  • Compute a CSS custom property (--list-scroll-right-offset) in ListView based on current horizontal scroll position.
  • Apply CSS in the views tree to shift the .actions container back into the visible viewport when horizontal scrolling is active.
  • Update the stylelint “known variables” allowlist to include the new CSS variable.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/browser/parts/views/media/views.css Shifts tree row action toolbars into view when horizontal scrolling is enabled.
src/vs/base/browser/ui/list/listView.ts Exposes current “distance to right edge” as a CSS variable on the list DOM node.
build/lib/stylelint/vscode-known-variables.json Adds --list-scroll-right-offset to the allowlist (but also removes another variable).

Comment on lines +264 to +268
.customview-tree .monaco-list.horizontal-scrolling .monaco-list-row.selected .custom-view-tree-node-item .actions {
background-color: var(--vscode-list-activeSelectionBackground);
}

.customview-tree .monaco-list.horizontal-scrolling .monaco-list-row.focused .custom-view-tree-node-item .actions {
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The new .actions background colors don’t account for inactive selection / focused+selected states: .monaco-list-row.selected always forces --vscode-list-activeSelectionBackground, even when the list isn’t focused (should match --vscode-list-inactiveSelectionBackground), and .monaco-list-row.focused will override the selected background when a row is both focused and selected. Consider splitting selectors by list focus (.monaco-list:focus vs :not(:focus)) and making the focused rule exclude .selected (or adding an explicit .focused.selected rule) so the actions area matches the row background in all states.

Suggested change
.customview-tree .monaco-list.horizontal-scrolling .monaco-list-row.selected .custom-view-tree-node-item .actions {
background-color: var(--vscode-list-activeSelectionBackground);
}
.customview-tree .monaco-list.horizontal-scrolling .monaco-list-row.focused .custom-view-tree-node-item .actions {
.customview-tree .monaco-list.horizontal-scrolling:focus .monaco-list-row.selected .custom-view-tree-node-item .actions {
background-color: var(--vscode-list-activeSelectionBackground);
}
.customview-tree .monaco-list.horizontal-scrolling:not(:focus) .monaco-list-row.selected .custom-view-tree-node-item .actions {
background-color: var(--vscode-list-inactiveSelectionBackground);
}
.customview-tree .monaco-list.horizontal-scrolling .monaco-list-row.focused:not(.selected) .custom-view-tree-node-item .actions {

Copilot uses AI. Check for mistakes.
@@ -388,7 +388,6 @@
"--vscode-inlineChat-border",
"--vscode-inlineChat-foreground",
"--vscode-inlineChat-shadow",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

--vscode-inlineChat-regionHighlight was removed from the stylelint known-variable allowlist, but it’s still referenced in src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css. This will make stylelint fail on that CSS file. Please re-add the variable here (or rename/update all remaining usages to a different known variable).

Suggested change
"--vscode-inlineChat-shadow",
"--vscode-inlineChat-shadow",
"--vscode-inlineChat-regionHighlight",

Copilot uses AI. Check for mistakes.
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