Skip to content

Add progress-bar background with progressive color to free spots label in Upcoming Days - #20

Draft
enzy with Copilot wants to merge 2 commits into
masterfrom
copilot/use-progress-bar-background
Draft

Add progress-bar background with progressive color to free spots label in Upcoming Days#20
enzy with Copilot wants to merge 2 commits into
masterfrom
copilot/use-progress-bar-background

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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) — Pure availabilityVisual(freeCount, totalSpots) returning { percent, color }. percent is the fill width; color is an HSL value interpolated across hue 0→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-color inline CSS vars and gains role="progressbar" + aria-valuenow/min/max.
  • src/global.css.availability-badge becomes a positioned container; a ::before pseudo-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.
availabilityVisual(0, 10);  // { percent: 0,   color: "hsl(0, 65%, 45%)" }   red
availabilityVisual(5, 10);  // { percent: 50,  color: "hsl(60, 65%, 45%)" }  yellow
availabilityVisual(10, 10); // { percent: 100, color: "hsl(120, 65%, 45%)" } green

The discrete badge-full/badge-low/badge-available text-color classes are retained; the progressive fill sits behind the existing styling.

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
Copilot AI requested a review from enzy August 3, 2026 07:51
Copilot finished work on behalf of enzy August 3, 2026 07:51
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.

Use a progress bar background on free spots label in Upcoming Days view

2 participants