Draft
Add progress-bar background with progressive color to free spots label in Upcoming Days#20
Conversation
Copilot
AI
changed the title
[WIP] Add progress bar background on free spots label
Add progress-bar background with progressive color to free spots label in Upcoming Days
Aug 3, 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.
The Upcoming Days view showed free-spot counts as a plain badge, requiring readers to parse numbers to gauge availability. This adds a progress-bar fill behind the label, sized by the free/total ratio and colored progressively from green (all free) through yellow to red (none free).
Changes
src/services/availability.ts(new) — PureavailabilityVisual(freeCount, totalSpots)returning{ percent, color }.percentis the fill width;coloris an HSL value interpolated across hue0→120(red→green). Guards against divide-by-zero and clamps out-of-range counts.src/routes/future/index.tsx— Badge exposes fill via--availability-percent/--availability-colorinline CSS vars and gainsrole="progressbar"+aria-valuenow/min/max.src/global.css—.availability-badgebecomes a positioned container; a::beforepseudo-element renders the fill from the CSS vars (behind text, with a transition).src/services/availability.test.ts(new) — Covers 0/50/100% fill, color mapping, zero-total, and clamping edges.The discrete
badge-full/badge-low/badge-availabletext-color classes are retained; the progressive fill sits behind the existing styling.