fix(calibration): add explicit "Save port" button so ports can be updated without recalibrating (#53)#59
Open
pgsharma wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()inCalibration.tsxwrites 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)
Saved <port> for the leader/follower — no recalibration needed).persistPort()now returns"saved" | "unchanged" | "skipped" | "error"(and checksres.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 viasave_robot_record.Testing
npm run build✓ andeslint src/pages/Calibration.tsx✓ (clean).frontend/dist/intentionally not committed — CI (build_frontend.yml) rebuilds it on merge.🤖 Generated with Claude Code