TypeScript
fix(web): style Antigravity download progress with accessible system colors (#21874)
Julius Marminge6a004844785a
diff --git a/apps/web/src/components/settings/ProviderSetupSection.browser.test.tsx b/apps/web/src/components/settings/ProviderSetupSection.browser.test.tsxindex d65046fd2b9..e6d5ae1c01f 100644--- a/apps/web/src/components/settings/ProviderSetupSection.browser.test.tsx+++ b/apps/web/src/components/settings/ProviderSetupSection.browser.test.tsx@@ -8,7 +8,7 @@ import {} from "@t3tools/contracts";import { act } from "react";import { createRoot, type Root } from "react-dom/client";-import { userEvent } from "vite-plus/test/browser";+import { page, userEvent } from "vite-plus/test/browser";import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";const setup = vi.hoisted(() => ({@@ -293,6 +293,29 @@ describe("Antigravity setup", () => {expect(occurrences("Checking the downloaded runtime.")).toBe(1);});+ it("exposes download progress as a bounded progressbar only while the total is known", async () => {+ const downloading = (downloadedBytes: number, totalBytes: number | null) => {+ setup.installation = {+ ...setup.installation!,+ operationId: "install-1",+ phase: "downloading",+ downloadedBytes,+ totalBytes,+ };+ return publish();+ };+ const progressbar = page.getByRole("progressbar", { name: "Antigravity download" });+ await renderSetup();++ await downloading(40_000_000, 100_000_000);+ await expect.element(progressbar).toHaveValue(40_000_000);+ // The wire contract does not cap downloaded bytes at the advertised total.+ await downloading(110_000_000, 100_000_000);+ await expect.element(progressbar).toHaveValue(100_000_000);+ await downloading(40_000_000, null);+ expect(progressbar.query()).toBeNull();+ });+it("removes an owned damaged runtime only after confirmation", async () => {setup.auth = authState({ phase: "idle", flowId: null, authorizationUrl: null });setup.installation = {diff --git a/apps/web/src/components/settings/ProviderSetupSection.tsx b/apps/web/src/components/settings/ProviderSetupSection.tsxindex f43fa6d2c4f..7c405502a8c 100644--- a/apps/web/src/components/settings/ProviderSetupSection.tsx+++ b/apps/web/src/components/settings/ProviderSetupSection.tsx@@ -218,7 +218,11 @@ function ProviderSetupActions({installation.totalBytes > 0 ? (<progressaria-label="Antigravity download"- className="block h-1 w-full accent-foreground"+ // Forced-colors mode repaints the track and fill as Canvas, and+ // appearance:auto cannot bring the native widget back: the+ // preflight border reset marks every <progress> as author-styled,+ // so Chromium keeps its fallback paint. Use system colors instead.+ className="block h-1 w-full appearance-none overflow-hidden rounded-full bg-muted forced-colors:border [&::-moz-progress-bar]:rounded-full [&::-moz-progress-bar]:bg-primary forced-colors:[&::-moz-progress-bar]:bg-[Highlight] [&::-webkit-progress-bar]:rounded-full [&::-webkit-progress-bar]:bg-muted [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:bg-primary forced-colors:[&::-webkit-progress-value]:bg-[Highlight]"value={installation.downloadedBytes}max={installation.totalBytes}/>