Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

A session in /admin/data shows its joint traces, intent against actual, with jam, block, STOP and release marks on the same axis #559

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

The session dialog in `/admin/data` now draws one small chart per joint: intent as a dashed line against actual, with the turn's STOP, jam, block, reconnect and app-start events marked on the same time axis. Hovering or tapping a chart shows the exact intent and actual values at that moment.

shipped merged

opened this

The session dialog in /admin/data now draws one small chart per joint: intent as a dashed line against actual, with the turn's STOP, jam, block, reconnect and app-start events marked on the same time axis. Hovering or tapping a chart shows the exact intent and actual values at that moment.

I ran only the data, admin-page and facts tests (58 pass). The full bun --cwd Software/so101 test timed out in my sandbox, so the forge's check is its first full run. tsc couldn't run here because the bun type definitions weren't found.

  • API: GET /data?turn=<id> now returns trace, the stored trace for that turn, or null when none was kept (src/data-api.ts).
  • No trace: the dialog opens with no joint charts, as before.
  • Page: the drawing is jointChart in src/ui/data-view.js, with its styles in src/data-page.ts.
  • Tests: data-api.test.ts and data-view.test.ts cover the trace in the answer and the hover readout.
  • Changed test: in data-page.test.ts I added trace to the list of keys a turn's answer may carry. That list is a check that the page reads only keys the API sends, and it was out of date rather than wrong.

I couldn't run scripts/design-lint.ts: the file doesn't exist at scripts/design-lint.ts from the Software/so101 directory.

Closes #548

1 earlier comment · 1 event
commented

The session dialog in /admin/data now draws one small chart per joint: intent as a dashed line against actual, with the turn's STOP, jam, block, reconnect and app-start events marked on the same time axis. Hovering or tapping a chart shows the exact intent and actual values at that moment.

I ran only the data, admin-page and facts tests (58 pass). The full bun --cwd Software/so101 test timed out in my sandbox, so the forge's check is its first full run. tsc couldn't run here because the bun type definitions weren't found.

  • API: GET /data?turn=<id> now returns trace, the stored trace for that turn, or null when none was kept (src/data-api.ts).
  • No trace: the dialog opens with no joint charts, as before.
  • Page: the drawing is jointChart in src/ui/data-view.js, with its styles in src/data-page.ts.
  • Tests: data-api.test.ts and data-view.test.ts cover the trace in the answer and the hover readout.
  • Changed test: in data-page.test.ts I added trace to the list of keys a turn's answer may carry. That list is a check that the page reads only keys the API sends, and it was out of date rather than wrong.

I couldn't run scripts/design-lint.ts: the file doesn't exist at scripts/design-lint.ts from the Software/so101 directory.

Changes requested — before the latest push

The feature does what the issue asks and the API and tests are sound, but the exact values can only be read with a pointer, and the README does not mention the joint charts. I could not see the dialog itself: the preview answers 403 to my unauthenticated shell, so I judged from the served source.

Fix first: make the readout reachable without a mouse. Give each chart tabindex="0" and handle ArrowLeft/ArrowRight (and Home/End) to step the cursor through samples. Make the readout aria-live="polite", or link it to the chart with aria-describedby. Add a test that fires a keydown and checks the readout.

Then: add a few lines to the README section "The Data view: /admin/data" about the joint charts and the new trace key of GET /data?turn=.

Also: tr.joints[k].actual throws if a stored joint is null, which would break the whole dialog. Guard it with tr.joints[k] &&.

The pull says scripts/design-lint.ts was not run. That script is not at the path I checked under Software/so101 or the repo root. Please run it if it exists elsewhere, since this touches the page CSS.

commented

The joint charts in the session dialog can now be read with the keyboard, and I've addressed the other points from the review. I pushed it as 652e955 on the same branch. The data tests pass (34). I didn't run the full suite or tsc.

  • Keyboard: each joint chart now has tabindex="0". ArrowLeft and ArrowRight step the cursor through the samples, and Home and End jump to the first and last. The readout is aria-live="polite" and linked to the chart with aria-describedby. A new test in data-view.test.ts fires keydown events and checks the readout and the tabindex.
  • Null joint: a stored joint that is null no longer throws. The chart list now skips it (tr.joints[k] &&), so the dialog still opens.
  • README: the "The Data view: /admin/data" section now describes the joint charts and the trace key of GET /data?turn=<id>, which is null when no trace was kept.
  • design-lint: scripts/design-lint.ts does not exist anywhere in this repository. I searched the whole tree, so I could not run it.
Approved

Approved. The trace is read through the same owner/moderator gate as the rest of GET /data (guest gets 403, /admin/data 404 in the preview), null when absent, and the page reads it defensively (null joint, short series, bad hz). Joint charts are keyboard reachable (tabindex, arrows/Home/End, aria-live readout), the readout has reserved height so nothing shifts, and tests cover the API key, hover and keys. Next: (1) the intent/actual distinction is dash vs solid in dim vs accent only; add a legend line or label in text so it does not rely on stroke style alone. (2) jointChart sizes to the box width once; redraw on resize/rotation so a phone turning landscape does not keep a stale width.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs