diff --git a/apps/web/src/components/ProviderUpdatesAction.tsx b/apps/web/src/components/ProviderUpdatesAction.tsx
index 3da57601dc55d..a90b9302c1b71 100644
--- a/apps/web/src/components/ProviderUpdatesAction.tsx
+++ b/apps/web/src/components/ProviderUpdatesAction.tsx
@@ -1,6 +1,10 @@
import { m } from "../i18n/messages";
import { thrownErrorMessage } from "@t3tools/client-runtime/errors";
-import { AuthProvidersManageScope, PROVIDER_DISPLAY_NAMES } from "@t3tools/contracts";
+import {
+ AuthProvidersManageScope,
+ type EnvironmentId,
+ PROVIDER_DISPLAY_NAMES,
+} from "@t3tools/contracts";
import {
isAtomCommandInterrupted,
settlePromise,
@@ -19,6 +23,7 @@ import {
getProviderUpdateRunToastView,
type ProviderUpdateRun,
} from "./ProviderUpdateLaunchNotification.logic";
+import { selectUpdateMachines } from "./sidebar/updateEverything.logic";
import { Button } from "./ui/button";
import { stackedThreadToast, toastManager } from "./ui/toast";
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
@@ -94,19 +99,26 @@ export function useProviderUpdates() {
: [];
});
- const updateAll = async ({ quiet = false }: { readonly quiet?: boolean } = {}) => {
+ const updateAll = async ({
+ quiet = false,
+ environmentIds,
+ }: {
+ readonly quiet?: boolean;
+ readonly environmentIds?: ReadonlyArray;
+ } = {}) => {
const runs = await Promise.all(
- machines.flatMap(({ environmentId, label, candidates }) =>
- candidates.map(async (candidate): Promise => ({
- environmentId,
- machineLabel: label,
- driver: candidate.driver,
- instanceId: candidate.instanceId,
- result: await updateProvider({
+ selectUpdateMachines(machines, environmentIds).flatMap(
+ ({ environmentId, label, candidates }) =>
+ candidates.map(async (candidate): Promise => ({
environmentId,
- input: { provider: candidate.driver, instanceId: candidate.instanceId },
- }),
- })),
+ machineLabel: label,
+ driver: candidate.driver,
+ instanceId: candidate.instanceId,
+ result: await updateProvider({
+ environmentId,
+ input: { provider: candidate.driver, instanceId: candidate.instanceId },
+ }),
+ })),
),
);
const view = quiet ? null : getProviderUpdateRunToastView(runs);
diff --git a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
index ce45fe8bf73a4..d7a998aa0e15f 100644
--- a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
+++ b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
@@ -42,7 +42,11 @@ import {
import { SidebarUpdateReleaseNotes } from "./SidebarUpdateReleaseNotes";
import { SidebarUpdateCapsule } from "./SidebarUpdateCapsule";
import { UpdateEverythingDialog } from "./UpdateEverythingDialog";
-import type { UpdateEverythingRun, UpdateRunLocalState } from "./updateEverything.logic";
+import type {
+ UpdateEverythingRun,
+ UpdateRunLocalState,
+ UpdateMachineSelection,
+} from "./updateEverything.logic";
import {
clearSavedUpdateEverythingResult,
saveUpdateEverythingResult,
@@ -370,12 +374,13 @@ function SidebarUpdateControl() {
void Promise.allSettled([appCheck, providersChecked]).then(() => setIsActionPending(false));
};
- const runEverything = async () => {
+ const runEverything = async (selection?: UpdateMachineSelection) => {
const bridge = window.desktopBridge;
setIsConfirmingEverything(false);
setIsActionPending(true);
const result = await settlePromise(() =>
everything.run({
+ ...(selection ? { selection } : {}),
...(bridge && action === "download"
? {
downloadLocal: (reportError) =>
@@ -429,7 +434,8 @@ function SidebarUpdateControl() {
rows={everything.rows}
restarts={everything.restarts}
checking={providerCheck === "dialog"}
- onConfirm={() => void runEverything()}
+ selectable
+ onConfirm={(selection) => void runEverything(selection)}
/>
);
diff --git a/apps/web/src/components/sidebar/UpdateEverythingDialog.browser.test.tsx b/apps/web/src/components/sidebar/UpdateEverythingDialog.browser.test.tsx
new file mode 100644
index 0000000000000..5ac5fefcbb6d9
--- /dev/null
+++ b/apps/web/src/components/sidebar/UpdateEverythingDialog.browser.test.tsx
@@ -0,0 +1,97 @@
+import { EnvironmentId } from "@t3tools/contracts";
+import { expect, it, vi } from "vite-plus/test";
+import { page, userEvent } from "vite-plus/test/browser";
+
+import "~/index.css";
+import { render } from "../../../test/render";
+import { describeUpdateEverything } from "./updateEverything.logic";
+import { UpdateEverythingDialog } from "./UpdateEverythingDialog";
+
+it("lets a remote user update the laptop without updating the PC host", async () => {
+ const pc = EnvironmentId.make("pc");
+ const laptop = EnvironmentId.make("laptop");
+ const onConfirm = vi.fn();
+ await using _screen = await render(
+ {}}
+ selectable
+ version="0.2.0"
+ providerCount={2}
+ rows={[
+ {
+ environmentId: pc,
+ label: "PC host",
+ app: "this-app",
+ providers: ["Codex"],
+ skipped: null,
+ },
+ {
+ environmentId: laptop,
+ label: "Laptop",
+ app: "desktop-app",
+ providers: ["Claude"],
+ skipped: null,
+ },
+ ]}
+ restarts={[]}
+ onConfirm={onConfirm}
+ />,
+ );
+ const selectAll = page.getByRole("checkbox", { name: "Select all machines" });
+ await expect.element(page.getByRole("heading", { name: "Update 2 machines?" })).toBeVisible();
+ await userEvent.click(selectAll);
+ await expect.element(page.getByRole("checkbox", { name: "Laptop" })).not.toBeChecked();
+ await expect.element(page.getByRole("button", { name: "Update", exact: true })).toBeDisabled();
+ await userEvent.click(selectAll);
+ await expect.element(page.getByRole("heading", { name: "Update 2 machines?" })).toBeVisible();
+ await userEvent.click(page.getByRole("checkbox", { name: "PC host" }));
+ await expect.element(selectAll).toHaveAttribute("aria-checked", "mixed");
+ await expect.element(page.getByRole("heading", { name: "Update 1 machine?" })).toBeVisible();
+ await expect.element(page.getByText(/1 provider update$/)).toBeVisible();
+ await userEvent.click(page.getByRole("checkbox", { name: "Laptop" }));
+ await expect.element(page.getByRole("button", { name: "Update", exact: true })).toBeDisabled();
+ await userEvent.click(page.getByRole("checkbox", { name: "Laptop" }));
+ await userEvent.click(page.getByRole("button", { name: "Update", exact: true }));
+ expect(onConfirm).toHaveBeenCalledWith({ environmentIds: [laptop], updateLocal: false });
+});
+it("keeps local provider exclusions when an app update arrives", async () => {
+ const pc = EnvironmentId.make("pc");
+ const laptop = EnvironmentId.make("laptop");
+ const onConfirm = vi.fn();
+ const dialog = (app: "this-app" | null) => (
+ {}}
+ selectable
+ checking
+ version={app === null ? null : "0.2.0"}
+ providerCount={2}
+ rows={
+ describeUpdateEverything({
+ localVersion: app === null ? null : "0.2.0",
+ localMachines: [{ environmentId: pc, label: "PC host" }],
+ servers: [],
+ providerMachines: [
+ { environmentId: pc, label: "PC host", providers: ["Codex"] },
+ { environmentId: laptop, label: "Laptop", providers: ["Claude"] },
+ ],
+ skipped: [],
+ }).rows
+ }
+ restarts={[]}
+ onConfirm={onConfirm}
+ />
+ );
+ await using screen = await render(dialog(null));
+ await userEvent.click(page.getByRole("checkbox", { name: "PC host" }));
+ await screen.rerender(dialog("this-app"));
+ await expect.element(page.getByRole("checkbox", { name: "PC host" })).not.toBeChecked();
+ await expect
+ .element(page.getByText(/1 provider update/))
+ .toHaveTextContent("1 provider update · Checking for more…");
+ await userEvent.click(page.getByRole("button", { name: "Update", exact: true }));
+ expect(onConfirm).toHaveBeenCalledWith({ environmentIds: [laptop], updateLocal: false });
+ await userEvent.click(page.getByRole("checkbox", { name: "Laptop" }));
+ await expect.element(page.getByText("Checking for more…", { exact: true })).toBeVisible();
+});
diff --git a/apps/web/src/components/sidebar/UpdateEverythingDialog.tsx b/apps/web/src/components/sidebar/UpdateEverythingDialog.tsx
index 048aa54ae620a..45abccd916614 100644
--- a/apps/web/src/components/sidebar/UpdateEverythingDialog.tsx
+++ b/apps/web/src/components/sidebar/UpdateEverythingDialog.tsx
@@ -3,7 +3,7 @@ import { EnvironmentId } from "@t3tools/contracts";
import { Atom } from "effect/reactivity";
import { ChevronRightIcon } from "lucide-react";
import { msg, T, useGT, useMessages } from "gt-react";
-import { Fragment, type RefObject, useRef } from "react";
+import { Fragment, type RefObject, useRef, useState } from "react";
import { environmentThreadShells } from "~/state/threads";
import {
@@ -15,11 +15,16 @@ import {
AlertDialogPopup,
AlertDialogTitle,
} from "../ui/alert-dialog";
+import { Checkbox } from "../ui/checkbox";
import { Button } from "../ui/button";
import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "../ui/collapsible";
import { MiddleTruncate } from "../ui/middle-truncate";
import { ScrollArea } from "../ui/scroll-area";
-import type { RestartingMachine, UpdateEverythingRow } from "./updateEverything.logic";
+import type {
+ RestartingMachine,
+ UpdateEverythingRow,
+ UpdateMachineSelection,
+} from "./updateEverything.logic";
const isRunning = (status: string) =>
status === "preparing" || status === "starting" || status === "running";
@@ -47,7 +52,8 @@ interface UpdateEverythingDialogProps {
readonly providerCount: number;
readonly rows: ReadonlyArray;
readonly restarts: ReadonlyArray;
- readonly onConfirm: () => void;
+ readonly onConfirm: (selection?: UpdateMachineSelection) => void;
+ readonly selectable?: boolean;
/** Overrides the "Update N machines?" title, for an update-track switch. */
readonly title?: string;
readonly confirmLabel?: string;
@@ -97,8 +103,9 @@ function UpdateEverythingDialogContent({
version,
providerCount,
rows,
- restarts,
+ restarts: allRestarts,
onConfirm,
+ selectable = false,
cancelRef,
title,
confirmLabel,
@@ -109,6 +116,21 @@ function UpdateEverythingDialogContent({
}: UpdateEverythingDialogContentProps) {
const gt = useGT();
const m = useMessages();
+ const [excluded, setExcluded] = useState>(() => new Set());
+ const rowKey = (row: UpdateEverythingRow) =>
+ row.hostedByThisApp || row.app === "this-app" ? "this-app" : (row.environmentId ?? "this-app");
+ const updating = rows.filter((row) => row.app !== null || row.providers.length > 0);
+ const selected = updating.filter((row) => !selectable || !excluded.has(rowKey(row)));
+ const selectedIds = new Set(
+ selected.flatMap((row) => (row.environmentId === null ? [] : [row.environmentId])),
+ );
+ const restarts = allRestarts.filter(
+ (machine) => !selectable || selectedIds.has(machine.environmentId),
+ );
+ const selectedProviderCount = selectable
+ ? selected.reduce((count, row) => count + row.providers.length, 0)
+ : providerCount;
+ const selectedVersion = !selectable || selected.some((row) => row.app !== null) ? version : null;
const stopped = useAtomValue(
runningThreadCountAtom(
restarts
@@ -127,7 +149,6 @@ function UpdateEverythingDialogContent({
);
const running = stopped + continuing;
const restarting = new Set(restarts.map((machine) => machine.environmentId));
- const updating = rows.filter((row) => row.app !== null || row.providers.length > 0);
const skipped = rows.filter((row) => row.skipped !== null);
return (
@@ -136,24 +157,24 @@ function UpdateEverythingDialogContent({
{title ??
gt("{count, plural, one {Update {count} machine?} other {Update {count} machines?}}", {
- count: updating.length,
+ count: selected.length,
})}
- {version !== null ? (
+ {selectedVersion !== null ? (
<>
- T3 Code {version}
+ T3 Code {selectedVersion}
>
) : null}
- {version !== null && providerCount > 0 ? " · " : null}
- {providerCount > 0
+ {selectedVersion !== null && selectedProviderCount > 0 ? " · " : null}
+ {selectedProviderCount > 0
? gt(
"{count, plural, one {{count} provider update} other {{count} provider updates}}",
- { count: providerCount },
+ { count: selectedProviderCount },
)
: null}
{checking
- ? `${version !== null || providerCount > 0 ? " · " : ""}${gt("Checking for more…")}`
+ ? `${selectedVersion !== null || selectedProviderCount > 0 ? " · " : ""}${gt("Checking for more…")}`
: null}
@@ -164,6 +185,14 @@ function UpdateEverythingDialogContent({
{note}
))}
+ {selectable ? (
+
+
+ Choose which machines to update. Only selected machines will be updated or
+ restarted.
+
+
+ ) : null}
{/* Machine names truncate first. Provider lists wrap between names, never inside one. */}
-
+
+
T3 Code
Providers
@@ -188,10 +228,24 @@ function UpdateEverythingDialogContent({
role="row"
className="col-span-full grid grid-cols-subgrid border-b border-border/50 py-1.5 last:border-b-0"
>
-
+
+
{row.app !== null ? m(APP_LABELS[row.app]) : null}
{row.app === null && row.skipped !== null ? (
@@ -274,7 +328,19 @@ function UpdateEverythingDialogContent({
}>
Cancel
-