Skip to content

feat: expose content getter on TreeViewItem#507

Merged
willeastcott merged 1 commit into
mainfrom
feat/treeview-item-contents-element
Feb 26, 2026
Merged

feat: expose content getter on TreeViewItem#507
willeastcott merged 1 commit into
mainfrom
feat/treeview-item-contents-element

Conversation

@willeastcott

@willeastcott willeastcott commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a public content getter on TreeViewItem that returns the internal _containerContents container

Details

The Editor currently accesses _containerContents via an unsafe type assertion:

(treeItem as TreeViewItem & { _containerContents: Container })._containerContents.dom

The new getter provides clean public access:

treeItem.content.dom

The getter is named content for consistency with Panel.content, which follows the same pattern of exposing an internal content container.

Test plan

  • Full build passes including type generation (npm run build)
  • All existing tests pass (npm test)
  • Lint passes (npm run lint)

@willeastcott willeastcott force-pushed the feat/treeview-item-contents-element branch from 7809865 to c5ecdcf Compare February 26, 2026 14:44
@willeastcott willeastcott changed the title feat: expose contentsElement getter on TreeViewItem feat: expose content getter on TreeViewItem Feb 26, 2026
@willeastcott willeastcott requested a review from Copilot February 26, 2026 14:44
@willeastcott willeastcott self-assigned this Feb 26, 2026
@willeastcott willeastcott added the enhancement New feature or request label Feb 26, 2026
@willeastcott willeastcott merged commit 1b85aa7 into main Feb 26, 2026
8 checks passed
@willeastcott willeastcott deleted the feat/treeview-item-contents-element branch February 26, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a public content getter to the TreeViewItem class to expose the internal _containerContents container. This eliminates the need for unsafe type assertions when accessing this container from external code, particularly the Editor which previously accessed it via (treeItem as TreeViewItem & { _containerContents: Container })._containerContents.dom.

Changes:

  • Added a content getter on TreeViewItem that returns _containerContents with JSDoc documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants