Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 70 lines 3.6 kB view raw view rendered
1# Video Export Progress System Improvements 2 3## Overview 4Enhanced the progress display and user feedback system in the `video.mjs` piece to provide better visibility into export status without requiring the JavaScript console. 5 6## Key Improvements Made 7 8### 1. Enhanced Progress Bar Display 9- **Detailed Phase Indicators**: Shows specific phases like "PREPARING FRAMES", "ENCODING VIDEO", "TRANSCODING MP4" 10- **Phase-specific Progress**: Two-level progress bars showing overall progress and current phase progress 11- **ETA Calculation**: Displays estimated time remaining based on progress history 12- **Real-time Status Messages**: Uses status messages sent from bios.mjs via `recorder:export-status` events 13 14### 2. Better System Message Handling 15- **Cleaned up handleSystemMessage()**: Removed invalid `actAlerts.push()` calls since `actAlerts` is not accessible in piece context 16- **Enhanced Console Logging**: Detailed progress logging with percentages and status for debugging 17- **Proper Event Processing**: Handles `recorder:export-progress`, `recorder:transcode-progress`, and `recorder:export-complete` events 18 19### 3. Completion Feedback 20- **Success Message**: Shows "MP4 COMPLETED!", "GIF COMPLETED!", etc. when exports finish 21- **Timed Display**: Completion message appears for 3 seconds then auto-hides 22- **Visual Feedback**: Green text in a bordered box for clear visibility 23 24### 4. Progress Tracking Improvements 25- **Progress History**: Tracks progress over time for ETA calculations 26- **Export Timing**: Records start time and calculates elapsed time 27- **State Management**: Proper reset of all flags and timers when exports complete 28 29## Architecture Understanding 30 31### How Progress Communication Works 321. **Bios → Video Piece**: Progress sent via system events 33 - `recorder:export-status` - Status messages and phase updates 34 - `recorder:export-progress` - Progress percentage (0-1) 35 - `recorder:transcode-progress` - Transcoding specific progress 36 - `recorder:export-complete` - Completion notification 37 382. **Event Processing**: 39 - Events processed in `handleSystemMessage()` function 40 - Called from main `act()` function when system events occur 41 - Updates local state variables for display in `paint()` 42 433. **UI Display**: 44 - Progress bars rendered in `paint()` function 45 - Two modes: Extended (detailed) or VHS tape-style 46 - Real-time updates without manual console checking 47 48### ActAlerts System 49- `actAlerts` is a global array in `disk.mjs` that converts to act events 50- Items pushed to `actAlerts` become named events processed by pieces 51- **Not accessible from pieces** - only from within disk.mjs context 52- Alternative: Use existing system message events (which we're already doing) 53 54## Usage 55Now when exporting ZIP/GIF/MP4 files: 561. **Visual Progress**: Watch detailed progress bars in the video piece UI 572. **Status Updates**: See current phase and estimated time remaining 583. **Completion Feedback**: Clear success message when export finishes 594. **No Console Required**: All information visible in the UI 60 61## Code Changes 62- **File Modified**: `/workspaces/aesthetic-computer/system/public/aesthetic.computer/disks/video.mjs` 63- **Functions Enhanced**: `handleSystemMessage()`, `paint()`, completion handling 64- **New Features**: Completion message system, ETA calculation, phase-specific progress 65 66## Benefits 67- **Better UX**: Users can monitor exports without opening dev tools 68- **Clear Feedback**: Know exactly what phase the export is in 69- **Professional Feel**: Polished progress display with timing information 70- **Debug Friendly**: Enhanced console logging still available for development