Skip to content

Commit a9dbea7

Browse files
committed
fix(web): name the installs T3 cannot update beside a one-click update
1 parent 79e18d4 commit a9dbea7

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

‎apps/web/src/components/ProviderUpdateLaunchNotification.logic.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,15 @@ describe("provider update launch notification logic", () => {
321321
).toBe(
322322
"Cursor can be updated from provider settings. Update Codex with the app or tool that installed it.",
323323
);
324+
const oneClick = updateCandidate({ driver: driver("claudeAgent") });
325+
expect(
326+
getProviderUpdateInitialToastView({
327+
updateProviders: [oneClick, updateCandidate({ driver: driver("codex"), ...manual })],
328+
oneClickProviders: [oneClick],
329+
}).description,
330+
).toBe(
331+
"Install the update now or review provider settings. Update Codex with the app or tool that installed it.",
332+
);
324333
});
325334

326335
it("uses server update state for running progress", () => {

‎apps/web/src/components/ProviderUpdateLaunchNotification.logic.ts‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,24 @@ function formatProviderList(providers: ReadonlyArray<Pick<ServerProvider, "drive
235235
}
236236

237237
/**
238-
* Provider settings has an Update button only for installs the server can
239-
* update. The rest are updated by the app or tool that installed them.
238+
* Install and provider settings reach only installs the server can update.
239+
* The rest are updated by the app or tool that installed them, so they get
240+
* their own sentence whatever else the notice offers.
240241
*/
241-
function describeUpdatesWithoutOneClick(providers: ReadonlyArray<ProviderUpdateCandidate>): string {
242-
const fromSettings = providers.filter((provider) => provider.versionAdvisory.canUpdate);
243-
const manual = providers.filter((provider) => !provider.versionAdvisory.canUpdate);
242+
function describeInitialUpdates(input: {
243+
readonly updateProviders: ReadonlyArray<ProviderUpdateCandidate>;
244+
readonly oneClickProviders: ReadonlyArray<ProviderUpdateCandidate>;
245+
}): string {
246+
const fromSettings = input.updateProviders.filter(
247+
(provider) => provider.versionAdvisory.canUpdate,
248+
);
249+
const manual = input.updateProviders.filter((provider) => !provider.versionAdvisory.canUpdate);
244250
return [
245-
fromSettings.length > 0
246-
? `${formatProviderList(fromSettings)} can be updated from provider settings.`
247-
: null,
251+
input.oneClickProviders.length > 0
252+
? "Install the update now or review provider settings."
253+
: fromSettings.length > 0
254+
? `${formatProviderList(fromSettings)} can be updated from provider settings.`
255+
: null,
248256
manual.length > 0
249257
? `Update ${formatProviderList(manual)} with the app or tool that installed ${manual.length === 1 ? "it" : "them"}.`
250258
: null,
@@ -261,10 +269,7 @@ export function getProviderUpdateInitialToastView(input: {
261269
phase: "initial",
262270
type: "warning",
263271
title: getProviderUpdateInitialToastTitle(input.updateProviders),
264-
description:
265-
input.oneClickProviders.length > 0
266-
? "Install the update now or review provider settings."
267-
: describeUpdatesWithoutOneClick(input.updateProviders),
272+
description: describeInitialUpdates(input),
268273
};
269274
}
270275

0 commit comments

Comments
 (0)