Skip to content

diagram: charts keep showing the old run after the model stops simulating #813

Open

Description

@bpowers

When an edit makes the model fail to simulate, the editor keeps showing the last successful run's curves in sparklines and the details chart as if they were current.
The status indicator turns to error, but the curves give no sign they are out of date, so a modeler can read results from a model that no longer exists.
Curves should either disappear or be clearly marked stale until the model simulates again.

Example

Simulate any model, then change a flow's equation to reference an undefined variable.
Click a stock that still has a valid equation: its chart shows the pre-edit run.

Fix

ProjectController.data is set only after a successful run and never cleared.
runSim returns early when isSimulatable() is false, or when both the normal run and the retry without LTM fail, leaving the old series attached to the new project.
Recommended: clear the series (and seriesByIdent) on those early returns; this is a few lines.
Alternative: keep the last good series but carry a stale flag in the snapshot and dim the charts; nicer, but touches every chart consumer.

Pointers

  • src/diagram/project-controller.ts (runSim, data, seriesByIdent, render attaches series via projectAttachSeries)

Activity

  1. changed the title [-]diagram: stale pre-edit sim curves shown (no staleness indicator) after an edit makes the model non-simulatable[/-] [+]diagram: charts keep showing the old run after the model stops simulating[/+] on Oct 12, 2026
  2. added
    frontend
    bug
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions