Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

refactor studio selection state #9137

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Oct 24, 2023

Summary

🤖 Generated by Copilot at ad11465

This pull request improves the performance and code quality of the editor by optimizing the rendering of the hierarchy and properties panels, refactoring the selection state and control functions, and simplifying the editor history and material library modules. It also updates the code to use the new hyperflux state management system and the useComponent hook.

References

closes #insert number here

Explanation

🤖 Generated by Copilot at ad11465

  • Simplified the logic of updating the hierarchy panel when the scene graph or object names change by removing the onObjectChanged callback and the useEffect hooks that depend on the sceneGraphChangeCounter and the objectChangeCounter (link, link, link)
  • Simplified the logic of updating the selection state by using the new hyperflux state management system and the updateSelection method of the SelectionState instead of the old action and reducer system and the dispatchAction calls (link, link, link, link, link)
  • Simplified the logic of updating the properties panel when an entity or a material changes by removing the forceUpdate action and the useEffect hooks that depend on the objectChangeCounter (link, link, link)
  • Improved the performance and readability of the selection state by exposing a reactor component that handles the addition and removal of the SelectTagComponent to the selected entities (link)
  • Improved the detection of selection changes in the EditorControlSystem by comparing the previous and current selected entities arrays instead of the selectionCounter (link, link, link, link)
  • Cleaned up the code by removing unused or unnecessary imports, hooks, and variables (link, link, link, link, link, link, link)

🤖 Generated by Copilot at ad11465

We are the hyperflux, we mutate the state
We don't need actions or reducers, we are the fate
We optimize the rendering, we avoid the re-render
We are the hyperflux, we are the code bender

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@HexaField HexaField requested a review from speigg October 24, 2023 23:29
@HexaField HexaField merged commit 4a2a35e into dev Oct 24, 2023
13 of 14 checks passed
@HexaField HexaField deleted the refactor-studio-selection-state branch October 24, 2023 23:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant