Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

app: About names the Linux app after Linux

Lin (kwant bot)77d1a39f6eb4
diff --git a/frontend/src/components/AppUpdateBanner.tsx b/frontend/src/components/AppUpdateBanner.tsx
index 5aa89125..926bf6fc 100644
--- a/frontend/src/components/AppUpdateBanner.tsx
+++ b/frontend/src/components/AppUpdateBanner.tsx
@@ -2,6 +2,7 @@ import React, { useEffect, useId, useState, useSyncExternalStore } from 'react';
import { AlertTriangle, ArrowUpCircle, CheckCircle2, ExternalLink, Info, Loader2, RotateCw, X } from 'lucide-react';
import { BannerView, UpdateController, UpdateModel, aboutLine, appUpdateController, bannerView, dismissVersion, dismissedVersion } from '../appUpdate';
import { MarkdownRenderer } from './MarkdownRenderer';
+import { desktopAppOs } from '../externalLinks';
const PHONE_QUERY = '(max-width: 767px)';
const UPDATED_NOTE_MS = 10000;
@@ -189,7 +190,7 @@ export const AppUpdateAboutView: React.FC<AboutProps> = ({ model, onCheck, onUpd
<span>About</span>
</h3>
<p className="mt-1 text-xs text-zinc-200">
- kwant bots for Mac <span className="font-mono text-zinc-300">{s.current || 'unknown version'}</span>
+ kwant bots for {desktopAppOs()} <span className="font-mono text-zinc-300">{s.current || 'unknown version'}</span>
</p>
</div>
<button
diff --git a/frontend/src/externalLinks.ts b/frontend/src/externalLinks.ts
index 1e8ae68a..98e1a586 100644
--- a/frontend/src/externalLinks.ts
+++ b/frontend/src/externalLinks.ts
@@ -20,6 +20,10 @@ export const inDesktopApp = (w: unknown = typeof window !== 'undefined' ? window
return typeof mark === 'string' && DESKTOP_APPS.includes(mark);
};
+/** The OS the desktop app names itself after in Settings → About: 'Linux' for the Linux app, else 'Mac'. */
+export const desktopAppOs = (w: unknown = typeof window !== 'undefined' ? window : undefined): 'Mac' | 'Linux' =>
+ (w ? (w as AppWindow).__KWANT_APP__ : undefined) === 'linux' ? 'Linux' : 'Mac';
+
/**
* Goes to a sign-in page from this tab. In a browser the tab leaves kwant and the callback page
* returns it; in the desktop app the navigation is turned into the default browser and the window
diff --git a/frontend/tests/externalLinks.test.mjs b/frontend/tests/externalLinks.test.mjs
index 98ceb042..fcda5575 100644
--- a/frontend/tests/externalLinks.test.mjs
+++ b/frontend/tests/externalLinks.test.mjs
@@ -7,7 +7,7 @@ const source = await readFile(new URL('../src/externalLinks.ts', import.meta.url
const { outputText } = ts.transpileModule(source, {
compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ES2020 },
});
-const { OAUTH_RETURN_KEY, DESKTOP_APPS, inDesktopApp, leaveForSignIn, signInChanged, pollUntil, mcpSignIn } = await import(
+const { OAUTH_RETURN_KEY, DESKTOP_APPS, inDesktopApp, desktopAppOs, leaveForSignIn, signInChanged, pollUntil, mcpSignIn } = await import(
`data:text/javascript;base64,${Buffer.from(outputText).toString('base64')}`
);
@@ -39,6 +39,13 @@ test('only the desktop app’s marks count as the desktop app', () => {
assert.equal(inDesktopApp(undefined), false);
});
+test('About names the Linux app after Linux and everything else after Mac', () => {
+ assert.equal(desktopAppOs(fakeWindow('linux')), 'Linux');
+ assert.equal(desktopAppOs(fakeWindow('mac')), 'Mac');
+ assert.equal(desktopAppOs(fakeWindow()), 'Mac');
+ assert.equal(desktopAppOs(undefined), 'Mac');
+});
+
test('every mark the desktop app sets is one the page knows', async () => {
const rust = await readFile(new URL('../../apps/mac/src/main.rs', import.meta.url), 'utf8');
const marks = [...rust.matchAll(/__KWANT_APP__ = '(\w+)'/g)].map((m) => m[1]);