Skip to content

dotbot/console-web: unified web console for control + orchestration - #279

Open
geonnave wants to merge 27 commits into
DotBots:developfrom
geonnave:unified-web-ui
Open

dotbot/console-web: unified web console for control + orchestration#279
geonnave wants to merge 27 commits into
DotBots:developfrom
geonnave:unified-web-ui

Conversation

@geonnave

Copy link
Copy Markdown
Contributor

Adds dotbot/console-web/, a map-first web console that merges the PyDotBot control plane and swarmit orchestration into one UI: Map/List/Grid views with shared selection, a footer control dock (drive pad, LED, waypoint missions), and a testbed rail (flash with per-device SSE progress, start/stop/reset, streaming event console, missions panel). Ported from a Claude Design prototype; React 18 + Vite + TS, no UI framework, all colors through design tokens with dark/light themes.

The controller serves the built console at /console, side by side with the classic /PyDotBot frontend (replacing it is deferred until the console is hardware-validated), and proxies /swarmit/* to the swarmit server through a streaming httpx route so SSE stays live and the console is same-origin in production exactly like under the vite dev proxy. The swarmit endpoint is configurable: [run.controller] swarmit_url in dotbot.toml, --swarmit-url, or DOTBOT_SWARMIT_URL; the default http://localhost:8001 matches swarmit serve. The config resolver learned dotted nested sections for this.

Dev harness under dotbot/console-web/dev/: a stateful fake swarmit server implementing the real HTTP contract (status/settings/start/stop/reset, chunked /flash/stream SSE, /events with history replay), a demo fleet for the dotbot simulator, and TESTING.md with run commands and a manual checklist. Pointing the console at a real swarmit server is a URL change.

Things a reviewer should know:

  • The drive pad's steering sign is verified against dotbot_simulator only; the classic frontend used the opposite sign on real robots, so one of the two has a left/right swap. Needs one teleop test on a real DotBot before the pad is trusted (if inverted: flip the sign in Joystick.tsx and file the bug against the simulator).
  • The controller does not push mode/status transitions over WS, so the console runs a 3 s refetch to catch AUTO->MANUAL arrival flips; pushing those notifications is a future PyDotBot improvement.
  • swarmit's /flash/stream progress is only visible to the requesting client; multi-client progress belongs in /events or /status (to file upstream).
  • The flash dialog's firmware image list is static pending an artifact source.

Validated end-to-end against dotbot run simulator + the fake swarmit server (all views/themes, waypoint missions, full flash/start/stop cycle, production build served from the controller), plus vitest for the pure logic (state merge, mission tail-grouping, SSE parsing), pytest for config resolution and the proxy, a new console CI job mirroring the frontend job, and sdist/wheel builds inspected to confirm the built console ships.

geonnave added 26 commits July 9, 2026 13:21
…yphs

Adopts the design's north-up y convention (screen top = arena max-y),
which deliberately diverges from dotbot/frontend's y-down map - keep
that in mind when comparing positions across the two UIs.

AI-assisted: Claude Fable 5
AI-assisted: Claude Fable 5
…troller conventions

The controller reports direction as 0 = north (+y), positive counter-
clockwise, so the north-up display must negate it; the pad's steering
sign is verified against the simulator (pad-right = clockwise arc) but
the classic frontend used the opposite sign on real hardware - validate
on a real DotBot before trusting teleop in the field.

AI-assisted: Claude Fable 5
…should go)

The pad closes the heading loop itself at 10 Hz (P on heading error,
alignment-scaled throttle with a floor that keeps the motion-derived
heading observable). Replaces body-relative throttle/yaw teleop, which
felt erratic; verified convergent against the simulator.

AI-assisted: Claude Fable 5
AI-assisted: Claude Fable 5
AI-assisted: Claude Fable 5
AI-assisted: Claude Fable 5
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.03672% with 2940 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.83%. Comparing base (6f11e9c) to head (7912b45).
⚠️ Report is 30 commits behind head on develop.

Files with missing lines Patch % Lines
dotbot/console-web/src/MapView.tsx 0.00% 457 Missing and 1 partial ⚠️
dotbot/console-web/src/Footer.tsx 0.00% 431 Missing and 1 partial ⚠️
dotbot/console-web/src/App.tsx 0.00% 421 Missing and 1 partial ⚠️
dotbot/console-web/src/TestbedRail.tsx 11.11% 392 Missing ⚠️
dotbot/console-web/src/ListView.tsx 0.00% 179 Missing and 1 partial ⚠️
dotbot/console-web/src/viewChrome.tsx 0.00% 165 Missing and 1 partial ⚠️
dotbot/console-web/src/Joystick.tsx 0.00% 139 Missing and 1 partial ⚠️
dotbot/console-web/dev/fake_swarmit_server.py 29.33% 106 Missing ⚠️
dotbot/console-web/src/Minimap.tsx 0.00% 101 Missing and 1 partial ⚠️
dotbot/console-web/src/GridView.tsx 0.00% 100 Missing and 1 partial ⚠️
... and 9 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           develop     #279       +/-   ##
============================================
- Coverage    83.27%   66.83%   -16.44%     
============================================
  Files          119      137       +18     
  Lines        11120    14442     +3322     
  Branches       570      616       +46     
============================================
+ Hits          9260     9653      +393     
- Misses        1857     4774     +2917     
- Partials         3       15       +12     
Files with missing lines Coverage Δ
dotbot/__init__.py 100.00% <100.00%> (ø)
dotbot/config.py 98.07% <100.00%> (+0.05%) ⬆️
dotbot/controller.py 83.19% <100.00%> (+0.61%) ⬆️
dotbot/controller_app.py 96.96% <100.00%> (+0.06%) ⬆️
dotbot/tests/test_config.py 100.00% <100.00%> (ø)
dotbot/tests/test_controller_app.py 100.00% <100.00%> (ø)
dotbot/tests/test_server.py 100.00% <100.00%> (ø)
dotbot/server.py 94.87% <95.45%> (+0.05%) ⬆️
dotbot/console-web/src/types.ts 11.11% <11.11%> (ø)
dotbot/console-web/src/main.tsx 0.00% <0.00%> (ø)
... and 16 more

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The bot marker used a fixed CSS transition (left/top .2s linear).
Position updates arrive at whatever rate the source reports them
(~20Hz in simulation, sparser and irregular from real LH2 hardware),
so the fixed 200ms duration is either too short relative to the gap
between updates (the bot glides for 200ms then holds still until the
next update, producing visible stutter) or too long (a fast update
interrupts the transition already in flight). The old frontend has
no transition at all and snaps instantly, which is the same defect
in its more visible form.

Add useSmoothPositions: a small per-bot animation state driven by
requestAnimationFrame, using the previously observed update interval
as the next animation's duration (clamped to [60ms, 600ms]) instead
of a constant. A jump larger than 35% of the arena diagonal in one
update is treated as a teleport and rendered instantly rather than
animated across the whole arena. MapView now reads bot render
position from this hook instead of the raw prop, and the CSS
transition is removed (redundant with per-frame interpolation).

Verified: vitest (7 new cases covering first-sight snap, in-flight
retarget, duration clamping, teleport detection), tsc build, eslint,
and a manual pass against the running simulator + vite dev stack.

AI-assisted: Claude Sonnet 5
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