Skip to content

feat: Reset button resets lava simulation [GEOCODE-50] #385

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 2 commits into from
Jun 2, 2025

Conversation

kswenson
Copy link
Member

@kswenson kswenson commented May 31, 2025

@kswenson kswenson requested a review from Copilot May 31, 2025 22:02
Copy link
Contributor

@Copilot 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 implements a reset functionality for the lava simulation to ensure that simulation parameters and the camera view are properly reinitialized.

  • Added a reset method in the lava simulation store that resets simulation parameters and increments a reset counter.
  • Integrated a MobX reaction in the camera controls to update the camera view upon simulation reset.
  • Updated the blockly controller to call the new reset method for lava simulation.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/stores/lava-simulation-store.ts Added reset logic for simulation parameters and a reset counter
src/components/lava-coder/use-camera-controls.ts Added a MobX reaction to update the camera when the simulation resets
src/blockly/blockly-controller.ts Included the lava simulation reset in the simulation update chain
Comments suppressed due to low confidence (1)

src/stores/lava-simulation-store.ts:107

  • Ensure that the variable 'lavaElevations' is correctly scoped or declared to avoid accidental usage of a global variable.
lavaElevations = [];

chore: code review tweak from Copilot.

Co-authored-by: Copilot <[email protected]>
@kswenson kswenson marked this pull request as ready for review May 31, 2025 22:11
@kswenson kswenson requested a review from tealefristoe May 31, 2025 22:11
@kswenson kswenson changed the title feat: Reset button resets lava simulation feat: Reset button resets lava simulation [GEOCODE-50] May 31, 2025
Copy link
Contributor

@tealefristoe tealefristoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Base automatically changed from GEOCODE-ui-improvements to master June 2, 2025 00:40
@kswenson kswenson merged commit 6f20ffd into master Jun 2, 2025
5 checks passed
@kswenson kswenson deleted the GEOCODE-50-reset-button branch June 2, 2025 00:41
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