fix(web): stabilize the spectrum chart - #125
Merged
Merged
Conversation
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.
Note
🤖 GPT-6 on behalf of Oliver
Explain Like I'm Lost
The dashboard spectrum is a scatter plot of alpha over time; the file view plots f(alpha) against alpha. Both now bind Chart.js to the mounted canvas so filter changes and empty results cannot leave a blank replacement canvas or stale hover state.
Problem
Fix
Use canvas attachments for creation and destruction, including hover timers and resize subscriptions. Derive the selected source, filters, loading and error states; abort obsolete requests and accept results only for their current request key. Keep the existing bounded window cache and fetch only the selected spectrum source.
The day ingress-destination degeneracy was checked against a read-only copy of the sample product. Its singleton spectra are already stored in the database, with finite tau values. Reapplying the pipeline's rule for the first run of non-increasing alpha estimates reproduces the stored results within float32 rounding. This is a property of the current method on those inputs, not dashboard decoding or clipping; the sets are not small. The interpretation of internal-side MAAD remains open in #121. The pinned MAAD reference uses the same stop-at-first-increase rule. No pipeline or private data changes.
UI Changes
Fixture data only.
Before
After
Review flows
Use the Playwright fixture or a local product with address MAAD. For the fixture, open
/datasets/playwright?startDate=2025-03-01&endDate=2025-03-01&groupBy=5min./netflow/files/202503010200?dataset=playwright; change measure/family and hover the spectrum. The tooltip describes one spectrum point, without an unrelated reference value.Verification
bun run format,bun run lint,bun run typecheckpassed.bun run test:web: 207 tests passed.bun run test:e2ein the Nix shell: 23 tests passed. New browser assertions inspect painted pixels, hover text, cancellation and navigation, using synthetic fixtures.Made by GPT-6 using Codex.