fix: resolve TypeScript errors in entities-treeview#1847
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR addresses TypeScript correctness in the editor’s scene hierarchy tree view (EntitiesTreeView) by adding explicit types/interfaces for tree items and constructor args, and by tightening internal member typing to eliminate “Property does not exist…” errors.
Changes:
- Introduces
EntityTreeViewItemandEntitiesTreeViewArgsto replace ad-hoc intersection types and to type TreeView constructor arguments. - Adds explicit, typed private member declarations for
EntitiesTreeViewto satisfy TS and improve readability. - Adjusts enabled-state propagation logic to derive recursive disabled state from the entity hierarchy (not the TreeView element).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7ee5334 to
04b5ad1
Compare
04b5ad1 to
4cfaa9a
Compare
4cfaa9a to
3626ffb
Compare
3626ffb to
056238e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
056238e to
ec6a3db
Compare
ec6a3db to
fe72255
Compare
fe72255 to
d814bb3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d814bb3 to
277319e
Compare
Add explicit property declarations and type annotations to EntitiesTreeView to fix all 152 "Property X does not exist on type Y" errors. - Define EntityTreeViewItem interface extending TreeViewItem with entity and _containerUsers properties - Define EntitiesTreeViewArgs interface extending TreeViewArgs - Add typed private property declarations for all class members - Replace ad-hoc intersection types with EntityTreeViewItem - Add proper casts for protected member access, EventTarget, and editor-api runtime properties (apiAsset, apiEntity) - Fix _updateTreeItemEnabledState to use entity enabled state instead of the TreeView element's own enabled state for child recursion Made-with: Cursor
277319e to
c283ec5
Compare
Summary
Fixes all 152
"Property X does not exist on type Y"TypeScript errors inentities-treeview.tsby adding explicit property declarations and proper type annotations.EntityTreeViewIteminterface (extendsTreeViewItemwithentityand_containerUsers)EntitiesTreeViewArgsinterface (extendsTreeViewArgswithentities,assets,history,dropManager,writePermissions)privateproperty declarations for all class members, following the pattern used inAttributesInspectorandEntityInspectorTreeViewItem & { entity: Observer }intersection types withEntityTreeViewItem_containerContents),EventTarget→Node, and editor-api runtime properties (apiAsset,apiEntity)_updateTreeItemEnabledStateto use the entity's own enabled state instead of theTreeViewelement'senabledproperty when computingchildParentDisabledfor recursive descentTest plan
npm run type:checkpasses with zero errors inentities-treeview.ts