You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TeslaUSB v2.0 — Core Requirements & Implementation Plan
Comprehensive plan addressing boot performance, UI consistency, video management, cloud sync, WiFi reliability, and crash protection for the TeslaUSB Raspberry Pi Zero 2 W USB gadget.
Supersedes #35 (cloud-only scope expanded to full platform requirements).
Core Principles
USB presentation is Refactored #1 boot priority — Tesla sees the drive within ~3 seconds
Remove Thumbnail System — Remove generation code, API endpoints, client-side queue JS, cache dirs (saves RAM + complexity)
Template Audit — All templates: emoji→Lucide SVG, hex→CSS tokens, button consistency, touch targets (44px), dark mode
Button Component Standardization — Shared CSS button classes (primary/secondary/danger/ghost) applied across all templates
Phase 4: Video Panel Redesign (Map Integration)
Recent Events Slide-out Panel — Panel on map page with "Recent Events" tab: trips with events (no play btn, show on map), sentry clips (with play btn). All sources: USB + ArchivedClips
All Clips Tab — Unified list of every clip; geo-aware play button logic (map if location, list button if not); infinite scroll; search/filter
Map Panel Integration — Trip routes with event bubbles, clicking bubble opens player at timestamp, ArchivedClips included
Video Panel API Endpoints — New /api/recent-events, /api/all-clips; enhance /api/trips with event summaries
Phase 5: Indexing & Archive Improvements
Index All Sources on WiFi — refresh_cloud_token.py indexes ArchivedClips + all USB folders; add mapping.archive_indexing config
Tighter RecentClips Timer — Change to 5-minute interval; run regardless of WiFi state; memory pressure checks
inotify File Watcher — file_watcher_service.py using watchdog library; monitor USB RO mount + ArchivedClips; queue new files for index + sync; fallback to 5-min polling
Phase 6: Cloud Sync Overhaul
Queue-Based Continuous Sync — Persistent SQLite queue; sync worker thread processes items one at a time; wakes on new items; pauses on WiFi disconnect
TeslaUSB v2.0 — Core Requirements & Implementation Plan
Comprehensive plan addressing boot performance, UI consistency, video management, cloud sync, WiFi reliability, and crash protection for the TeslaUSB Raspberry Pi Zero 2 W USB gadget.
Supersedes #35 (cloud-only scope expanded to full platform requirements).
Core Principles
Phase 1: Safety & Stability Foundation
is_protected_file()guard in all delete/cleanup paths; refuse deletion of*.imgfiles in GADGET_DIRPhase 2: Boot Optimization (CRITICAL)
present_usb_on_boot.servicecallspresent_usb.shdirectly (no cleanup wrapper); createteslausb-deferred-tasks.servicefor background cleanup/chime/index/syncPhase 3: UI/UX Consistency
videos.html, redirect/videosto map page, keep stream/download/delete APIsPhase 4: Video Panel Redesign (Map Integration)
/api/recent-events,/api/all-clips; enhance/api/tripswith event summariesPhase 5: Indexing & Archive Improvements
refresh_cloud_token.pyindexes ArchivedClips + all USB folders; addmapping.archive_indexingconfigfile_watcher_service.pyusing watchdog library; monitor USB RO mount + ArchivedClips; queue new files for index + sync; fallback to 5-min pollingPhase 6: Cloud Sync Overhaul
cloud_archive.sync_non_event_videos: falsenice -n 19+ionice -c3; bandwidth limit; one file at a time; inter-file sleep; web UI stays responsivePhase 7: WiFi Reliability
nmcli connection upafter failures; verify concurrent AP+STARequirement Traceability
Key Design Decisions