From b0b42e81de25ae0e0c8d9a21fce03a928943ce03 Mon Sep 17 00:00:00 2001 From: CyberMind Date: Fri, 15 May 2026 13:26:41 +0200 Subject: [PATCH] Feature/135 converge round square dashboards into re (#140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixup(common): pod_size=48 to match deployed icon sizes (ref #135) Module icons were falling back to first-letter placeholders because SquareDashboard/RoundDashboard called paint_pod_cluster(pod_size=40) while load_module_icon only ships sizes 22/48/96/128. Bump pod_size to 48 and radius from 70 to 78 so the pod inner edge (54) stays clear of the central button (44). Confirmed on Pi 4B square hardware: pods now render with full icons. Co-Authored-By: Claude Opus 4.7 (1M context) * fixup(square): ship remote-ui/common/assets/icons to /var/www/common/assets (ref #135) The square build script shipped remote-ui/common/python/ but skipped remote-ui/common/assets/. secubox_common.icons.load_module_icon resolves icons at /var/www/common/assets/icons/ — when that path is missing on the deployed image, every module pod falls back to a first-letter placeholder. The round build script already does this at line 925; bringing square to parity. Fails the build (exit 2) if no *-48.png icons land — same shape as the existing python-package guard right above. Co-Authored-By: Claude Opus 4.7 (1M context) * fixup(square): install secubox-otg-gadget.sh to /usr/local/sbin (ref #135) The square build script enables secubox-otg-gadget.service but never copies the composer script to /usr/local/sbin/. On boot the service ExecStarts a missing file → fails silently → the Pi 4B's USB-C bus stays unconfigured → MOCHAbin/host see no enumeration (zero dmesg events, xhci setup timeouts). The round build copies it at build-eye-remote-image.sh:618; bringing square to parity. The script itself lives in remote-ui/common/shell/, already shared between the two images. Hardware-confirmed: Pi 4B booted and rendered the dashboard but MOCHAbin got no USB events whatsoever on either a hub-deep port or a direct port, across cable swaps. Root cause was the missing composer, not cabling. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: CyberMind-FR Co-authored-by: Claude Opus 4.7 (1M context) --- .../square_dashboard.py | 5 ++++- remote-ui/round/round_dashboard.py | 5 ++++- remote-ui/square/build-eye-square-image.sh | 22 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/secubox-eye-square/kiosk/secubox_eye_square_kiosk/square_dashboard.py b/packages/secubox-eye-square/kiosk/secubox_eye_square_kiosk/square_dashboard.py index 56a13587..087cd20e 100644 --- a/packages/secubox-eye-square/kiosk/secubox_eye_square_kiosk/square_dashboard.py +++ b/packages/secubox-eye-square/kiosk/secubox_eye_square_kiosk/square_dashboard.py @@ -38,7 +38,10 @@ class SquareDashboard(DashboardCanvas): self.paint_rainbow_ring(dash, self.CENTER, 235, 220) self.paint_concentric_arcs(dash, self.CENTER, MODULES, metrics, self.RING_RADII) - self.paint_pod_cluster(dash, MODULES, self.CENTER, radius=70, pod_size=40) + # pod_size=48 matches the deployed icon sizes (22/48/96/128); 40 would + # miss and fall back to the first-letter placeholder. radius bumped + # to 78 so pod inner edge (54) stays clear of the central button (44). + self.paint_pod_cluster(dash, MODULES, self.CENTER, radius=78, pod_size=48) self.paint_central_button(dash, self.CENTER, size=44) img.paste(dash, (0, 0)) diff --git a/remote-ui/round/round_dashboard.py b/remote-ui/round/round_dashboard.py index c7dea3e7..519c1c9c 100644 --- a/remote-ui/round/round_dashboard.py +++ b/remote-ui/round/round_dashboard.py @@ -22,7 +22,10 @@ class RoundDashboard(DashboardCanvas): self.paint_rainbow_ring(img, self.CENTER, 235, 220) self.paint_concentric_arcs(img, self.CENTER, MODULES, metrics, self.RING_RADII) - self.paint_pod_cluster(img, MODULES, self.CENTER, radius=70, pod_size=40) + # pod_size=48 matches the deployed icon sizes (22/48/96/128); 40 would + # miss and fall back to the first-letter placeholder. radius bumped + # to 78 so pod inner edge (54) stays clear of the central button (44). + self.paint_pod_cluster(img, MODULES, self.CENTER, radius=78, pod_size=48) self.paint_central_button(img, self.CENTER, size=44) return img diff --git a/remote-ui/square/build-eye-square-image.sh b/remote-ui/square/build-eye-square-image.sh index 8bd3632d..98333f91 100755 --- a/remote-ui/square/build-eye-square-image.sh +++ b/remote-ui/square/build-eye-square-image.sh @@ -103,6 +103,17 @@ log "Installing config files (systemd, udev, apparmor, firstboot)..." cp -r "$REPO_ROOT/remote-ui/square/files/." "$ROOT_MNT/" chmod +x "$ROOT_MNT/usr/local/sbin/firstboot.sh" +# Install the shared OTG gadget composer (round does this at line 618 of +# build-eye-remote-image.sh). secubox-otg-gadget.service ExecStarts this path; +# without it the gadget never composes and the Pi 4B's USB-C bus stays silent +# → MOCHAbin/host enumeration fails (no descriptor events, xhci timeouts). +log "Installing OTG gadget composer at /usr/local/sbin/secubox-otg-gadget.sh..." +cp "$REPO_ROOT/remote-ui/common/shell/secubox-otg-gadget.sh" \ + "$ROOT_MNT/usr/local/sbin/secubox-otg-gadget.sh" +chmod +x "$ROOT_MNT/usr/local/sbin/secubox-otg-gadget.sh" +test -x "$ROOT_MNT/usr/local/sbin/secubox-otg-gadget.sh" || \ + { err "secubox-otg-gadget.sh not executable on rootfs"; exit 2; } + # Ship the shared secubox_common package. log "Embedding remote-ui/common/python at /var/www/common/python/..." mkdir -p "$ROOT_MNT/var/www/common/python" @@ -110,6 +121,17 @@ cp -r "$REPO_ROOT/remote-ui/common/python/." "$ROOT_MNT/var/www/common/python/" test -d "$ROOT_MNT/var/www/common/python/secubox_common" || \ { err "secubox_common not in /var/www/common/python — common/ source incomplete"; exit 2; } +# Ship the shared icon assets — secubox_common.icons.load_module_icon +# resolves at /var/www/common/assets/icons/ first. Without these the pod +# cluster falls back to first-letter placeholders. +log "Embedding remote-ui/common/assets at /var/www/common/assets/..." +mkdir -p "$ROOT_MNT/var/www/common/assets" +cp -r "$REPO_ROOT/remote-ui/common/assets/." "$ROOT_MNT/var/www/common/assets/" +ICON_COUNT=$(ls "$ROOT_MNT/var/www/common/assets/icons"/*-48.png 2>/dev/null | wc -l) +test "$ICON_COUNT" -gt 0 || \ + { err "no *-48.png icons in /var/www/common/assets/icons — common/ assets incomplete"; exit 2; } +log " → $ICON_COUNT module icons at size 48 shipped" + log "Installing Python packages..." mkdir -p "$ROOT_MNT/usr/lib/python3/dist-packages" cp -r "$REPO_ROOT/packages/secubox-eye-square/helper/eye_square_helper" \