Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(version): point browsers on a desktop Runtime to the desktop app (#2893)

Max893136caeea9
diff --git a/ui/src/components/VersionBadge.test.tsx b/ui/src/components/VersionBadge.test.tsx
index 5751cb550..7c9c4c63a 100644
--- a/ui/src/components/VersionBadge.test.tsx
+++ b/ui/src/components/VersionBadge.test.tsx
@@ -1,5 +1,5 @@
// @vitest-environment jsdom
-import { cleanup, fireEvent, render, screen } from '@testing-library/react';
+import { act, cleanup, fireEvent, render, screen } from '@testing-library/react';
import { I18nextProvider } from 'react-i18next';
import { afterEach, describe, expect, it, vi } from 'vitest';
import i18n from '@/i18n';
@@ -47,15 +47,32 @@ describe('desktop version ownership', () => {
expect(api.getConfig).not.toHaveBeenCalled();
});
- it('retains the browser version entry and its existing managed-runtime guidance', async () => {
+ it('points a browser on a desktop Runtime to the desktop app without update controls', async () => {
render(<I18nextProvider i18n={i18n}><VersionBadge /></I18nextProvider>);
const entry = await screen.findByTitle('v9.9.9');
fireEvent.click(entry);
expect(await screen.findByRole('dialog')).toBeTruthy();
+ expect(await screen.findByText(i18n.t('dashboard.desktopManagedUpdate'))).toBeTruthy();
+ expect(screen.queryByRole('button', { name: i18n.t('dashboard.upgradeNow') })).toBeNull();
+ expect(screen.queryByText(i18n.t('dashboard.autoUpdate'))).toBeNull();
expect(api.getVersion).toHaveBeenCalledOnce();
expect(entry.querySelector('.animate-pulse')).toBeNull();
});
+ it('withholds the auto-update toggle until the Runtime reports who manages it', async () => {
+ let resolveVersion: (info: { current: string; latest: string; has_update: boolean; managed_by?: string }) => void = () => {};
+ api.getVersion.mockImplementationOnce(() => new Promise((resolve) => { resolveVersion = resolve; }));
+ render(<I18nextProvider i18n={i18n}><VersionBadge /></I18nextProvider>);
+ fireEvent.click(screen.getByTitle('v...'));
+ await vi.waitFor(() => expect(api.getConfig).toHaveBeenCalledOnce());
+ // Let the loaded setting render while the version request is still pending.
+ await act(() => new Promise((resolve) => setTimeout(resolve, 0)));
+ expect(screen.queryByText(i18n.t('dashboard.autoUpdate'))).toBeNull();
+
+ resolveVersion({ current: '9.9.9', latest: '9.9.9', has_update: false });
+ expect(await screen.findByText(i18n.t('dashboard.autoUpdate'))).toBeTruthy();
+ });
+
it('shows a successful upgrade warning returned in the output', async () => {
api.getVersion.mockResolvedValueOnce({ current: '9.9.9', latest: '10.0.0', has_update: true });
api.doUpgrade.mockResolvedValueOnce({
diff --git a/ui/src/components/VersionBadge.tsx b/ui/src/components/VersionBadge.tsx
index 945319855..c8bd500b0 100644
--- a/ui/src/components/VersionBadge.tsx
+++ b/ui/src/components/VersionBadge.tsx
@@ -325,8 +325,8 @@ export const VersionBadge: React.FC<{ openUpward?: boolean }> = ({ openUpward =
</div>
)}
- {/* Auto Update Toggle */}
- {!isSourceBuild && !isDesktopManaged && autoUpdate !== null && (
+ {/* Auto Update Toggle: only once the Runtime has said who manages it */}
+ {versionInfo && !isSourceBuild && !isDesktopManaged && autoUpdate !== null && (
<div className="flex items-center justify-between gap-3 border-t border-border pt-3">
<div className="min-w-0">
<div className="text-sm text-foreground">{t('dashboard.autoUpdate')}</div>
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 8c5dc9143..edddde3fc 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -4032,7 +4032,7 @@
"restarting": "Restarting...",
"autoUpdate": "Auto Update",
"autoUpdateHint": "Auto-install when idle",
- "desktopManagedUpdate": "Updates are delivered with the Avibe desktop app",
+ "desktopManagedUpdate": "Updates come from the Avibe desktop app on the computer running Avibe. Check for updates there.",
"runtimeVersionSkew": "This app is v{{app}}, but it is connected to an Avibe Runtime at v{{runtime}}"
},
"doctor": {
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index d4c2e0ac0..784f39fa4 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -4032,7 +4032,7 @@
"restarting": "正在重启...",
"autoUpdate": "自动更新",
"autoUpdateHint": "空闲时自动安装",
- "desktopManagedUpdate": "更新将随 Avibe 桌面应用提供",
+ "desktopManagedUpdate": "更新由运行 Avibe 的那台电脑上的桌面应用提供,请在那里检查更新。",
"runtimeVersionSkew": "本应用为 v{{app}},但连接的 Avibe 运行时为 v{{runtime}}"
},
"doctor": {