Skip to content

fix(calibration): add explicit "Save port" button so ports can be updated without recalibrating (#53)#59

Open
pgsharma wants to merge 1 commit into
huggingface:mainfrom
pgsharma:fix/save-port-without-recalibration
Open

fix(calibration): add explicit "Save port" button so ports can be updated without recalibrating (#53)#59
pgsharma wants to merge 1 commit into
huggingface:mainfrom
pgsharma:fix/save-port-without-recalibration

Conversation

@pgsharma

@pgsharma pgsharma commented Jul 2, 2026

Copy link
Copy Markdown

Problem

Fixes #53.

The SO-101 uses serial, so its port (/dev/tty.usbmodem…, COM…) changes when the arm is unplugged/reconnected. As the issue reports, the only visible way to update a robot's saved port was to redo the entire calibration.

Root cause

The port already does autosave: persistPort() in Calibration.tsx writes the port to the robot record on input blur and on port-detection (added in 027575b, ~2 weeks before this issue was filed). But it's silent — no button, no confirmation — so users don't realize the change was saved and reasonably assume recalibration is the only path. Hence "Missing save button during calibration."

Fix (frontend only)

  • Add a visible Save button next to the Port field that persists the port to the robot record and shows a confirmation toast (Saved <port> for the leader/follower — no recalibration needed).
  • Add a one-line hint under the field noting ports change on reconnect.
  • persistPort() now returns "saved" | "unchanged" | "skipped" | "error" (and checks res.ok) so the button can report success/failure. The existing silent onBlur / on-detect autosave is unchanged.

No backend change — POST /robots/{name} already does partial (port-only) merges via save_robot_record.

Testing

  • npm run build ✓ and eslint src/pages/Calibration.tsx ✓ (clean).
  • Manual: open Calibration for a robot → change Port → Save → toast confirms, record updates, no recalibration needed; teleop/record then use the new port.

frontend/dist/ intentionally not committed — CI (build_frontend.yml) rebuilds it on merge.

🤖 Generated with Claude Code

SO-101 serial ports change on reconnect, and the only *visible* way to
update a robot's port was to redo the entire calibration. The port
already autosaves on blur (027575b), but with no button or confirmation
users don't realize it — hence issue huggingface#53 ("Missing save button during
calibration").

Add a visible "Save" button next to the port field that persists the
port to the robot record and shows a confirmation toast, plus a hint
line noting ports can change on reconnect. persistPort() now returns a
result so the button can report success/failure. No backend change —
POST /robots/{name} already supports partial (port-only) updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing save button during calibration

2 participants