From d0d513b5025f7bb8c06f4a41158dfcae59f5bde1 Mon Sep 17 00:00:00 2001 From: Jaime Idolpx Date: Tue, 9 Jun 2026 02:35:21 -0400 Subject: [PATCH] feat: update documentation to reflect new features and architecture changes, including WebSocket integration and split config storage --- AGENTS.md | 111 +++++++++++++++++++++++++++++++++++++++++++----------- README.md | 45 ++++++++++++++++++---- 2 files changed, 126 insertions(+), 30 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a34df19..693555a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,8 @@ - **Framework**: React 18 + Vite 6 - **Styling**: Tailwind CSS 4 (via `@tailwindcss/vite`) -- **UI components**: Radix UI primitives, MUI icons (`@mui/icons-material`), Lucide React icons +- **UI components**: Radix UI primitives, Lucide React icons +- **3D / animation**: Three.js r0.160 (`WebGLRenderer`, `EffectComposer`, `UnrealBloomPass`, custom GLSL shaders) - **Routing**: React Router 7 (single-page, page state managed in `App.tsx`) - **Build base path**: `/config/` (overridable via `BASE_PATH` env var) @@ -17,21 +18,27 @@ ``` src/ app/ - App.tsx # Root component: routing, nav, layout, SaveStatusBadge - settings.ts # useSettings() hook — load/save config.json via WebDAV - webdav.ts # WebDAV abstraction (listDirectory, stat, put/get, etc.) + App.tsx # Root component: routing, nav, layout, SaveStatusBadge, WsProvider wrapper + settings.ts # useSettings() hook — loads config.json + devices.json, saves split + webdav.ts # WebDAV abstraction (listDirectory, stat, put/get, fileExists, etc.) + ws.tsx # WsProvider + useWs() — single shared WebSocket connection context components/ - StatusPage.tsx # System status, activity log, file info, progress, overlays - DevicesPage.tsx # Device list + StatusPage.tsx # System status, activity log, reset (via WS), WS status indicator + DevicesPage.tsx # Device list, Rescan Bus (sends "iec scan" via WS) DeviceDetailOverlay.tsx GeneralPage.tsx # General/settings IECPage.tsx # IEC bus configuration - NetworkPage.tsx # Network settings + NetworkPage.tsx # Network settings, WiFi scan/connect (via WS) OtherPage.tsx # Misc settings ToolsPage.tsx # Tools SearchOverlay.tsx - WiFiScanOverlay.tsx - MediaBrowser.tsx # WebDAV file browser (file click = select, kebab menu) + WiFiScanOverlay.tsx # WiFi scan results; Connect sends "connect []" via WS + MediaManager.tsx # WebDAV file browser: file icons by type, kebab actions, + # Configure Folder (.config editor), base_url mount logic, + # media set existence check, navigate into new folder + RealityOverridePage.tsx # Full-screen WS command display; Three.js Digital Tokamak + # vortex + star field; double-tap to toggle background + RealityOverrideAdminPage.tsx # Command palette (Image/Audio/Video); freeform input; WS send figma/ # Figma-generated components ui/ # shadcn/Radix UI wrappers vendor/ @@ -40,14 +47,18 @@ src/ package.json imports/ logo.svg - # config.json removed — config now loaded at runtime from /.sys/config.json + config.json # Bundled fallback (full merged config including iec.devices) main.tsx styles/ public/ manifest.webmanifest icon.192.png / icon.512.png service-worker.js # PWA service worker -webdav3.py # Dev Python WebDAV server (port 80, serves files/) +files/ + .sys/ + config.json # Runtime config on device (no iec.devices) + devices.json # Runtime device list: { "iec": { "devices": { ... } } } +webdav3.py # Dev Python WebDAV + WebSocket server (port 80, serves files/) index.html vite.config.ts ``` @@ -67,16 +78,17 @@ Bottom tab bar + header icons: | (profile) | `general` | GeneralPage | | (profile) | `tools` | ToolsPage | +Header also has: fullscreen toggle (Maximize2/Minimize2), search, apps grid, save-status badge, profile menu. Logo click → status page. + ## Apps Page -Grid of app cards grouped by category, each navigates to a stub `AppPage`: +Grid of app cards grouped by category, each navigates to a stub `AppPage` unless implemented: -- **Disk**: Directory Editor, Sector Editor, BAM Editor, Disk Visualizer, RAM/ROM Explorer, Dump Disk Image, Write Disk Image +- **Management**: Media Manager, Print Manager, Serial Console, Short Codes +- **Disk**: RAM/ROM Explorer, BAM Editor, Directory Editor, Sector Editor, Disk Visualizer, Dump/Write Disk Image - **Cartridge**: PRG to CRT, Magic Desk Cart Builder, Easy Flash Cart Builder - **Development**: Basic Editor, Assembler, Sprite Editor, Character Set Editor, Petscii Editor -- **Display**: Idle Animation, Loading Animation - -All individual app pages are currently stubs (`AppPage` component with "coming soon" message). +- **Display**: Idle Animation, Loading Animation, **Reality Override** (implemented), **Override Admin** (implemented) ## Work to Date (chronological) @@ -93,18 +105,73 @@ All individual app pages are currently stubs (`AppPage` component with "coming s 11. **WebDAV client** — replaced `webdav@5` npm package with vendored `webdav-component` (browser-native `fetch` + `DOMParser`, no external deps). All pages import from `webdav.ts` abstraction layer. 12. **WebDAV path fixes** — `webdav.ts`: always `decodeURIComponent` paths; use `entry.uri` (not broken `entry.path`) for servers returning relative hrefs 13. **`webdav3.py` server fixes** — `displayname` now returns leaf name only (not full path); PROPFIND depth-1 guard prevents crash when called on a file -14. **MediaBrowser redesign** — file click = `onSelect` + close; folder click = navigate; per-row kebab (`MoreVert`) opens a Dialog with contextual actions; permanent "Select Folder" button in footer; no mode-toggle buttons +14. **MediaBrowser redesign** — file click = `onSelect` + close; folder click = navigate; per-row kebab (`MoreVert`) opens a Dialog with contextual actions; permanent "Select Folder" button in footer 15. **Settings persistence** — `settings.ts` + `useSettings()` hook: loads `/.sys/config.json` via WebDAV on mount, auto-saves 3 s after last change, exposes `saveStatus` / `pendingCount` / `flushNow`; `beforeunload` flushes via `fetch keepalive` 16. **Save-status badge** — `SaveStatusBadge` in `App.tsx` header shows: idle (hidden), loading spinner, amber "N unsaved + Save button", saving spinner, saved checkmark, red error + retry +17. **File icons by extension** — MediaManager shows `Disc` icon for disk extensions (`.d64`, `.d71`, `.d81`, etc.) and `HardDrive` icon for HD extensions (`.img`, `.iso`, etc.) +18. **Device URL display** — StatusPage shows `device.base_url + device.url` concatenated +19. **WebSocket server** — `webdav3.py` upgraded with RFC 6455 WebSocket handler at `/ws`; echoes received frames to all connected clients; thread-safe broadcast +20. **RealityOverridePage** — full-screen page that subscribes to WS commands and displays them centered on screen; Three.js Digital Tokamak vortex background with `UnrealBloomPass`; twinkling star field canvas always running beneath +21. **RealityOverrideAdminPage** — command palette (Image/Audio/Video conversion groups, 30 commands); freeform command input with Enter key support; sent-command flash indicator +22. **Source map warnings fixed** — stripped all `//# sourceMappingURL=` comments from 26 vendored webdav-component ESM files +23. **MediaManager: navigate into new folder** — after `handleCreateFolder`, automatically calls `load(newPath)` to navigate into the created folder +24. **MediaManager: Configure Folder** — "Configure Folder" action in kebab menu creates `.config` if absent and opens it in ConfigEditor; saving re-parses content into `folderConfig` state immediately and closes editor +25. **Mount logic: base_url=`.`** — in `.config`, `base_url: .` resolves to the current folder path; mounting a file inside the base sets `url` to the relative path; mounting outside clears `base_url` +26. **Media Set existence check** — `Promise.all(fileExists)` filter applied before building media set in both MediaManager and DeviceDetailOverlay; toast warning shown if some files are missing +27. **Mobile PWA fullscreen** — `viewport-fit=cover`, `apple-mobile-web-app-capable`, `black-translucent` status bar style, `apple-mobile-web-app-title`; body `overscroll-behavior: none`; safe-area CSS env() insets on header and nav +28. **Fullscreen API button** — header Maximize2/Minimize2 button; webkit prefix fallback; `isFullscreen` state tracks `fullscreenchange` event +29. **Logo click → status page** — logo wrapped in `