Commit 5d6419a
Ravi Singh
feat(ui): full design-faithful port of all 7 screens + every control wired to firmware
Comprehensive port from frontend/design-source/. Same look/feel/sizes/
placements as Claude Design handoff; every button, dropdown, field, and
toggle calls a real /api endpoint and persists in NVS or has hardware
effect. Verified all 11 endpoints live on the C3.
Frontend (src/screens.tsx full rewrite + atoms.tsx additions):
LEDs screen — 11 mode cards each with the Claude-design description
("Distance-driven cluster with directional fade", etc), animated mini
LedPreview thumbnails, color preset row + hex input, NumberAndSlider
for brightness/effect speed/intensity/trail, dual-handle distance window
slider, light span / center shift / strip length sliders. Optimistic
writes via /api/settings POST with toast confirms.
Motion screen — large smoothing toggle, real-time raw-vs-smoothed
LineChart (SVG, dashed gridlines, 80-sample ring buffer), filter
sliders (position/velocity/prediction smoothing) + PI gains panel
with explanatory hint card. All values round-trip via /api/settings.
Mesh screen — topology cards with SVG diagrams (straight/L/U/custom,
ported verbatim from design), pair-new-device button opening a 30 s
window with animated pairing card, devices list with healthy dots +
RSSI + lost%, sensor priority cards (most_recent / slave_first /
master_first / zone_based) with descriptions. Wires to /api/topology
and /api/mesh.
Hardware screen — board profile cards (not dropdown), radar driver
cards, pin map with field-label icons + dropdowns filtering unsafe
GPIOs. "Save & reboot" button when reboot is needed; reboots via
/api/reboot.
Network screen — connected status hero card with wifi icon, scan
button + signal-bars indicator + Join/current chip per network, inline
password prompt on Join, hostname input with .local suffix, AP-mode
selector (auto/always/sta_only) + Reset Wi-Fi danger button with
two-click confirmation. All endpoints wired.
System screen — firmware card with version + reboot button, drop-zone
file input with drag-drop or click-to-select, progress bar during
upload, "Flash & reboot" button. Diagnostics with heap/min-heap/
uptime/MAC. Auth section with show/hide password toggle and explicit
"Set password" / "Disable auth" button. JSON config Export downloads
/api/settings JSON. Factory reset with type-the-hostname confirmation
posts to new /api/factory_reset (erases NVS + reboots).
src/atoms.tsx adds: Icon (24 SVG paths from design), Sparkline (gradient
fill + line), NumberAndSlider, DualHandleRange (touch-friendly with
pointermove), TopologyDiagram (4 SVGs), LineChart (raw vs smoothed),
hsv2rgb / rgb2hex / hex2rgb helpers, fmtUptime, useRing.
Firmware:
- /api/factory_reset endpoint: nvs_flash_erase() + esp_restart() in
deferred task so the JSON response can flush first.
- /api/system GET/POST already shipped.
Bug fixes:
- Set Password now shows real error when < 8 chars (was silent).
- OTA upload uses postBinary() with progress callback (was generic POST).
Build: 1.16 MB binary, 19%% free in app slot. UI bundle 81.8 KB raw /
24.1 KB gzipped. Both C3s flashed.
Verified live on hardware at 192.168.0.216:
- /api/ping, /api/version, /api/distance, /api/system, /api/wifi,
/api/mesh, /api/topology, /api/board/profiles, /api/radar/kinds,
/api/radar/diag, /api/settings — all returning expected payloads.
- Radar diag: driver=ld2410, 867 frames parsed in 30 s, last frame 31 ms ago.
- Distance live: 39 cm.1 parent b61a838 commit 5d6419a
5 files changed
Lines changed: 894 additions & 520 deletions
Large diffs are not rendered by default.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
288 | 307 | | |
289 | 308 | | |
290 | 309 | | |
| |||
1030 | 1049 | | |
1031 | 1050 | | |
1032 | 1051 | | |
| 1052 | + | |
1033 | 1053 | | |
1034 | 1054 | | |
1035 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
0 commit comments