Skip to content

Conversation

@mahi656
Copy link

@mahi656 mahi656 commented Nov 10, 2025

Related issue: #31923

Description
The Three.js Editor Outliner already had the logic for collapsible scene hierarchies,
but it was not functioning correctly because new nodes were initialized in a collapsed
state (nodeStates = false). This caused unexpected behavior when interacting with
the sidebar.

This pull request fixes the issue by setting the default state of new nodes to true,
so they appear expanded initially. The collapse/expand logic was already implemented;
this change simply corrects the default state. Users can now manually collapse or expand
scene hierarchy nodes as intended.

@mrdoob
Copy link
Owner

mrdoob commented Nov 10, 2025

This caused unexpected behavior when interacting with
the sidebar.

Can you elaborate?

@mahi656
Copy link
Author

mahi656 commented Nov 10, 2025

Elaboration for #31923:

The Three.js Editor Outliner had a built-in feature to collapse and expand scene hierarchy nodes, but it was not working correctly because new nodes were initialized with nodeStates = false. This meant that when a new object was added to the scene, its hierarchy could appear fully expanded or behave inconsistently when users tried to collapse/expand groups, meshes, or nested children.

The fix changes the default state of new nodes to true. Now, when a new node is added:

  • It appears expanded initially, giving users a clear view of the scene hierarchy.
  • The existing collapse/expand logic continues to work, so users can manually collapse or expand nodes as needed.
  • There is no change to rendering, scene behavior, or other editor functionality — it’s purely a UI fix.

Key points:

  1. Problem: Nodes didn’t behave as expected in the sidebar Outliner.
  2. Cause: Default node state was false (collapsed).
  3. Fix: Set default state to true.
  4. Effect: Nodes now appear expanded initially, but can still be collapsed manually.
  5. Implementation: The feature was already implemented; only the initial value needed correction.
  6. Impact: Improves usability for large or deeply nested scenes, reduces confusion, and keeps the UI consistent.

This explains why only changing the default state solves the problem without adding new functionality — the collapse/expand mechanism was already fully implemented.

@mrdoob
Copy link
Owner

mrdoob commented Nov 10, 2025

  1. Problem: Nodes didn’t behave as expected in the sidebar Outliner.

As expected by whom? 🤔

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.

2 participants