Skip to content

Don't expose public mutable properties from actionbar#311501

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/plain-llama
Apr 20, 2026
Merged

Don't expose public mutable properties from actionbar#311501
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/plain-llama

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented Apr 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 21:38
@mjbvz mjbvz enabled auto-merge April 20, 2026 21:38
Copy link
Copy Markdown
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 aims to prevent external mutation of ActionBar internals by making viewItems non-mutable from the outside and tightening element property mutability.

Changes:

  • Replace public viewItems array with a private backing field and a (readonly) accessor.
  • Make domNode readonly to prevent reassignment after construction.
  • Simplify getWidth/getHeight implementations with optional chaining/nullish coalescing.
Show a summary per file
File Description
src/vs/base/browser/ui/actionbar/actionbar.ts Encapsulates viewItems, makes domNode readonly, and simplifies dimension getters.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/vs/base/browser/ui/actionbar/actionbar.ts Outdated
@mjbvz mjbvz force-pushed the dev/mjbvz/plain-llama branch from a02b1ee to bef799f Compare April 20, 2026 21:42
}

getHeight(index: number): number {
if (index >= 0 && index < this.actionsList.children.length) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Whoops wasn't directly part of this change but should be ok to include too

@mjbvz mjbvz merged commit 4920ebc into microsoft:main Apr 20, 2026
26 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 20, 2026
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.

3 participants