Improve Home page UX and HVSC state management#33
Improve Home page UX and HVSC state management#33chrisgleissner wants to merge 15 commits intomainfrom
Conversation
- Added cache status management to the HVSC library, including baseline version and update tracking. - Implemented action tracing for HVSC install and ingest operations. - Introduced a reset handler for HVSC state management. - Updated hooks and state management to reflect new cache status and phases. test: Add unit tests for playback routing with FTP support - Implemented tests for playback routing that utilize FTP for loading SID files. - Added scenarios for successful FTP downloads and fallbacks to local uploads. test: Enhance RAM operations tests for chunked reads and writes - Added tests to ensure RAM is read and written in monotonic 2KB chunks. - Included retry logic for failed read operations. feat: Introduce LED color configuration and utility functions - Created a new module for LED color definitions and utility functions for RGB conversion. - Added tests to validate color definitions and RGB conversion functionality. feat: Implement C64 liveness checking mechanism - Developed a new module to check the liveness of the C64 machine based on jiffy and raster readings. - Added tests to verify the liveness checking logic under different scenarios. feat: Add volume state management for playback - Introduced a volume state management system to handle mute and index transitions. - Added tests to ensure correct state transitions for volume management.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
=============================================
- Coverage 88.31% 63.22% -25.09%
Complexity 25 25
=============================================
Files 192 4 -188
Lines 25663 155 -25508
Branches 8856 24 -8832
=============================================
- Hits 22663 98 -22565
+ Misses 2851 42 -2809
+ Partials 149 15 -134
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR expands device/library management and playback flows across the app: HVSC gains cache-status awareness + action tracing + reset behavior, playback gains an FTP-based SID upload path for Ultimate sources with known duration, and multiple UI areas are updated for better inline configuration and interaction behavior (plus accompanying unit/E2E tests).
Changes:
- Add C64 liveness checking + RAM operation tracing/recovery, with expanded unit coverage for chunked reads/writes and retry behavior.
- Enhance HVSC UX/state with cache status + phase tracking, action tracing, and a reset handler; extend Playwright coverage for tracing and progress.
- Add playback routing for Ultimate SIDs via FTP download + upload when duration is known; plus LED color utilities and volume state reducer with tests.
Reviewed changes
Copilot reviewed 27 out of 58 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/ramOperations.test.ts | Extends RAM tests for 2KB monotonic chunking + retry behavior; updates API mock for liveness reads. |
| tests/unit/playbackRouter.test.ts | Adds unit tests covering FTP download + upload path and fallback to PUT. |
| tests/unit/playFiles/volumeState.test.ts | Adds unit tests for the new volume reducer state transitions. |
| tests/unit/machine/c64Liveness.test.ts | Adds unit tests for jiffy/raster-based liveness decisions. |
| tests/unit/config/ledColors.test.ts | Adds tests validating fixed LED color definitions + RGB helpers. |
| src/pages/playFiles/volumeState.ts | Introduces a reducer-based state machine for volume/mute handling. |
| src/pages/playFiles/hooks/useHvscLibrary.ts | Adds HVSC cache status polling, action tracing wrappers, phase computation, ingest gating, and reset handler. |
| src/pages/playFiles/components/HvscControls.tsx | Updates HVSC controls UI to show phase/status, reset option, and ingest gating. |
| src/pages/PlayFilesPage.tsx | Switches volume/mute management to the reducer and plumbs new HVSC state into UI. |
| src/pages/MusicPlayerPage.tsx | Uses StatefulButton for play/restart button to align visuals with play state. |
| src/pages/HomePage.tsx | Reworks LED controls inline, adds SID type/profile column handling, and updates SID control entry derivation. |
| src/lib/playback/playbackRouter.ts | Adds Ultimate SID FTP fetch + upload path when duration is available, with fallback to existing PUT behavior. |
| src/lib/machine/ramOperations.ts | Adds liveness checks, detailed tracing, and reset/reboot recovery on retry for RAM operations. |
| src/lib/machine/c64Liveness.ts | New module implementing jiffy+raster liveness sampling and trace recording. |
| src/lib/config/ledColors.ts | New module centralizing LED fixed colors and RGB helpers. |
| src/hooks/useLocalSources.ts | Initializes local sources state from storage eagerly and avoids redundant effect updates. |
| src/components/ui/button.tsx | Introduces Stateless vs Stateful button exports; default Button now blurs on click. |
| src/components/itemSelection/ItemSelectionDialog.tsx | Adds a test hook to disable local auto-confirm behavior and resets auto-confirming on open. |
| src/components/QuickActionCard.tsx | Blurs card button on click to clear focus/pressed state. |
| playwright/visualSeeds.ts | Seeds local sources storage for more stable visual runs. |
| playwright/uiMocks.ts | Adds HVSC cache-status mock to UI fixtures. |
| playwright/sourceSelection.ts | Adds interstitial-aware source selection helper for tests. |
| playwright/screenshots.spec.ts | Adjusts screenshot flow for local import selection and scroll reset before capture. |
| playwright/itemSelection.spec.ts | Adds coverage to ensure source interstitial resets on reopen and minor whitespace cleanup. |
| playwright/hvsc.spec.ts | Adds action-trace ordering assertions and more granular progress-step scenarios. |
| playwright/homeInteractivity.spec.ts | Adds tests for SID type column rendering and focus-clearing behavior. |
| PLANS.md | Updates execution plan to match the expanded set of fixes/features implemented. |
…and improve HomePage tests - Added state management for extraction files and total in useHvscLibrary hook. - Implemented throttling for extraction progress updates. - Updated download summary handling to accommodate new extraction state. - Refactored HomePage tests to use more specific queries and improve readability. - Introduced SectionHeader component for better UI structure. - Created DriveCard and SidCard components for improved drive and SID management UI.
…ur handling on button clicks
… step properties feat: Integrate stale ingestion state recovery in useHvscLibrary hook test: Add mock handling for stream start/stop in mockC64Server test: Extend c64Liveness tests to handle zero-byte readMemory errors test: Update HomePage tests to reflect changes in stream button states docs: Create PLANS.md outlining UX and diagnostics improvements feat: Implement RAM read script for sequential C64 RAM dumping feat: Implement RAM write script for bulk writing to C64 memory feat: Create centralized sliderDeviceAdapter for improved slider behavior test: Add unit tests for sliderDeviceAdapter functionality
- Implemented `getOnOffButtonClass` function to return appropriate CSS classes based on the button's enabled state. - Added unit tests for `getOnOffButtonClass` to verify success styling when enabled and muted styling when disabled.
- Implemented input for overriding HVSC base URL in SettingsPage. - Added state management for the HVSC base URL input and preview. - Included logic to commit changes on input blur and Enter key press. - Updated UI to display current base URL and instructions for use. feat: enhance SidCard component with async volume and pan change handlers - Added async handlers for volume and pan changes in SidCard. - Introduced optional formatting functions for volume and pan values. - Updated component props to accommodate new async handlers and formatters. feat: improve PlaybackSettingsPanel with formatted duration display - Integrated duration formatting for the duration slider in PlaybackSettingsPanel. - Refactored layout for better organization of input fields and buttons. feat: extend VolumeControls with async change handling and value formatting - Added async change handling for volume adjustments in VolumeControls. - Introduced optional value formatting for better user experience. test: enhance unit tests for ConfigItemRow and connectionManager - Updated tests to ensure proper handling of value changes and adaptive layouts. - Improved test descriptions for clarity. test: add tests for new ramDumpFolderStore functionality - Implemented tests for deriving RAM dump folder display paths. - Verified correct formatting for primary and non-primary storage paths. test: create tests for slider behavior and value formatting utilities - Added tests for slider async queue behavior and midpoint snapping logic. - Implemented tests for formatting dB and pan values. feat: introduce haptic feedback for slider interactions - Added haptic feedback functionality for slider components. - Implemented checks for haptic availability and fallback options. feat: create utility functions for slider value formatting - Developed utility functions for formatting dB and pan values. - Ensured consistent display of audio parameters across components.
…g and timeout management
…ttingsPage for clarity
test: Add unit tests for playback routing with FTP support
test: Enhance RAM operations tests for chunked reads and writes
feat: Introduce LED color configuration and utility functions
feat: Implement C64 liveness checking mechanism
feat: Add volume state management for playback