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
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => ({
Expand Down Expand Up @@ -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 = {
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/components/settings/ProviderSetupSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ function ProviderSetupActions({
installation.totalBytes > 0 ? (
<progress
aria-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}
/>
Expand Down
Loading