Constellation timeline integration and optimization #67
Conversation
The Constellation page only ever read the latest live frame, so importing a .pecan file (or pausing the live timeline) had no effect on the canvas. Drop a TimelineBar onto the page and feed the canvas from the timeline cursor when a replay is mounted or the timeline is paused, so historical sessions light up the same star map and correlations. - Constellation page mounts TimelineBar and consumes useTimeline(). - When pinned (replay or paused), value/history refs are rebuilt from getAllLatestAt/getHistoryAt at the cursor; live+live keeps the rolling subscription path. - Canvas accepts cursorTimeMs/source/mode and uses getLatestAt for the per-star isLive check so dim stars match the cursor moment. - useConstellationSignals takes a refresh key so an embedded DBC from a .pecan import re-enumerates the sensor catalogue.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c16b63365e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `/api/query?season=${encodeURIComponent(selectedSeason)}`, | ||
| { | ||
| method: 'POST', | ||
| body: JSON.stringify({ signal: sig, start, end, limit: noLimit ? null : 5000, no_limit: noLimit }), |
There was a problem hiding this comment.
Normalize constellation IDs before querying exports
The export loop sends each signalIds entry directly as signal, but these IDs are constellation node IDs (msgID:signalName) rather than raw Timescale column names. In this form the backend will query columns like "0x0C0:Accel_X", which do not exist in the telemetry table schema, so downloads fail (or partially fail) whenever selected nodes include prefixed IDs. Split/normalize the ID to the actual signal column name before POSTing /api/query.
Useful? React with 👍 / 👎.
| const allLatest = dataStore.getAllLatest(); | ||
| const vals: Record<string, number> = {}; | ||
| allLatest.forEach((sample) => { |
There was a problem hiding this comment.
Append history only for the message that changed
This subscription rebuilds from getAllLatest() on every single datastore update and appends every signal into telemetryHistoryRef, even when that signal did not receive a new frame. Since subscribe is triggered per ingested message, unrelated high-rate traffic will duplicate stale values for other IDs and skew correlation/insight calculations. Use the updatedMsgID callback argument (or per-signal timestamp checks) so only truly updated signals are appended.
Useful? React with 👍 / 👎.
| const x = s1.slice(0, len); | ||
| const y = s2.slice(0, len); |
There was a problem hiding this comment.
Align correlation windows to most recent samples
When histories differ in length, the correlation code slices from index 0, so it compares the oldest part of the longer series against the shorter series. In live telemetry this produces misleading r values because recent behavior is ignored for longer histories. Correlation should align on the latest shared window (tail slice) to reflect current relationships used by auto-linking and sidebar insights.
Useful? React with 👍 / 👎.
No description provided.