Skip to content

Conversation

@srucker01
Copy link
Collaborator

Summary

Implements on-demand streaming for waterfall visualizations, eliminating the need for lengthy preprocessing times. Added test

https://crc-dev.atlassian.net/jira/software/c/projects/SFDS/boards/87?selectedIssue=SFDS-280

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 22, 2026

@lucaspar lucaspar requested a review from Copilot January 22, 2026 18:29
@lucaspar lucaspar added gateway Gateway component javascript Pull requests that update non-trivial javascript code visualization Related to SVI or the visualization component of SDS. labels Jan 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements on-demand streaming functionality for waterfall visualizations, eliminating lengthy preprocessing times by computing FFTs in real-time as needed. The implementation adds a caching layer with intelligent prefetching to ensure smooth user experience.

Changes:

  • Added streaming API endpoints (waterfall_metadata_stream and waterfall_slices_stream) that compute FFT on-demand without preprocessing
  • Implemented persistent DRF file caching in MEDIA_ROOT/drf_cache to avoid repeated downloads from MinIO
  • Added JavaScript components for LRU slice caching (WaterfallSliceCache) and intelligent batch loading with retry logic (WaterfallSliceLoader)

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
gateway/sds_gateway/visualizations/processing/waterfall.py Added on-demand slice computation functions and fixed FFT shift bug for correct frequency display
gateway/sds_gateway/visualizations/processing/utils.py Implemented persistent DRF cache with helper functions for cache lookup and reconstruction
gateway/sds_gateway/api_methods/views/capture_endpoints.py Added three new endpoints: waterfall_slices, waterfall_metadata_stream, waterfall_slices_stream with validation
gateway/sds_gateway/api_methods/tests/test_capture_endpoints.py Added comprehensive tests for waterfall_slices endpoint covering authentication, validation, and edge cases
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceCache.js New LRU cache implementation for waterfall slices with eviction policies
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceLoader.js New API loader with batching, retry logic, request deduplication, and debouncing
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceLoader.test.js Comprehensive Jest tests for slice loader covering all major functionality
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceCache.test.js Jest tests for cache implementation including LRU eviction and edge cases
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js Integrated streaming mode with fallback to preprocessed data, added loading states and prefetching
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallRenderer.js Added loading placeholder rendering for missing slices during streaming
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallControls.js Added loading state management for scroll buttons
gateway/sds_gateway/static/js/visualizations/waterfall/PeriodogramChart.js Fixed frequency axis calculation to include center frequency offset
gateway/sds_gateway/static/js/visualizations/waterfall/constants.js Added cache, batch, and prefetch strategy constants
gateway/sds_gateway/static/js/visualizations/waterfall/index.js Added imports for new cache and loader modules
gateway/sds_gateway/context_processors.py Added context processor to expose VISUALIZATIONS_ENABLED setting
gateway/config/settings/base.py Registered new context processor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway component javascript Pull requests that update non-trivial javascript code visualization Related to SVI or the visualization component of SDS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants