Improve playback stability and screenshot editor defaults #1476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR enhances audio playback stability and updates screenshot editor UX defaults.
Audio playback improvements:
Screenshot editor default changes:
Robustness improvements:
eprintln!with propertracing::error!for structured loggingConfidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant EditorUI as Screenshot Editor UI participant WS as WebSocket participant Rendering as Rendering Layer participant Audio as Audio Playback participant Device as Audio Device Note over User,Device: Audio Playback Improvements User->>Audio: Start playback Audio->>Device: Try DeviceDefault buffer size (prioritized) alt DeviceDefault succeeds Device-->>Audio: Stream ready else DeviceDefault fails Audio->>Device: Fallback to Fixed(512) buffer size Device-->>Audio: Stream ready end loop Audio callback Audio->>Audio: Render samples & clamp to [-1.0, 1.0] Audio->>Audio: Check video/audio drift alt Drift > 0.12s (increased threshold) Audio->>Audio: Resync to video playhead end Audio->>Device: Output clamped samples end Note over User,Device: Screenshot Editor Defaults & Frame Handling User->>EditorUI: Open screenshot editor EditorUI->>EditorUI: Apply defaults (white bg, pixelate mask) EditorUI->>WS: Connect to frame WebSocket loop Frame updates WS->>EditorUI: Send frame (24-byte metadata) EditorUI->>EditorUI: Parse stride, width, height EditorUI->>EditorUI: Process frame data EditorUI->>EditorUI: Create ImageBitmap end User->>EditorUI: Add arrow annotation EditorUI->>EditorUI: Apply larger arrow head sizing (6x/5x multipliers) User->>EditorUI: Export screenshot EditorUI->>EditorUI: Load image with CORS header EditorUI->>Rendering: Render with background alt Background image exists Rendering->>Rendering: Load background image else Image load fails Rendering->>Rendering: Fallback to white background Rendering->>Rendering: Log warning via tracing end Rendering-->>User: Export complete