Skip to content

Issue: Workspace Scaling Regression and Result-Project Coupling #48

@chraibi

Description

@chraibi

Description

When exiting the Simulation Visualization mode, the workspace geometry does not return to its original state; specifically, the geometry appears significantly smaller than the original design. Furthermore, because simulation results (SQLite) do not contain the original project definitions (JSON), the app loses the "source of truth" when viewing results in isolation.

Current Behavior

  1. User enters "View Simulation" mode.
  2. Upon closing the visualization, the original workspace geometry is rendered at an incorrect, reduced scale.
  3. The simulation result package lacks the project configuration, making it impossible to reconstruct the full context without the original JSON.

Proposed Solutions & Requirements

1. UI State Cleanup (The "Clean Slate" Approach)

  • Upon deactivating "View Simulation" mode, the application must perform a full teardown of the visualization layers.
  • Requirement: Ensure all temporary scaling matrices or viewport transformations used by the visualizer are cleared.

2. Persistent Scale Normalization

  • If the geometry is kept in memory, it must maintain a consistent 1:1 scale with the project coordinates.
  • Requirement: Verify if the visualizer is modifying the global Transform of the geometry objects rather than just the camera/overlay layer.

3. Project-Result Coupling (The "Simulation Package")

  • To ensure the geometry and settings are always available, we should treat the simulation result as a self-contained bundle.
  • Requirement: Modify the export logic so that the .json project file is automatically included inside the simulation results ZIP file.
  • Requirement: When loading an SQLite result, the app should look for the bundled JSON to restore the correct geometry, scale, and environment settings.

Technical Tasks

  • Reset Hook: Add a onExitVisualization callback to reset the workspace zoom and scale factors.
  • ZIP Packer Update: Update the backend/client-side zipping function to include project_config.json.
  • Loader Logic: Update the results loader to parse the bundled JSON first to set the scene bounds before overlaying the SQLite data.

Acceptance Criteria

  1. Closing the visualization returns the user to the editor with the geometry at its original 1:1 scale.
  2. Every simulation ZIP file contains both the SQLite results and the source JSON.
  3. Loading a results ZIP in a fresh session correctly reconstructs the project environment.
  4. Loading a standalone sqlite file should be supported too. Users might just want to visualise some old results not necessarily produced with the app but with jupedsim

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions