Skip to content

fix: prevent UI blocking during 333 solver initialization #309

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

bryanlundberg
Copy link
Owner

@bryanlundberg bryanlundberg commented Jun 4, 2024

What does this PR do?
the initialization of the 333 cross & xcross solver was blocking the UI thread. By offloading the initialization process to a web worker, we ensure that the UI remains responsive during this operation.

issue: (interface respond until finish initializing process)

block-thread.mp4

after: (interface keeps responsive while initializing process) [simulate 5 sec delay loading]

8967630d6b1cc0774a5a6260736c1aba.mp4

Changes

  • Implemented a web worker to handle the initialization of the 333 solver.
  • Modified the hook to interact with the web worker and update the initializing state based on the worker's messages.

By submitting this PR, I confirm that:

  • I have reviewed my code and believe it is ready for merging.
  • I understand that this PR may be subject to review and changes.
  • I agree to abide by the code of conduct and contributing guidelines of this project.

@bryanlundberg bryanlundberg merged commit 0811abd into main Jun 4, 2024
@bryanlundberg bryanlundberg deleted the worker-thread branch June 4, 2024 13:35
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.

1 participant