Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(settings): always show the Notifications tab on every platform (#7953)

Eric Hayesa7dc226d6a6a
diff --git a/apps/web/src/features/settings/Account.tsx b/apps/web/src/features/settings/Account.tsx
index 8a0d7389b6..81eed1b0c4 100644
--- a/apps/web/src/features/settings/Account.tsx
+++ b/apps/web/src/features/settings/Account.tsx
@@ -12,7 +12,6 @@ import {
disableAutoUpdateUi,
ENABLE_PROFILE_PICTURES,
enableAutoUpdateUiOverride,
- enableNotificationSettings,
} from '@core/constant/featureFlags';
import { staticFileIdEndpoint } from '@core/constant/servers';
import { useEmail, useUserId } from '@core/context/user';
@@ -29,10 +28,6 @@ import {
nativeUpdateDescription,
useTauri,
} from '@macro/tauri';
-import {
- type SupportedNotificationSettings,
- useNotificationSettings,
-} from '@notifications';
import CheckIcon from '@phosphor/check.svg';
import PencilIcon from '@phosphor/pencil-simple.svg';
import SpinnerIcon from '@phosphor/spinner-gap.svg';
@@ -46,7 +41,7 @@ import {
} from '@queries/auth/user-name-self';
import { authServiceClient } from '@service-auth/client';
import { invoke } from '@tauri-apps/api/core';
-import { Button, Dialog, Dropdown, Panel, ToggleSwitch, Tooltip } from '@ui';
+import { Button, Dialog, Dropdown, Panel, Tooltip } from '@ui';
import {
createEffect,
createMemo,
@@ -323,7 +318,6 @@ export function Account() {
const autoUpdateUIEnabled = createMemo(
() => enableAutoUpdateUiOverride ?? !disableAutoUpdateUIFlag().enabled
);
- const notificationSettingsFlag = useFeatureFlag(enableNotificationSettings);
const [showDeleteModal, setShowDeleteModal] = createSignal<boolean>(false);
const [showDeleteConfirmModal, setShowDeleteConfirmModal] =
createSignal<boolean>(false);
@@ -459,10 +453,6 @@ export function Account() {
<BundleVersionRow />
<BundleUpdateRow />
</Show>
-
- <Show when={!notificationSettingsFlag().enabled}>
- <NotificationToggle />
- </Show>
</SettingsCard>
</SettingsSection>
@@ -653,48 +643,6 @@ function Row(props: { label: string; children?: JSX.Element }) {
return <SettingsRow label={props.label}>{props.children}</SettingsRow>;
}
-function NotificationToggle() {
- const settings = useNotificationSettings();
-
- return (
- <Show
- when={settings.isSupported && settings}
- fallback={<NotificationNotSupported />}
- >
- {(s) => <NotificationSettings settings={s()} />}
- </Show>
- );
-}
-
-function NotificationSettings(props: {
- settings: SupportedNotificationSettings;
-}) {
- const analytics = useAnalytics();
-
- const handleToggle = (checked: boolean) => {
- analytics.track('notifications_toggled');
- props.settings.toggle(checked);
- };
-
- return (
- <Row label="Notifications">
- <ToggleSwitch
- size="md"
- checked={props.settings.isEnabled()}
- onChange={handleToggle}
- />
- </Row>
- );
-}
-
-function NotificationNotSupported() {
- return (
- <Row label="Notifications">
- <span class="text-sm text-ink-muted">Not supported on this device</span>
- </Row>
- );
-}
-
type SaveStatus = 'idle' | 'saving' | 'saved' | 'error';
function NameInput(props: {
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index 43d98bb384..9eb1c88651 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -780,16 +780,6 @@ export const enableRecentView = defineFlag({
default: onInDev,
});
-// Settings › Notifications: the dedicated preferences tab (delivery, per-type
-// opt-outs, muted items). When off, the tab is hidden and Account keeps the
-// existing desktop/mobile toggle. PostHog-gated with a dev-mode default;
-// override with VITE_ENABLE_NOTIFICATION_SETTINGS.
-export const enableNotificationSettings = defineFlag({
- key: 'enable-notification-settings',
- env: 'ENABLE_NOTIFICATION_SETTINGS',
- default: onInDev,
-});
-
/**
* The in-browser PowerPoint editor (`block-pptx`). Off shows uploaded
* `.pptx` files as before: download only. On in dev; deployed environments
diff --git a/apps/web/src/lib/core/constant/settingsTabsAvailability.test.ts b/apps/web/src/lib/core/constant/settingsTabsAvailability.test.ts
index 74d8c03594..d8922b0f64 100644
--- a/apps/web/src/lib/core/constant/settingsTabsAvailability.test.ts
+++ b/apps/web/src/lib/core/constant/settingsTabsAvailability.test.ts
@@ -53,3 +53,27 @@ describe('Desktop App settings rollout', () => {
}
);
});
+
+describe('Notifications settings', () => {
+ // The page used to sit behind a remote flag, so the desktop app and the
+ // browser could disagree on where the notification switch lived.
+ it.each(['web', 'desktop', 'ios', 'android'])(
+ 'is a standing Personal tab on %s with every remote flag off',
+ (host) => {
+ platform.current = host;
+ const tabs = createRoot((cleanup) => {
+ dispose = cleanup;
+ flagEnabled = () => false;
+ return useSettingsTabs();
+ });
+
+ expect(tabs.isAvailable('Notifications')).toBe(true);
+ const personal = tabs
+ .groups()
+ .find((group) => group.label === 'Personal');
+ expect(personal?.items.map((item) => item.tab)).toContain(
+ 'Notifications'
+ );
+ }
+ );
+});
diff --git a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
index 6ed92ebe08..90376edef5 100644
--- a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
+++ b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
@@ -36,7 +36,6 @@ import {
enableCalendarScheduling,
enableChatV3Agents,
enableCrm,
- enableNotificationSettings,
} from './featureFlags';
import { PERMISSION_IDS } from './permissions';
import type { SettingsTab } from './SettingsState';
@@ -291,13 +290,13 @@ export const useSettingsTabAvailable = () => {
const chatV3AgentsFlag = useFeatureFlag(enableChatV3Agents);
const crmFlag = useFeatureFlag(enableCrm);
const desktopAppFlag = useFeatureFlag(desktopApp);
- const notificationSettingsFlag = useFeatureFlag(enableNotificationSettings);
const hasAdminPanel = useHasPermission(PERMISSION_IDS.WRITE_ADMIN_PANEL);
return (tab: SettingsTab): boolean => {
switch (tab) {
case 'Appearance':
case 'Account':
+ case 'Notifications':
case 'Usage':
case 'Billing':
return true;
@@ -310,8 +309,6 @@ export const useSettingsTabAvailable = () => {
// good place for a one-time secret.
case 'API Keys':
return !isMobile();
- case 'Notifications':
- return notificationSettingsFlag().enabled;
case 'Team':
case 'Tags':
return true;
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index 9eda59539b..9643554226 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -2669,9 +2669,9 @@ session were not exercised by that UI check.
## Notifications
In the desktop app, **Settings → Notifications → Delivery → Desktop notifications**
-controls system notification delivery for this installation. When the Notifications
-page is disabled by its feature flag, the existing **Account → Notifications**
-switch controls the same preference.
+controls system notification delivery for this installation. The Notifications
+page is always present, in the same place on web, desktop, and mobile; Account
+has no notification switch.
Turning it off takes effect immediately and persists across app restarts; turning
it on requests permission and resumes delivery when authorized. On macOS the
switch reads the actual system authorization, and enabling it requests macOS