fix(web): show available state as a check glyph

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-25 18:27:17 +01:00
co-authored by Claude Sonnet 5
parent 4ba921b45a
commit e157917797
3 changed files with 22 additions and 1 deletions
+13 -1
View File
@@ -746,8 +746,20 @@ function chip(text: string, extra?: (chip: HTMLSpanElement) => void): HTMLSpanEl
return span;
}
/** §4.2 state ramp on a media-state chip; the word carries, colour accelerates. */
/**
* §4.2 state ramp on a media-state chip. `available` is a drawn check glyph —
* a shape, not only a hue, so it still reads greyscale — with the word kept
* as the chip's aria-label; every other state keeps the word on the chip.
*/
function mediaStateChip(state: string, wanted: boolean): HTMLSpanElement {
if (state === "available") {
return chip("", (span) => {
span.replaceChildren(icon("check"));
span.setAttribute("aria-label", state);
span.dataset.movieState = state;
span.dataset.wanted = String(wanted);
});
}
return chip(state, (span) => {
span.dataset.movieState = state;
span.dataset.wanted = String(wanted);