-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: BROS-202: Add interactive resize handles for waveform and spect… #8116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rogram components - Add ResizeRenderer with rounded handle design and shadow effects - Implement hover states with area borders and handle highlighting - Add size badge that displays current dimensions during drag operations - Support both light and dark themes with adaptive colors - Integrate with InteractionManager for robust mouse event handling - Ensure playhead updates correctly after resize operations Technical changes: - Create ResizeRenderer class implementing Renderer and Interactive interfaces - Add shadow properties to ResizeRendererConfig for enhanced visibility - Implement global mouse tracking for reliable drag operations - Add handle border that changes color on hover (gray to white) - Create area border that only appears on hover with increased width - Add size badge (100x28px) with theme-adaptive colors - Update Visualizer to register resize renderers with InteractionManager - Ensure proper layer composition with resize handles - Add height change handling for both waveform and spectrogram components UI/UX improvements: - Rounded resize handles (60x6px) with subtle shadows - Hover feedback with area borders and handle highlighting - Real-time size display during drag operations - Clean interface with minimal visual clutter - Professional appearance with modern shadow effects - Consistent behavior across waveform and spectrogram components The resize handles provide intuitive height adjustment for audio visualization components while maintaining a clean, professional interface.
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8116 +/- ##
===========================================
- Coverage 70.41% 9.42% -60.99%
===========================================
Files 719 451 -268
Lines 51560 29337 -22223
Branches 8734 7811 -923
===========================================
- Hits 36304 2764 -33540
- Misses 15253 26570 +11317
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
cursor review |
🚨 Bugbot couldn't runSomething went wrong. Try again by commenting "Cursor review" or "bugbot run", or contact support (requestId: serverGenReqId_30aca6e8-0a10-4619-9666-e674c373345e). |
|
Cursor review |
| if (this.isDragging) { | ||
| this.isDragging = false; | ||
| this.removeGlobalMouseListeners(); | ||
| console.log(`Finished resizing ${this.componentName} (global)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Renderer Height Mismatch and Debug Logs
The ResizeRenderer has two issues:
- Inconsistent Minimum Height: It allows dragging to a minimum height of 20px, but the
Visualizer'shandleHeightChangemethod enforces a 50px minimum. This creates a confusing user experience where the component appears unresponsive or snaps back. - Debug Logs: Unnecessary
console.logstatements are present in the code.
| const badgeY = (height - badgeHeight) / 2; | ||
|
|
||
| // Detect dark mode and set appropriate colors | ||
| const isDarkMode = getCurrentTheme() === "dark"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/git merge
|
#8116) Co-authored-by: niklub <[email protected]>
Add Interactive Resize Handles to Audio Visualizer Components
Reason for Change
The audio visualizer currently has fixed heights for waveform and spectrogram components, which limits user customization. Users need the ability to dynamically resize these components to optimize their workflow - for example, they might want a larger spectrogram for detailed frequency analysis while keeping a compact waveform for overview.
Problem: Users cannot adjust component heights after initialization, forcing them to compromise on visualization quality or work with suboptimal layouts.
Solution: Implement interactive resize handles that allow users to dynamically adjust waveform and spectrogram heights with real-time visual feedback and optimized performance.
Screenshots
Here is a loom video
https://www.loom.com/share/93867e28a8464e759ff18421eb7688d8
Rollout Strategy
Feature Flag: This feature is controlled by the existing
FF_AUDIO_SPECTROGRAMSfeature flag for spectrogram functionality. The waveform resize is always available when spectrograms are enabled.Environment: No additional environment variables required. The feature integrates with existing audio annotation workflows.
Testing
Manual Testing
Basic Functionality:
Performance Testing:
Cross-browser Testing:
Edge Cases:
Automated Testing
ResizeRendererhit testing and cursor managementInteractionManagerevent routingRisks
Performance Risks
UX Risks
Compatibility Risks
Reviewer Notes
Key Implementation Details
Architecture:
ResizeRendererimplements bothRendererandInteractiveinterfacesInteractionManagerhandles event routing for offscreen canvasesPerformance Optimizations:
Visual Design:
Files to Review
Core Implementation:
libs/editor/src/lib/AudioUltra/Visual/Renderer/ResizeRenderer.ts- Main resize logiclibs/editor/src/lib/AudioUltra/Interaction/InteractionManager.ts- Event managementlibs/editor/src/lib/AudioUltra/Interaction/Interactive.ts- Interface definitionlibs/editor/src/lib/AudioUltra/Visual/Visualizer.ts- Integration and height managementKey Changes:
waveform-resizeandspectrogram-resizelayershandleHeightChangemethod for dynamic height updatesInteractionManagerfor offscreen canvas event handlingTesting Focus Areas
InteractionManagerGeneral Notes
Technical Implementation
The resize functionality uses a layered approach:
ResizeRendererdraws handles and borders on dedicated layersInteractionManagerroutes mouse events to interactive elementsLayerMcomposes multiple canvases for performanceUser Experience
Future Enhancements
This implementation provides a solid foundation for user-customizable audio visualization while maintaining performance and compatibility with existing workflows.