Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions web/src/components/PlaybackRouteBadges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import { getSessionRouteNodes, type ActivityRouteNode } from "@/pages/adminActiv
/** Decorative separator between values; not text, so not translated. */
const SEPARATOR = "·";

/**
* The label before a badge's value. 75% foreground blends with the tint
* under it, so it reads on any accent; high contrast lightens the surfaces,
* so there it takes the boosted muted color instead.
*/
const LABEL_CLASS =
"text-foreground/75 [html[data-high-contrast=true]_&]:text-muted-foreground font-(--font-weight-ui)";
Comment thread
Quick104 marked this conversation as resolved.
Resolved

const BADGE_COLORS: Record<ActivityRouteNode["kind"], string> = {
transcode: "border-warning/25 bg-warning/10 text-warning",
proxy: "border-info/25 bg-info/10 text-info",
Expand All @@ -30,9 +38,7 @@ function NetworkBadge({ name, title }: { name: string; title: string }) {
aria-label={t("web.player.routeBadge.networkAria", { name })}
className="border-primary/20 bg-primary/10 text-primary inline-flex max-w-full items-center gap-1 rounded border px-1.5 py-0.5 text-[9px] font-semibold"
>
<span className="text-foreground/75 font-(--font-weight-ui)">
{t("web.player.routeBadge.network")}
</span>
<span className={LABEL_CLASS}>{t("web.player.routeBadge.network")}</span>
<span aria-hidden="true">{SEPARATOR}</span>
<span className="truncate">{name}</span>
</span>
Expand Down Expand Up @@ -104,7 +110,7 @@ export function PlaybackRouteBadges({
>
{node.kind === "transcode" || node.kind === "proxy" ? (
<>
<span className="text-foreground/75 font-(--font-weight-ui)">{node.label}</span>
<span className={LABEL_CLASS}>{node.label}</span>
<span aria-hidden="true">{SEPARATOR}</span>
</>
) : null}
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/admin-downloads/PreparationTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,10 @@ function WorkerBadge({ prep }: { prep: AdminDownloadPreparation }) {
}
return (
<span className="border-primary/20 bg-primary/10 text-primary inline-flex max-w-full items-center gap-1 rounded border px-1.5 py-0.5 text-[9px] font-semibold">
<span className="text-foreground/75 font-(--font-weight-ui)">{worker.label}</span>
{/* Same label treatment as the playback route badges (PlaybackRouteBadges). */}
<span className="text-foreground/75 [html[data-high-contrast=true]_&]:text-muted-foreground font-(--font-weight-ui)">
{worker.label}
</span>
<span className="truncate">{worker.name}</span>
</span>
);
Expand Down
Loading