Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor refactor #9138

Merged
merged 4 commits into from Oct 25, 2023
Merged

Editor refactor #9138

merged 4 commits into from Oct 25, 2023

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Oct 25, 2023

Summary

馃 Generated by Copilot at e636880

Refactored the editor components and hooks to use a new DialogState module for managing dialogs. This module uses hyperflux to define a global state for dialogs and simplifies the code and performance of the dialog-related logic. Removed the unused useDialog hook and DialogContext.

References

closes #insert number here

Explanation

馃 Generated by Copilot at e636880

  • Refactored the dialog management to use a global state instead of a context (link, link, link, link, link, link, link, link, link, link, link, link)
  • Imported the DialogState module from packages/editor/src/components/dialogs/DialogState.ts instead of the useDialog hook (link, link)
  • Removed the DialogComponent and setDialogComponent variables and replaced them with the DialogState.setDialog function (link, link, link, link, link, link, link, link)
  • Removed the DialogContext and the useDialog hook from DialogState.ts and defined a global state for dialogs using the hyperflux library (link)
  • Updated the dependency for fetching scenes to use the editorState.sceneName instead of the toggleRefetchScenes prop (link, link)
    • Removed the toggleRefetchScenes prop from the ScenesPanel component in packages/editor/src/components/assets/ScenesPanel.tsx (link)
    • Replaced the toggleRefetchScenes dependency with the editorState.sceneName dependency for the useEffect hook that fetches scenes in ScenesPanel.tsx (link)

馃 Generated by Copilot at e636880

The useDialog hook was a pain
So we replaced it with DialogState
Now the dialogs are neat
And the scenes are complete
With the hyperflux library to maintain

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 marked this pull request as ready for review October 25, 2023 00:12
@HexaField HexaField merged commit 8b4d14a into dev Oct 25, 2023
12 of 13 checks passed
@HexaField HexaField deleted the editor-refactor branch October 25, 2023 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant