:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(desktop): show manual update results when notifications are off (#103260)
Dylan Martin754066475aa1
diff --git a/products/desktop/apps/code/src/renderer/platform-adapters/updates.ts b/products/desktop/apps/code/src/renderer/platform-adapters/updates.tsindex 594fa1fd4bdb..68fb332b2ffb 100644--- a/products/desktop/apps/code/src/renderer/platform-adapters/updates.ts+++ b/products/desktop/apps/code/src/renderer/platform-adapters/updates.ts@@ -24,7 +24,7 @@ const store = updateStore.getState;function showToast(menuToast: MenuCheckToast): void {if (menuToast.kind === "success") {- toast.success(menuToast.message);+ toast.success(menuToast.message, { alwaysShow: true });return;}toast.error(diff --git a/products/desktop/docs/UPDATES.md b/products/desktop/docs/UPDATES.mdindex edd2e9d08c33..0a811df58bc3 100644--- a/products/desktop/docs/UPDATES.md+++ b/products/desktop/docs/UPDATES.md@@ -34,6 +34,7 @@ Remote announcements can drive this flow: a `required-update` announcement block- The title bar shows a compact chip for the same states while the sidebar is collapsed, peeked away or absent, so only one copy is on screen at a time.- Both surfaces open the update modal, which shows the release notes and holds the Download and Restart actions. The sidebar card also has its own Restart button for a staged update.- "Check for Updates..." in the app menu runs a check. It shows a toast when the app is up to date or the check fails, and opens the update modal when the check finds an available, downloading or staged update.+- Manual update results remain visible when toast notifications are disabled, including in Command Center. Background notifications still follow that setting.- The modal is mounted in the app shell above the router, so it also opens from the sign-in, access and consent screens.## How it worksdiff --git a/products/desktop/packages/ui/src/primitives/toast.test.ts b/products/desktop/packages/ui/src/primitives/toast.test.tsindex 239593a60109..1acca4ebd762 100644--- a/products/desktop/packages/ui/src/primitives/toast.test.ts+++ b/products/desktop/packages/ui/src/primitives/toast.test.ts@@ -96,12 +96,16 @@ describe("toast wrapper", () => {);});- it.each(["success", "info", "warning", "loading"] as const)(- "suppresses %s when toast notifications are disabled",- (level) => {+ it.each(+ (["success", "info", "warning", "loading"] as const).flatMap((level) =>+ [false, true].map((alwaysShow) => ({ level, alwaysShow })),+ ),+ )(+ "$level respects alwaysShow=$alwaysShow when toast notifications are disabled",+ ({ level, alwaysShow }) => {settings.toastNotifications = false;- toast[level]("Title");- expect(quill[level]).not.toHaveBeenCalled();+ toast[level]("Title", { alwaysShow });+ expect(quill[level]).toHaveBeenCalledTimes(alwaysShow ? 1 : 0);},);diff --git a/products/desktop/packages/ui/src/primitives/toast.tsx b/products/desktop/packages/ui/src/primitives/toast.tsxindex 1aaadb592b75..30bfef84cf57 100644--- a/products/desktop/packages/ui/src/primitives/toast.tsx+++ b/products/desktop/packages/ui/src/primitives/toast.tsx@@ -14,6 +14,7 @@ export interface ToastAction {export interface ToastOptions {description?: string;+ alwaysShow?: boolean;// A caller-chosen stable id: upserts (creates or replaces) the toast with// that id so it never stacks. quill itself can't// pick an id at create time, so the wrapper maps it (see idRegistry).@@ -51,9 +52,11 @@ function emit(defaultTimeout?: number,): string | undefined {const o = normalize(detail);- // Toasts can be disabled in settings; errors always show since they carry- // information the user needs regardless of that preference.- if (level !== "error" && !useSettingsStore.getState().toastNotifications) {+ if (+ level !== "error" &&+ !o.alwaysShow &&+ !useSettingsStore.getState().toastNotifications+ ) {return o.id;}// base-ui auto-dismisses any non-loading toast with `timeout > 0`; it has no