Conversation
…a validation for spectrograms
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses spectrogram-related OOM issues by tightening server-side validation and making the spectrogram UI consume server-provided “source of truth” configuration, and it adds environment branding to the Django admin to reduce the risk of operating on the wrong database.
Changes:
- Introduces centralized spectrogram parameter validation/options on the server (FFT size capped at 2048) and injects those defaults/options into the spectrogram template.
- Improves spectrogram front-end error/status handling so failed generations stop spinning and display actionable errors.
- Adds Django admin environment branding (CSS + template) plus environment detection utilities and tests.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gateway/sds_gateway/visualizations/views.py | Adds a server-built spectrogram_form context object for templates. |
| gateway/sds_gateway/visualizations/tests/test_views.py | Verifies spectrogram view context includes server-provided defaults/options. |
| gateway/sds_gateway/visualizations/api_views.py | Adds Pydantic-backed spectrogram param validation and new FFT cap/options. |
| gateway/sds_gateway/templates/visualizations/spectrogram.html | Renders FFT/colormap options and numeric ranges from server context. |
| gateway/sds_gateway/static/js/visualizations/spectrogram/constants.js | Removes now-redundant client-side spectrogram settings/options constants. |
| gateway/sds_gateway/static/js/visualizations/spectrogram/SpectrogramVisualization.js | Improves status/error display and failed-request handling. |
| gateway/sds_gateway/static/js/visualizations/spectrogram/SpectrogramControls.js | Switches controls to initialize from server-rendered DOM values/ranges. |
| gateway/sds_gateway/templates/admin/base_site.html | Adds admin environment/FQDN branding and environment-based body class. |
| gateway/sds_gateway/static/css/admin_environment.css | Styles admin header by environment via admin-env-* classes. |
| gateway/sds_gateway/context_processors.py | Exposes ADMIN_CONSOLE_ENV to templates. |
| gateway/sds_gateway/users/tests/test_context_processors.py | Adds tests for admin env detection and template rendering. |
| gateway/config/settings/utils.py | Adds shared hostname/env-based staging detection + admin env label helper. |
| gateway/config/settings/base.py | Introduces ADMIN_CONSOLE_ENV setting with normalization/defaulting. |
| gateway/sds_gateway/users/tests/test_admin.py | Removes an unnecessary type-ignore in admin tests. |
| gateway/sds_gateway/api_methods/tests/test_capture_endpoints.py | Small assertion tweak (id → pk). |
| gateway/.envs/example/django.prod-example.env | Sets DJANGO_DEBUG=false in prod example env. |
| gateway/.envs/example/django.env | Sets DJANGO_DEBUG=true in local example env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
gateway/sds_gateway/static/js/visualizations/spectrogram/SpectrogramControls.js
Show resolved
Hide resolved
klpoland
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.