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.

feat(settings): show the OTA bundle date in app settings (#9030)

Eric Hayes78958681c3dd
diff --git a/apps/web/src/components/app/sidebar-next/footer-actions.tsx b/apps/web/src/components/app/sidebar-next/footer-actions.tsx
index f16de76db9..ba5f7c1f34 100644
--- a/apps/web/src/components/app/sidebar-next/footer-actions.tsx
+++ b/apps/web/src/components/app/sidebar-next/footer-actions.tsx
@@ -7,6 +7,7 @@ import { useSettingsState } from '@core/constant/SettingsState';
import { useSettingsTabAvailable } from '@core/constant/settingsTabsConfig';
import { useEmail, useUserId } from '@core/context/user';
import { TOKENS } from '@core/hotkey/tokens';
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
import DeviceMobileDownloadIcon from '@icon/device-mobile-download.svg';
import GearFillIcon from '@icon/system/fill/gear-fill.svg';
import GearIcon from '@icon/system/regular/gear.svg';
@@ -36,8 +37,8 @@ const isSettingsActive = () => {
/**
* Get the mobile app: opens the Mobile App settings page, which carries the
- * App Store QR code. Hidden wherever that page is unavailable, e.g. inside
- * the native app.
+ * App Store QR code. Hidden inside the native app, where that page shows the
+ * installed app's version instead, and wherever the page is unavailable.
*/
const MobileAppButton = () => {
const analytics = useAnalytics();
@@ -54,7 +55,7 @@ const MobileAppButton = () => {
};
return (
- <Show when={isTabAvailable('Mobile App')}>
+ <Show when={!isNativeMobilePlatform() && isTabAvailable('Mobile App')}>
<Button
variant="ghost"
size="icon-md"
diff --git a/apps/web/src/features/settings/Account.tsx b/apps/web/src/features/settings/Account.tsx
index d91ba2875b..ef0f6bd1b7 100644
--- a/apps/web/src/features/settings/Account.tsx
+++ b/apps/web/src/features/settings/Account.tsx
@@ -66,6 +66,7 @@ import {
buildAccountDeletionFeedbackPayload,
performAccountDeletion,
} from './account-deletion-feedback';
+import { getBundleDebugInfo } from './app-build';
import { CurrentPlanCard } from './components/current-plan-card';
import { resolvePlanTier } from './core/billing-state';
import {
@@ -850,20 +851,9 @@ function bundleUpdateAction(
}
}
-type BundleDebugInfo = {
- bundleBuild: number;
- source: 'embedded' | 'ota';
- nativeBuild: number;
-};
-
function BundleVersionRow() {
if (!isNativeMobilePlatform()) return null;
- const [bundleDebugInfo] = createResource(() =>
- invoke<BundleDebugInfo>('get_bundle_debug_info').catch((error) => {
- console.error('[bundle-update] get_bundle_debug_info failed', error);
- return null;
- })
- );
+ const [bundleDebugInfo] = createResource(getBundleDebugInfo);
return (
<Show when={bundleDebugInfo()}>
diff --git a/apps/web/src/features/settings/DesktopApp.tsx b/apps/web/src/features/settings/DesktopApp.tsx
index 0f33cdc5a0..faed6343ca 100644
--- a/apps/web/src/features/settings/DesktopApp.tsx
+++ b/apps/web/src/features/settings/DesktopApp.tsx
@@ -1,29 +1,14 @@
import { isPlatform } from '@core/util/platform';
-import { getVersion } from '@tauri-apps/api/app';
-import { createResource } from 'solid-js';
-import { DesktopAppDownload, DesktopAppInfo } from './components/desktop-app';
+import { DesktopAppDownload } from './components/desktop-app';
+import { NativeAppInfo } from './NativeAppInfo';
/** Native APIs are only read when mounted inside the desktop app. */
export function DesktopApp() {
if (!isPlatform('desktop')) return <DesktopAppDownload />;
-
- const [version] = createResource(async () => {
- try {
- return await getVersion();
- } catch {
- return 'Not available';
- }
- });
- const buildTime = import.meta.env.__APP_BUILD_TIME__;
- const buildDate =
- buildTime && Number.isFinite(buildTime) && buildTime > 0
- ? new Date(buildTime)
- : undefined;
-
return (
- <DesktopAppInfo
- version={version.loading ? 'Loading…' : (version() ?? 'Not available')}
- buildDate={buildDate}
+ <NativeAppInfo
+ title="Desktop App (Alpha)"
+ description="Your installed version of Macro Alpha."
/>
);
}
diff --git a/apps/web/src/features/settings/MobileApp.tsx b/apps/web/src/features/settings/MobileApp.tsx
index abefcf6034..398fc2e393 100644
--- a/apps/web/src/features/settings/MobileApp.tsx
+++ b/apps/web/src/features/settings/MobileApp.tsx
@@ -1,13 +1,24 @@
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
import { useCopyLink } from '@core/util/useCopyLink';
import AppStoreQr from '@design/app-store.svg';
import ArrowUpRightIcon from '@icon/system/regular/arrow-up-right.svg';
import LinkIcon from '@icon/system/regular/link.svg';
import { CopyButton } from '@ui';
+import { NativeAppInfo } from './NativeAppInfo';
import { SettingsCard, SettingsPage } from './primitives';
const APP_STORE_URL = 'https://apps.apple.com/us/app/macro-app/id6743133649';
+/** Native APIs are only read when mounted inside the mobile app. */
export function MobileApp() {
+ if (isNativeMobilePlatform()) {
+ return (
+ <NativeAppInfo
+ title="Mobile app"
+ description="Your installed version of Macro."
+ />
+ );
+ }
const copy = useCopyLink();
return (
diff --git a/apps/web/src/features/settings/NativeAppInfo.tsx b/apps/web/src/features/settings/NativeAppInfo.tsx
new file mode 100644
index 0000000000..5c502c2d12
--- /dev/null
+++ b/apps/web/src/features/settings/NativeAppInfo.tsx
@@ -0,0 +1,26 @@
+import { getVersion } from '@tauri-apps/api/app';
+import { createResource } from 'solid-js';
+import { appBuildDate, getBundleDebugInfo, otaBundleDate } from './app-build';
+import { AppInfo } from './components/app-info';
+
+/** Mount only inside the native app; reads version and bundle info over IPC. */
+export function NativeAppInfo(props: { title: string; description: string }) {
+ const [version] = createResource(async () => {
+ try {
+ return await getVersion();
+ } catch {
+ return 'Not available';
+ }
+ });
+ const [bundleInfo] = createResource(getBundleDebugInfo);
+
+ return (
+ <AppInfo
+ title={props.title}
+ description={props.description}
+ version={version.loading ? 'Loading…' : (version() ?? 'Not available')}
+ buildDate={appBuildDate()}
+ bundleDate={otaBundleDate(bundleInfo())}
+ />
+ );
+}
diff --git a/apps/web/src/features/settings/app-build.test.ts b/apps/web/src/features/settings/app-build.test.ts
new file mode 100644
index 0000000000..a0cdde24dd
--- /dev/null
+++ b/apps/web/src/features/settings/app-build.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it } from 'vitest';
+import { otaBundleDate } from './app-build';
+
+describe('otaBundleDate', () => {
+ it('dates an active OTA bundle from its build timestamp', () => {
+ const built = Date.UTC(2026, 9, 27, 9, 15);
+ expect(
+ otaBundleDate({ bundleBuild: built, source: 'ota', nativeBuild: 42 })
+ ).toEqual(new Date(built));
+ });
+
+ it('has no date while the embedded bundle runs', () => {
+ expect(
+ otaBundleDate({
+ bundleBuild: Date.UTC(2026, 9, 1),
+ source: 'embedded',
+ nativeBuild: 42,
+ })
+ ).toBeUndefined();
+ });
+
+ it('ignores bundle builds that are counters, not timestamps', () => {
+ expect(
+ otaBundleDate({ bundleBuild: 100, source: 'ota', nativeBuild: 42 })
+ ).toBeUndefined();
+ });
+
+ it('has no date when bundle info is unavailable', () => {
+ expect(otaBundleDate(null)).toBeUndefined();
+ });
+});
diff --git a/apps/web/src/features/settings/app-build.ts b/apps/web/src/features/settings/app-build.ts
new file mode 100644
index 0000000000..c3600462a0
--- /dev/null
+++ b/apps/web/src/features/settings/app-build.ts
@@ -0,0 +1,38 @@
+import { invoke } from '@tauri-apps/api/core';
+
+export type BundleDebugInfo = {
+ bundleBuild: number;
+ source: 'embedded' | 'ota';
+ nativeBuild: number;
+};
+
+// Release bundle builds are millisecond timestamps; local smoke builds use
+// small counters (e.g. 100) that are not dates.
+const MIN_TIMESTAMP_MS = Date.UTC(2020, 0, 1);
+
+function timestampDate(ms: number | undefined): Date | undefined {
+ return ms && Number.isFinite(ms) && ms >= MIN_TIMESTAMP_MS
+ ? new Date(ms)
+ : undefined;
+}
+
+/** When the running JavaScript was built. */
+export function appBuildDate(): Date | undefined {
+ return timestampDate(import.meta.env.__APP_BUILD_TIME__);
+}
+
+/** When the active OTA bundle was built; undefined while the embedded bundle runs. */
+export function otaBundleDate(
+ info: BundleDebugInfo | null | undefined
+): Date | undefined {
+ return info?.source === 'ota' ? timestampDate(info.bundleBuild) : undefined;
+}
+
+export async function getBundleDebugInfo(): Promise<BundleDebugInfo | null> {
+ try {
+ return await invoke<BundleDebugInfo>('get_bundle_debug_info');
+ } catch (error) {
+ console.error('[bundle-update] get_bundle_debug_info failed', error);
+ return null;
+ }
+}
diff --git a/apps/web/src/features/settings/browser-test/fixture.tsx b/apps/web/src/features/settings/browser-test/fixture.tsx
index afb2116dcf..c7852f22f1 100644
--- a/apps/web/src/features/settings/browser-test/fixture.tsx
+++ b/apps/web/src/features/settings/browser-test/fixture.tsx
@@ -14,7 +14,7 @@ import { macroDarkTheme } from '../../theme/themes/macro-dark';
import { macroLightTheme } from '../../theme/themes/macro-light';
import { themeCssVars } from '../../theme/utils/themeColorTokens';
import { Appearance } from '../Appearance';
-import { DesktopAppInfo } from '../components/desktop-app';
+import { AppInfo } from '../components/app-info';
import { SettingsSearchTarget } from '../components/settings-search-target';
import { SettingsSidebar } from '../components/settings-sidebar';
import { SignatureForm } from '../components/signature-form';
@@ -149,9 +149,12 @@ function Fixture() {
when={page !== 'Desktop App'}
fallback={
<Show when={desktop()} fallback={<DesktopApp />}>
- <DesktopAppInfo
+ <AppInfo
+ title="Desktop App (Alpha)"
+ description="Your installed version of Macro Alpha."
version="2.5.0"
buildDate={new Date('2026-10-01T16:30:00Z')}
+ bundleDate={new Date('2026-10-27T09:15:00Z')}
/>
</Show>
}
diff --git a/apps/web/src/features/settings/components/app-info.tsx b/apps/web/src/features/settings/components/app-info.tsx
new file mode 100644
index 0000000000..068bca2633
--- /dev/null
+++ b/apps/web/src/features/settings/components/app-info.tsx
@@ -0,0 +1,44 @@
+import { Show } from 'solid-js';
+import { SettingsCard, SettingsPage, SettingsRow } from '../primitives';
+
+function DateValue(props: { date?: Date; fallback: string }) {
+ return (
+ <span class="text-sm text-ink-muted">
+ <Show when={props.date} fallback={props.fallback}>
+ {(date) => (
+ <time datetime={date().toISOString()}>
+ {date().toLocaleString(undefined, {
+ dateStyle: 'medium',
+ timeStyle: 'short',
+ })}
+ </time>
+ )}
+ </Show>
+ </span>
+ );
+}
+
+/** Installed native app details: version, build, and the active OTA bundle. */
+export function AppInfo(props: {
+ title: string;
+ description: string;
+ version: string;
+ buildDate?: Date;
+ bundleDate?: Date;
+}) {
+ return (
+ <SettingsPage title={props.title} description={props.description}>
+ <SettingsCard>
+ <SettingsRow label="Version">
+ <span class="text-sm text-ink-muted">{props.version}</span>
+ </SettingsRow>
+ <SettingsRow label="Build date" stackOnNarrow>
+ <DateValue date={props.buildDate} fallback="Not available" />
+ </SettingsRow>
+ <SettingsRow label="Bundle date" stackOnNarrow>
+ <DateValue date={props.bundleDate} fallback="No OTA update" />
+ </SettingsRow>
+ </SettingsCard>
+ </SettingsPage>
+ );
+}
diff --git a/apps/web/src/features/settings/components/desktop-app.tsx b/apps/web/src/features/settings/components/desktop-app.tsx
index 68888c9879..6942834a97 100644
--- a/apps/web/src/features/settings/components/desktop-app.tsx
+++ b/apps/web/src/features/settings/components/desktop-app.tsx
@@ -1,5 +1,4 @@
import { buttonClasses } from '@ui';
-import { Show } from 'solid-js';
import { SettingsCard, SettingsPage, SettingsRow } from '../primitives';
export function DesktopAppDownload() {
@@ -27,32 +26,3 @@ export function DesktopAppDownload() {
</SettingsPage>
);
}
-
-export function DesktopAppInfo(props: { version: string; buildDate?: Date }) {
- return (
- <SettingsPage
- title="Desktop App (Alpha)"
- description="Your installed version of Macro Alpha."
- >
- <SettingsCard>
- <SettingsRow label="Version">
- <span class="text-sm text-ink-muted">{props.version}</span>
- </SettingsRow>
- <SettingsRow label="Build date" stackOnNarrow>
- <span class="text-sm text-ink-muted">
- <Show when={props.buildDate} fallback="Not available">
- {(date) => (
- <time datetime={date().toISOString()}>
- {date().toLocaleString(undefined, {
- dateStyle: 'medium',
- timeStyle: 'short',
- })}
- </time>
- )}
- </Show>
- </span>
- </SettingsRow>
- </SettingsCard>
- </SettingsPage>
- );
-}
diff --git a/apps/web/src/features/settings/core/settings-search.ts b/apps/web/src/features/settings/core/settings-search.ts
index b5944682a3..0a76dd140e 100644
--- a/apps/web/src/features/settings/core/settings-search.ts
+++ b/apps/web/src/features/settings/core/settings-search.ts
@@ -276,8 +276,8 @@ const SETTINGS: Setting[] = [
},
{
tab: 'Mobile App',
- title: 'Get the mobile app',
- keywords: 'download phone ios android qr code',
+ title: 'Mobile app version and download',
+ keywords: 'download phone ios android qr code version build bundle',
},
];
diff --git a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
index 28a6d49c04..9ac57e45ad 100644
--- a/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
+++ b/apps/web/src/lib/core/constant/settingsTabsConfig.tsx
@@ -382,7 +382,7 @@ export const useSettingsTabAvailable = () => {
case 'Shortcuts':
return !isTouchDevice();
case 'Mobile App':
- return ENABLE_APP_STORE_QR_CODE && !isNativeMobilePlatform();
+ return isNativeMobilePlatform() || ENABLE_APP_STORE_QR_CODE;
case 'Desktop App':
return (
isPlatform('desktop') ||
diff --git a/docs/agent-guide/settings.md b/docs/agent-guide/settings.md
index 80a307c9c5..1976e8a3a3 100644
--- a/docs/agent-guide/settings.md
+++ b/docs/agent-guide/settings.md
@@ -282,14 +282,18 @@ Left nav (feature and platform gates still apply):
- **Developer**: Runtimes, MCP server, API Keys, Bots.
**Desktop App** (`/app/settings/desktop-app`) is titled
-**Desktop App (Alpha)** and shows a compact version and build-date card in the
-desktop app. The date is when the running app bundle was built, not when it was
-installed on the computer. In the browser it links to the latest desktop release
+**Desktop App (Alpha)** and shows a compact Version, Build date, and Bundle
+date card in the desktop app. Build date is when the running JavaScript was
+built, not when it was installed on the computer. Bundle date is when the active
+OTA bundle was built (from `get_bundle_debug_info`), or **No OTA update** while
+the app's embedded bundle runs. In the browser it links to the latest desktop release
on GitHub, and only appears when the `desktop-app` PostHog flag is enabled. Native desktop always shows this section regardless of the flag;
native mobile never shows it.
-The **Mobile App** page is titled **Mobile app** and offers a QR code
-to download **Macro** from the App Store.
+The **Mobile App** page is titled **Mobile app**. In the browser it offers a QR
+code to download **Macro** from the App Store; inside the iOS and Android apps
+it shows the same Version, Build date, and Bundle date card as the desktop app,
+and the sidebar's **Get the mobile app** button stays hidden.
Search checks individual setting titles and keywords, tolerates common typos,
and shows the parent page below each control result. Selecting a result opens