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

Migrated from github.com/Trevato/SO-ARM100

A refused move shows its reason on the page and in the Machine panel - never silent #180

Merged opened this

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

Merged

A refused /pose/go, /play or /follow move now shows its reason as one line near the controls. Nothing here handles /move, because the page never calls it. Pose go and the joystick (which streams over /follow) are the page's move paths.

Notes

shipped merged

opened this

A refused /pose/go, /play or /follow move now shows its reason as one line near the controls. Nothing here handles /move, because the page never calls it. Pose go and the joystick (which streams over /follow) are the page's move paths. I haven't tried it in a browser. bun x tsc --noEmit reports nothing apart from a sandbox temp-dir write error. The whole suite passed except the two failures below, and I only re-ran server.test.ts after my last edit.

  • Helper and test: src/ui/refusal.js has refusalLine(body). It drops the server's refused: prefix, strips control characters and caps the line at 160 characters. Anything it doesn't recognise gives "blocked: the arm would not make that move". src/ui/refusal.test.ts covers the reason, the unknown shapes and HTML staying text.
  • Page: viewer.html has a new #refusal element, filled with textContent. A refused pose or play shows its reason there, and an accepted one clears it. A refused stream frame shows as the status blocked in enforce mode (like "gripper is 28 mm below the table; back the leader off"), and the next clear status clears it. To reuse the banner's wording I moved the violation text into one sayViolation function, so banner() and the refusal line share it.
  • Machine panel: the server already logs /pose/go, /play, stream and park refusals to its machine log as clamp "zone" entries with refused: true, so the panel feed already carries them. I made no server change.
  • Test failures: serves the model, its meshes… in server.test.ts also fails on main, so I left it alone. The 50 KB first-visit test went 10 bytes over with my first draft; I shortened the new CSS and code until it passed.
  • Scope: forge.json is untouched, and no dependencies were added.

🤖 Generated with Claude Code

Closes #164

commented

A refused /pose/go, /play or /follow move now shows its reason as one line near the controls. Nothing here handles /move, because the page never calls it. Pose go and the joystick (which streams over /follow) are the page's move paths. I haven't tried it in a browser. bun x tsc --noEmit reports nothing apart from a sandbox temp-dir write error. The whole suite passed except the two failures below, and I only re-ran server.test.ts after my last edit.

  • Helper and test: src/ui/refusal.js has refusalLine(body). It drops the server's refused: prefix, strips control characters and caps the line at 160 characters. Anything it doesn't recognise gives "blocked: the arm would not make that move". src/ui/refusal.test.ts covers the reason, the unknown shapes and HTML staying text.
  • Page: viewer.html has a new #refusal element, filled with textContent. A refused pose or play shows its reason there, and an accepted one clears it. A refused stream frame shows as the status blocked in enforce mode (like "gripper is 28 mm below the table; back the leader off"), and the next clear status clears it. To reuse the banner's wording I moved the violation text into one sayViolation function, so banner() and the refusal line share it.
  • Machine panel: the server already logs /pose/go, /play, stream and park refusals to its machine log as clamp "zone" entries with refused: true, so the panel feed already carries them. I made no server change.
  • Test failures: serves the model, its meshes… in server.test.ts also fails on main, so I left it alone. The 50 KB first-visit test went 10 bytes over with my first draft; I shortened the new CSS and code until it passed.
  • Scope: forge.json is untouched, and no dependencies were added.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it. The merge conflicted in one place, the import block in viewer.html. I kept both imports: refusalLine from this branch and createRoom from main.

After the merge the first-visit size test failed, at 51,494 bytes against its 51.2 KB limit. I fixed that by loading refusal.js with a dynamic import() the first time a move is refused. It's no longer imported up front. The refusal line still behaves as before.

bun x tsc --noEmit reports nothing apart from a sandbox temp-dir write error. I re-ran only server.test.ts after the size fix. In that file the size test now passes, and one test still fails: "serves the model, its meshes and the vendored libraries". It also fails on main here, so I left it alone.

🤖 Generated with Claude Code

Approved

Approved. The preview serves #refusal and the versioned /ui/<hash>/refusal.js resolves. The reason is set with textContent, bounded and control-stripped, and the helper is tested. Refusals already reach the Machine panel through the existing machine.note("clamp","zone",{refused}) entries, so no server change was needed. Scope stays on the issue. Two things I would do next: (1) the viewer wiring (goPose, play and the stream-blocked path) has no test, so a regression there would pass bun test. (2) refused() is an unawaited dynamic import with no catch: if it fails, the reason is silently lost, which is the exact thing this issue forbids. Add a catch that falls back to a plain text line.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs