Skip to content

Live shot view: back-fill graph from continuously-recorded telemetry (no data loss on late/again navigation) #582

Description

@hessius

Summary

The live shot view only graphs telemetry that arrives while the view is mounted. Today the graph history is accumulated inside LiveShotView itself (chartDataRef for the shot; useHeatingSamples for heating temps), and only while brewing/heating is active. As a result:

  • If a shot (or heating) is already in progress and the user opens the live view late (e.g. when heating is almost done), all earlier data is missing from the graph.
  • Navigating out of and back into the live view discards the accumulated graph and restarts it empty.

Telemetry itself is already streamed continuously at the app level (useMachineTelemetry -> machineState, always mounted). We should record it into a persistent, app-lifetime buffer so the graph can be back-filled whenever the user opens the live view, and so it survives in/out navigation.

Expected behavior

  • Opening the live view at any point during heating or a shot shows the graph populated from the start of the current cycle.
  • Navigating in and out of the live view during any state does not lose graphed data.
  • The same "don't lose data on navigation" property applies to the manual Pour-Over view (its running timer + weight-trend graph).

Scope / decisions

  • Reset boundary: recorded history is cleared when the machine returns to idle/off (a finished shot is not retained for later viewing once idle).
  • Persistence: in-memory only. History is kept while the app is running; a full app restart starts fresh.
  • Runtime parity: purely client-side (both proxy and direct/Capacitor runtimes feed the same machineState), so the recorder lives in shared web code and works for both.

Affected areas

  • apps/web/src/components/LiveShotView.tsx (+ LiveShotView/useHeatingSamples.ts)
  • apps/web/src/components/PourOverView.tsx
  • apps/web/src/App.tsx (mount the persistent recorder)

Target: 3.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions