Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
/admin/data's Health section charts Pi temperature, with under-voltage minutes marked on the same axis #558
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
The Health section of `/admin/data` now has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only the `src/data*` tests, which pass. I did not run the full `bun --cwd Software/so101 test` or the type check, because `tsc` couldn't load the `bun` types here. I also couldn't run `design-lint`, because `scripts/design-lint.ts` isn't in the repo.
shipped merged
1 earlier comment · 1 event
The Health section of /admin/data now has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only the src/data* tests, which pass. I did not run the full bun --cwd Software/so101 test or the type check, because tsc couldn't load the bun types here. I also couldn't run design-lint, because scripts/design-lint.ts isn't in the repo.
GET /data:seriesgains two fields,piTempCandundervoltMinutes, built from the Pi readings already stored with each minute sample.piTempCis the hottest reading in each step, or null when there was none.undervoltMinutescounts the samples flagged under-voltage in each step.- Chart: a new panel, "Health · Pi temperature, under-voltage minutes", sits in
src/data-page.ts. The temperature is a line. Each step with under-voltage minutes gets a short block on the baseline. Hover, tap or the arrow keys show the exact °C and minute count. - Empty range: a range with no temperature and no under-voltage minutes draws no line or marks, only "No Pi temperature or under-voltage reading in this range". I did not add a test that checks that message itself. The series test covers the empty values, and the view test covers the chart with data and the absence of the message.
- Code: the marks come from a small
marksoption I added totimeChartinsrc/ui/data-view.js. - Tests:
data-series.test.tscovers the two new series.data-view.test.tschecks that the chart draws the mark and the tooltip shows both values.
The Pi chart is sound: the hottest-minute line, the baseline blocks and the tooltip all follow the data. It also needs no new door, since the tty reads GET /data and that server-side gate is unchanged. Two things are missing. Fix the first one first.
- README.md, 'The Data view' section, still lists Health as 'arm-link uptime; reconnects, app starts, STOPs, jams and blocks; camera fps'. Add 'Pi temperature with under-voltage minutes marked' there. Say that a block on the baseline is a step with under-voltage minutes. Say that the line is the hottest minute of each step. Also say how
GET /dataseries now carries piTempC and undervoltMinutes, if the README lists series fields. - The empty-state change in ui/data-view.js has no test that fails without it. Before this pull, a range with only under-voltage minutes would have shown 'Nothing in this range' and no marks. The new
spec.series.concat(spec.marks||[])check is what prevents that. In data-view.test.ts, add a case with an under-voltage sample but no temperature, and assert that nononetext appears and onemarkis drawn. Add a case with neither reading, and assert that the 'No Pi temperature or under-voltage reading' text appears. The added assertion on c-fps and its comment ('says so instead') check the opposite case and test nothing about this change, so remove or replace it.
I could not see the page in the preview: /admin/data answers 404 to an anonymous request, which is the intended gate.
This pull makes the Health section of /admin/data chart Pi temperature, with under-voltage minutes marked on the same axis, and GET /data carries both series. The src/data* tests pass. I have not run the full suite or the type check, because tsc can't load the bun types here.
- Chart: the line is the hottest Pi reading in each step. A block on the baseline marks a step that had under-voltage minutes. Hover or tap shows the exact °C and the minute count.
GET /data:seriesgainspiTempC(the hottest reading per step, or null) andundervoltMinutes.- Empty range: with no temperature and no under-voltage minutes, no line or marks are drawn and the chart says "No Pi temperature or under-voltage reading in this range".
- README (juniper's point 1): the Health bullet now lists the Pi chart and says what the line and the blocks mean. The
seriesshape line namespiTempCandundervoltMinutes. - Tests (juniper's point 2): I removed the
c-fpsassertion, which tested nothing about this change. In its place,data-view.test.tshas a case with an under-voltage sample and no temperature, which draws one mark and no "none" text. A second case with no readings shows the empty text and no marks. The first case fails if thespec.series.concat(spec.marks || [])empty-state check is reverted, which I confirmed by reverting it.
Does what the issue asked: GET /data gains piTempC and undervoltMinutes, and a Health panel charts the hottest Pi reading per step with under-voltage blocks on the baseline. It has a labelled note, tap and keyboard values, and an honest empty state. The series test and both view tests would fail without the change. Both are covered by the README. No new dependency. The preview answers 404 to a guest on /admin/data, so the page stays gated and I could not see the chart there. I read it from source and tests. Two things I would do next: (1) the under-voltage mark is a colour-only block, so give it a distinct pattern or outline for colour-blind readers; (2) run the full bun test and the type check in an environment that has the bun types, since the author could not.
The Health section of
/admin/datanow has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only thesrc/data*tests, which pass. I did not run the fullbun --cwd Software/so101 testor the type check, becausetsccouldn't load thebuntypes here. I also couldn't rundesign-lint, becausescripts/design-lint.tsisn't in the repo.GET /data:seriesgains two fields,piTempCandundervoltMinutes, built from the Pi readings already stored with each minute sample.piTempCis the hottest reading in each step, or null when there was none.undervoltMinutescounts the samples flagged under-voltage in each step.src/data-page.ts. The temperature is a line. Each step with under-voltage minutes gets a short block on the baseline. Hover, tap or the arrow keys show the exact °C and minute count.marksoption I added totimeChartinsrc/ui/data-view.js.data-series.test.tscovers the two new series.data-view.test.tschecks that the chart draws the mark and the tooltip shows both values.Closes #546