Skip to content

fix: FIT-173: Follow up fix: Spectrogram initial render #7762

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

Merged

Conversation

cloudmark
Copy link
Contributor

@cloudmark cloudmark commented Jun 14, 2025

Fix: Spectrogram Initialization Issue

Reason for Change

Currently, the spectrogram visualization does not appear immediately upon initialization unless there is user interaction (scrolling or zooming). This is a visual bug that affects the user experience as the spectrogram data is loaded but not rendered until interaction occurs.

Solution

We've implemented a deferred draw mechanism that triggers the initial render of the spectrogram shortly after initialization. This ensures the spectrogram is visible immediately without requiring user interaction.

Technical Details

  • Added a small delay (100ms) after initialization before triggering the first draw
  • This delay allows the canvas and WebGL context to be fully ready
  • The draw is triggered automatically without requiring user interaction
  • Subsequent draws continue to work as before with user interactions

Testing

  1. Verified the spectrogram appears immediately upon initialization
  2. Confirmed that subsequent interactions (zoom/scroll) continue to work normally
  3. Tested across different browsers (Chrome, Firefox, Safari)
  4. Verified performance impact is minimal

Visual Evidence

  • Before the fix: Shows the spectrogram not appearing until user interaction
  • After the fix: Demonstrates the spectrogram appearing immediately upon initialization

Risks

  • Low risk change as it only affects the initial render timing
  • No impact on data processing or core functionality
  • Small performance overhead from the additional draw call, but negligible

Rollout Strategy

  • This is a bug fix that can be deployed directly
  • No feature flags or environment variables required
  • Can be rolled out with normal deployment process

Reviewer Notes

  • Focus on the timing of the initial draw call
  • Verify that the spectrogram appears immediately on page load
  • Check that the solution doesn't introduce any performance issues
  • Review the video evidence to confirm the fix works as expected

Related Issue

#7761

General Notes

This fix improves the user experience by ensuring the spectrogram is visible immediately upon initialization, making the visualization more intuitive and reducing potential user confusion about whether the data has loaded correctly.

…terface the spectrogram does not appear (unless we scroll or zoom), we need to defer the draw by a bit when we initialise.
@cloudmark cloudmark requested a review from a team as a code owner June 14, 2025 11:31
Copy link

netlify bot commented Jun 14, 2025

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0760158

Copy link

netlify bot commented Jun 14, 2025

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0760158

@github-actions github-actions bot added the fix label Jun 14, 2025
Copy link

netlify bot commented Jun 14, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 0760158
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/6852b05c7edb7200080ddd87
😎 Deploy Preview https://deploy-preview-7762--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 14, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 0760158
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/6852b05c7803490008b04bb2
😎 Deploy Preview https://deploy-preview-7762--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@makseq makseq changed the title fix: spectrogram initial render fix: FIT-173: Follow up fix: Spectrogram initial render Jun 14, 2025
@makseq makseq enabled auto-merge (squash) June 14, 2025 12:46
@cloudmark
Copy link
Contributor Author

cloudmark commented Jun 18, 2025

Tested it out and this does not work @bmartel , we need the timeout to defer a bit later, best to keep my changes for consistency

@bmartel bmartel disabled auto-merge June 18, 2025 12:42
@bmartel bmartel merged commit 92d62c6 into HumanSignal:develop Jun 18, 2025
65 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants