fix: low-bandwidth links render grey instead of blue - #54
Merged
Conversation
…rker
Since traffic % is computed from link bandwidth and rounded to 0.1, a
low-bandwidth ("bas débit") link's utilisation rounds down to 0.0%, which
fell into the default scale's zero-width [0,0] #c0c0c0 "0%" band and rendered
grey. Two views had also diverged: MapView used half-open bands (blue) while
PublicMapView still used inclusive matching (grey).
Extract a single shared getScaleColor (utils/scaleColor.ts) used by both
MapView and PublicMapView. It excludes zero-width bands (min===max) from
colour selection — they are legend markers, not colourable ranges — so a
low/rounds-to-zero but active link is coloured by the first real band (blue)
in both steps and gradient modes and in both views. True structure of the
scale (10/50/90 boundaries, 100% inclusive) is unchanged.
Verified: pct 0.0 -> #3366ff (was #c0c0c0); build + lint green.
Claude-Session: https://claude.ai/code/session_01CGAAuSMM31A4BPqHjTv8M4
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.
Symptom
Since the last update, low-bandwidth links render grey ("tout est un peu gris sur les bas débit").
Root cause
Commit
6a8deb0computes utilisation % from link bandwidth and rounds to 0.1. A low-bandwidth link's utilisation rounds down to 0.0%, which lands in the default scale's zero-width[0,0]#c0c0c0"0%" band → grey. Additionally,MapView(half-open bands, → blue) andPublicMapView(inclusive matching, → grey) had diverged, so the same map coloured low links differently in the two views.Fix
Extract one shared
getScaleColor(frontend/src/utils/scaleColor.ts) used by both views. It excludes zero-width bands (min === max) from colour selection — they are legend markers, not colourable ranges — so a low/rounds-to-zero but active link is coloured by the first real band (blue), consistently across steps + gradient modes and both views. Band structure (10/50/90 boundaries, 100% inclusive) is unchanged.Verified:
pct=0.0 → #3366ff(was#c0c0c0); Docker build + lint green.Note: the grey "0%" entry may still appear in the legend (it's a stored band on existing maps); no link renders grey now. It can be removed per-map in Map Settings if desired.
https://claude.ai/code/session_01CGAAuSMM31A4BPqHjTv8M4