Skip to content

Commit 446b919

Browse files
t3dotggclaude
andcommitted
fix(web): show every backend this app hosts in the update dialog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 75acb2c commit 446b919

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎apps/web/src/components/sidebar/updateEverything.logic.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ describe("describeUpdateEverything", () => {
149149
const id = EnvironmentId.make;
150150
const { rows } = describeUpdateEverything({
151151
localVersion: "1.1.0",
152-
localMachine: { environmentId: id("local"), label: "Mainbook" },
152+
localMachines: [
153+
{ environmentId: id("local"), label: "Mainbook" },
154+
{ environmentId: id("wsl"), label: "Mainbook WSL" },
155+
],
153156
servers: [
154157
{
155158
environmentId: id("npm"),
@@ -173,6 +176,7 @@ describe("describeUpdateEverything", () => {
173176
rows.map(({ label, app, skipped, providers }) => [label, app, skipped, providers]),
174177
).toEqual([
175178
["Mainbook", "this-app", null, ["Codex"]],
179+
["Mainbook WSL", "this-app", null, []],
176180
["bb-1", "server", null, ["Codex", "Claude"]],
177181
["alvin", null, "needs a manual update", ["Claude"]],
178182
["TheoRoom", null, "not connected", []],

‎apps/web/src/components/sidebar/updateEverything.logic.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@ export function getUpdateEverythingToastView(
356356

357357
export interface UpdateEverythingPlan {
358358
readonly localVersion: string | null;
359-
/** The machine whose server this app hosts; this app's update restarts it. */
360-
readonly localMachine: {
359+
/** Machines whose servers this app hosts; this app's update restarts them. */
360+
readonly localMachines: ReadonlyArray<{
361361
readonly environmentId: EnvironmentId;
362362
readonly label: string;
363-
} | null;
363+
}>;
364364
readonly servers: ReadonlyArray<
365365
Pick<ServerUpdateTarget, "environmentId" | "serverLabel" | "selfUpdate" | "targetVersion">
366366
>;
@@ -389,7 +389,7 @@ function joinList(parts: ReadonlyArray<string>): string {
389389
return `${parts.slice(0, -1).join(", ")}, and ${parts.at(-1)}`;
390390
}
391391

392-
/** One row per machine: this app's machine first, then servers, provider-only, and skipped. */
392+
/** One row per machine: this app's machines first, then servers, provider-only, and skipped. */
393393
export function describeUpdateEverything(plan: UpdateEverythingPlan): {
394394
readonly summary: string;
395395
readonly version: string | null;
@@ -424,9 +424,10 @@ export function describeUpdateEverything(plan: UpdateEverythingPlan): {
424424
rows.set(environmentId, { ...row, ...change });
425425
};
426426
if (plan.localVersion) {
427-
update(plan.localMachine?.environmentId ?? null, plan.localMachine?.label ?? "This app", {
428-
app: "this-app",
429-
});
427+
if (plan.localMachines.length === 0) update(null, "This app", { app: "this-app" });
428+
for (const machine of plan.localMachines) {
429+
update(machine.environmentId, machine.label, { app: "this-app" });
430+
}
430431
}
431432
for (const server of plan.servers) {
432433
update(server.environmentId, server.serverLabel, {

‎apps/web/src/components/sidebar/useUpdateEverything.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ export function useUpdateEverything(localUpdateVersion: string | null) {
7878
const providers = useProviderUpdates();
7979
const updateServer = useServerUpdate();
8080

81-
const localMachine = machines.find((machine) => machine.hostedByThisApp) ?? null;
8281
const view = describeUpdateEverything({
8382
localVersion: localUpdateVersion,
84-
localMachine,
83+
localMachines: machines.filter((machine) => machine.hostedByThisApp),
8584
servers,
8685
skipped,
8786
providerMachines: providers.machines.map((machine) => ({

0 commit comments

Comments
 (0)