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

Migrated from github.com/Trevato/SO-ARM100

src/ui/video-pane.js chooses H.264 or the frame feed for a camera and builds a labelled 44 px quality select - module and test only #410

Merged opened this

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

Merged

I added src/ui/video-pane.js and src/ui/video-pane.test.ts and pushed them. The new test passes, but I couldn't run bun x tsc --noEmit. bun x failed here with "unable to write files to tempdir: ReadOnlyFileSystem", and there is no local tsc to run directly.

Notes

shipped merged

opened this

I added src/ui/video-pane.js and src/ui/video-pane.test.ts and pushed them. The new test passes, but I couldn't run bun x tsc --noEmit.

bun x failed here with "unable to write files to tempdir: ReadOnlyFileSystem", and there is no local tsc to run directly. I also didn't run the full bun --cwd Software/so101 test suite, only the new test file. The forge's check will run both.

  • choose(camera, canDecode): returns 'h264' only when camera.h264 === true and canDecode === true, otherwise 'frames'. A truthy but non-boolean h264, such as the string "true", gets 'frames'.
  • qualitySelect(doc, options, onChange): builds a <select aria-label="Video quality"> with min-width and min-height of 44px. Each option's text is set through textContent, and onChange is called with the selected value.

The issue didn't say what options looks like, so I used { value, label }[]. If the caller will pass something else, that is the line to change.

The test covers the choose cases and the select's label, size, options and change callback, using a fake document. Option text containing <b> stays literal text.

Nothing imports the module, so viewer.html and the first-visit gzip budget are unchanged.

🤖 Generated with Claude Code

Closes #382

commented

I added src/ui/video-pane.js and src/ui/video-pane.test.ts and pushed them. The new test passes, but I couldn't run bun x tsc --noEmit.

bun x failed here with "unable to write files to tempdir: ReadOnlyFileSystem", and there is no local tsc to run directly. I also didn't run the full bun --cwd Software/so101 test suite, only the new test file. The forge's check will run both.

  • choose(camera, canDecode): returns 'h264' only when camera.h264 === true and canDecode === true, otherwise 'frames'. A truthy but non-boolean h264, such as the string "true", gets 'frames'.
  • qualitySelect(doc, options, onChange): builds a <select aria-label="Video quality"> with min-width and min-height of 44px. Each option's text is set through textContent, and onChange is called with the selected value.

The issue didn't say what options looks like, so I used { value, label }[]. If the caller will pass something else, that is the line to change.

The test covers the choose cases and the select's label, size, options and change callback, using a fake document. Option text containing <b> stays literal text.

Nothing imports the module, so viewer.html and the first-visit gzip budget are unchanged.

🤖 Generated with Claude Code

Approved

Module and test only, as titled. choose() is strict (=== true on both inputs), so a string "true" falls back to frames. qualitySelect is a native select with an aria-label, 44px min size, and option text set via textContent, so it is keyboard and screen-reader reachable and escaped. The test would fail without each behaviour. Nothing imports it, so there is no preview surface, no new dependency and no gzip change.

Two things next: 1) when it is wired into the viewer, mark the selected option from current state (selected/value) and add a visible text label for the select, not only aria-label; 2) the 44px min is on the select only, so check the real tap row on a 360px phone once it is mounted.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs