Skip to content

Cache Factory Scenario results and show solve progress #156

Description

@ApocDev

Problem

Factory Scenario recalculates whenever the route mounts and on every target keystroke. Existing results remain visible during background work, but the page gives no indication that a multi-pass solve is running. On a non-trivial project this leaves the user waiting several seconds without feedback.

Proposed behavior

  • Cache the latest successful Scenario result against a deterministic factory-input fingerprint.
  • Reuse a current cached result when revisiting Scenario.
  • Keep a stale result visible and clearly mark it out of date after relevant factory inputs change.
  • Treat edited targets as a draft and recalculate explicitly rather than solving per keystroke.
  • Show live, honest solve phases including response preparation, factory LP solve, validation pass, and re-linearization.
  • Keep apply-time validation and expose its progress too.

Acceptance criteria

  • Revisiting Scenario with unchanged factory inputs does not run another full solve.
  • Changing a target does not solve until the user selects Recalculate.
  • Relevant block, pin, or global solver-context changes invalidate the cached result.
  • The page distinguishes cached/current, stale, calculating, complete, and failed states.
  • Main Scenario and cache invalidation flows have browser coverage and documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: plannerProduction block / planning modelarea: webWeb UI (React/TanStack/vite-plus)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions