Skip to content

fix(http): make setup wizard servo slider draggable - #59

Closed
Mechazawa wants to merge 4 commits into
jamro:mainfrom
Mechazawa:fix/sliders
Closed

Mechazawa wants to merge 4 commits into
jamro:mainfrom
Mechazawa:fix/sliders

Conversation

@Mechazawa

@Mechazawa Mechazawa commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What

  • The servo calibration bar in the setup wizard was display-only, so joints could only be moved with the nudge buttons. It is now a range input: dragging updates the angle readout and the servo moves on release. The slider is disabled while a move is in flight, and a release during a move snaps back to the current angle.
  • The wizard slider and the servo test page slider share one .servo-slider style, with a selector specific enough that the generic .form-group input[type=range] margin no longer pushes the thumb below the track.
  • Wizard copy updated to mention the slider.

Checks

  • Title is type(scope): summary
  • Breaking HTTP / pins / NVS / servo defaults / hook CLI called out as type!: plus a BREAKING CHANGE: footer — none; UI only, no API change
  • Firmware: pio run and/or pio test -e native when that code changed — pio run; no settings validation touched
  • Packages: npm test --prefix packages/tiny-engineer-cursor / …/tiny-engineer-antigravity / …/tiny-engineer-claude-code when that package changed — N/A, no package changes
  • HTTP: HTML index (src/http/index_page.cpp) + docs/api.md (and README / docs/hardware/testing.md if the route list changed) — no route or parameter changes; /setup/servo is called as before
  • Settings: layers in docs/settings.md; no raw access_token in logs — N/A
  • CAD: .f3d + exported .3mf; CERN-OHL-S; AiEmblem.3mf not used as a branding swap — N/A
  • Pins: include/pins.h + docs/hardware/ together — N/A
  • Servo ranges not widened without a real robot — the slider spans 0–180° like the existing nudge buttons; saved ranges and clamps are unchanged
  • Hardware tested: robot / bench / N/A — robot: flashed over OTA, servo test page slider checked. The setup wizard itself has not been exercised in setup AP mode.
  • No .env, tokens, or Wi-Fi passwords in logs or screenshots

PCB (if this PR changes a board)

N/A — no board changes.

Summary by CodeRabbit

  • Improvements
    • Setup calibration can now be adjusted by dragging the slider or using the buttons. The displayed angle updates as you drag, and the servo moves when you release the slider.
    • Servo controls are disabled while a move is in progress. Targets are limited to 0–180°, and the displayed angle is restored if a move cannot be completed.
    • Updated setup guidance to explain how to use the slider and buttons.

Mechazawa and others added 4 commits October 6, 2026 09:21
The calibration bar was display-only, so joints could only be moved with
the nudge buttons. It is now a range input that moves the servo on
release and is disabled while a move is in flight.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The generic form-group range margin outranked the class selector and
pushed the slider below the drawn track.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dec3e5dc-36cb-440b-9934-ba949a452962
📥 Commits

Reviewing files that changed from the base of the PR and between a3ffa52 and 3dbeb47.

📒 Files selected for processing (1)
  • src/http/index_page.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The setup calibration guide now uses an interactive range input. Slider movement updates the displayed angle, and releasing the slider requests servo movement through shared calibration logic.

Changes

Servo calibration

Layer / File(s) Summary
Slider controls
src/http/index_page.cpp
Shared styling and busy-state handling apply to servo sliders. The setup guide now contains a labeled range input and updated instructions.
Calibration movement
src/http/index_page.cpp
Dragging updates the displayed angle. Changing the slider calls shared movement logic, which clamps targets and restores the previous angle when busy, unchanged, or when a request fails.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: jamro

Merge Risk: ⚪ Minimal · up to 3dbeb

No actionable merge-blocking risk was identified in the calibration slider changes; proceed with normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making the setup wizard’s servo slider draggable.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mechazawa
Mechazawa marked this pull request as ready for review October 6, 2026 07:31
Comment thread src/http/index_page.cpp
<div class="servo-slider-track">
<div class="servo-slider-bg"><div id="servo-safe-band" class="servo-safe-band"></div></div>
<input type="range" id="servo-slider" min="0" max="180" value="90">
<input type="range" id="servo-slider" class="servo-slider" min="0" max="180" value="90">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally kept the slider in the setup wizard display-only for safety reasons.

During calibration, "/setup/servo" can move through the full 0–180° range without the normal safe-range clamp. Making the slider interactive makes it too easy to accidentally command a large movement, especially on mobile where precise slider control is difficult. That can cause parts to collide or cables to be pulled.

The step buttons are deliberate: they force the user to explore the range gradually and keep each movement small and predictable.

Please keep the setup wizard slider visual-only and retain the nudge buttons as the only way to move the servo during calibration. Improving the visual slider styling/synchronization is fine, but I don't want direct dragging to command servo movement here.

@Mechazawa Mechazawa closed this Oct 6, 2026
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.

2 participants