Skip to content

fix: low-bandwidth links render grey instead of blue - #54

Merged
alo-is merged 1 commit into
mainfrom
fix/low-traffic-grey-scale-color
Aug 18, 2026
Merged

fix: low-bandwidth links render grey instead of blue#54
alo-is merged 1 commit into
mainfrom
fix/low-traffic-grey-scale-color

Conversation

@alo-is

@alo-is alo-is commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Symptom

Since the last update, low-bandwidth links render grey ("tout est un peu gris sur les bas débit").

Root cause

Commit 6a8deb0 computes 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) and PublicMapView (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

…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
@alo-is
alo-is merged commit bb98f51 into main Aug 18, 2026
11 checks passed
@alo-is
alo-is deleted the fix/low-traffic-grey-scale-color branch August 18, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant