Skip to content

Fix badly aligned tree items#280916

Merged
alexr00 merged 1 commit intomainfrom
alexr00/noble-tapir
Dec 3, 2025
Merged

Fix badly aligned tree items#280916
alexr00 merged 1 commit intomainfrom
alexr00/noble-tapir

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Dec 3, 2025

Fixes #279421

Copilot AI review requested due to automatic review settings December 3, 2025 10:47
@alexr00 alexr00 self-assigned this Dec 3, 2025
@alexr00 alexr00 enabled auto-merge (squash) December 3, 2025 10:47
@vs-code-engineering
Copy link

📬 CODENOTIFY

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

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/views/treeView.ts

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

This PR attempts to fix an alignment issue with tree items (issue #279421) by restricting when the no-twisty CSS class is applied to tree items. The change limits the class to only be managed for root-level items (items whose parent is the Root instance).

  • The fix adds a condition to only add/remove the no-twisty class for direct children of the root node

templateData.container.classList.add('no-twisty');
} else {
templateData.container.classList.remove('no-twisty');
}
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The no-twisty class is not being removed from non-root items when templates are reused. When a template previously used for a root-level leaf node (with no-twisty class) is reused for a non-root item, the class will persist incorrectly.

The fix should ensure the class is removed for non-root items:

if (node.parent instanceof Root) {
	if (node.collapsibleState === TreeItemCollapsibleState.None) {
		templateData.container.classList.add('no-twisty');
	} else {
		templateData.container.classList.remove('no-twisty');
	}
} else {
	templateData.container.classList.remove('no-twisty');
}
Suggested change
}
}
} else {
templateData.container.classList.remove('no-twisty');

Copilot uses AI. Check for mistakes.
@alexr00 alexr00 merged commit f69c21c into main Dec 3, 2025
34 of 35 checks passed
@alexr00 alexr00 deleted the alexr00/noble-tapir branch December 3, 2025 11:08
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overindented treeview item in GitHub Pull Requests view

3 participants