Skip to content

fix: resolve TypeScript errors in entities-treeview#1847

Merged
willeastcott merged 1 commit intomainfrom
fix/entities-treeview-types
Mar 3, 2026
Merged

fix: resolve TypeScript errors in entities-treeview#1847
willeastcott merged 1 commit intomainfrom
fix/entities-treeview-types

Conversation

@willeastcott
Copy link
Contributor

@willeastcott willeastcott commented Mar 3, 2026

Summary

Fixes all 152 "Property X does not exist on type Y" TypeScript errors in entities-treeview.ts by adding explicit property declarations and proper type annotations.

  • Define EntityTreeViewItem interface (extends TreeViewItem with entity and _containerUsers)
  • Define EntitiesTreeViewArgs interface (extends TreeViewArgs with entities, assets, history, dropManager, writePermissions)
  • Add typed private property declarations for all class members, following the pattern used in AttributesInspector and EntityInspector
  • Replace ad-hoc TreeViewItem & { entity: Observer } intersection types with EntityTreeViewItem
  • Add proper casts for protected member access (_containerContents), EventTargetNode, and editor-api runtime properties (apiAsset, apiEntity)
  • Fix _updateTreeItemEnabledState to use the entity's own enabled state instead of the TreeView element's enabled property when computing childParentDisabled for recursive descent

Test plan

  • Verify npm run type:check passes with zero errors in entities-treeview.ts
  • Verify entity hierarchy panel renders correctly in the editor
  • Verify drag-and-drop reparenting of entities works
  • Verify undo/redo of asset drops into the hierarchy works
  • Verify remote user selection markers appear correctly

@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
editor Ready Ready Preview, Comment Mar 3, 2026 1:41pm

Request Review

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 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 EntityTreeViewItem and EntitiesTreeViewArgs to replace ad-hoc intersection types and to type TreeView constructor arguments.
  • Adds explicit, typed private member declarations for EntitiesTreeView to 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.

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

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.

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

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.

@willeastcott willeastcott force-pushed the fix/entities-treeview-types branch from d814bb3 to 277319e Compare March 3, 2026 13:39
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
@willeastcott willeastcott force-pushed the fix/entities-treeview-types branch from 277319e to c283ec5 Compare March 3, 2026 13:41
@willeastcott willeastcott merged commit 8cd5c32 into main Mar 3, 2026
7 checks passed
@willeastcott willeastcott deleted the fix/entities-treeview-types branch March 3, 2026 13:45
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