Skip to content

[codex] Fix web jump image updates#4

Draft
mickaelbegon wants to merge 1 commit into
s2mLab:mainfrom
mickaelbegon:codex/slider-numeric-input
Draft

[codex] Fix web jump image updates#4
mickaelbegon wants to merge 1 commit into
s2mLab:mainfrom
mickaelbegon:codex/slider-numeric-input

Conversation

@mickaelbegon

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the web behavior where selecting a different jump updated the numeric values but did not reliably update the displayed jump image.

Root Cause

Changing the selected jump calls Biomechanics.setValues(...) to reset the model. One field, _finalInertia, was declared as late final, so the second assignment raised a LateInitializationError. In the web app this interrupted the jump-change flow and left the UI in a partially updated state.

The image widget also had no asset-specific identity, so the background image replacement relied on Flutter reusing and updating the existing widget correctly.

Changes

  • Make finalInertia mutable like the other editable biomechanics values, allowing jump changes to reset the full model.
  • Key the background image widget and Image.asset with the selected asset path so the visible image follows the selected jump.
  • Skip the landscape orientation lock on web to avoid web startup/orientation instability.
  • Update web/index.html to use the current Flutter web bootstrap script.
  • Add unit/widget tests for repeated biomechanics resets and background image asset changes.

Validation

  • flutter test passed: 14 tests
  • flutter analyze passed with no issues
  • flutter build web --release succeeded
  • Manual browser check on http://localhost:60205/#/jump-screen: Axel, Lutz, and Somersault all switch images and values without new console errors

Note: test the web app through an HTTP server URL, not by opening web/index.html directly with file://, because Flutter web assets/bootstrap are served differently.

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