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.

feat(ui): installable PWA + iOS Add-to-Home-Screen nudge (#422)

Call White6e1204f41451
diff --git a/ui/index.html b/ui/index.html
index 3ac2518ff..daa6f5212 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -11,6 +11,21 @@
home + visualViewport --app-vvh chat, see useViewportHeightVar). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Vibe Remote</title>
+
+ <!-- PWA / iOS standalone: "Add to Home Screen" launches a full-screen app
+ (no Safari chrome), which sidesteps the iOS keyboard whitespace/accessory
+ bar issues. No service worker on purpose — assets stay network-fresh (Vite
+ content-hashes JS/CSS), so frontend updates always land. -->
+ <!-- use-credentials: the manifest sits behind the remote-access auth cookie
+ (it's not in the public-exempt paths), so the browser must send creds or
+ it gets the login redirect instead of the manifest. -->
+ <link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+ <meta name="apple-mobile-web-app-title" content="Vibe Remote" />
+ <meta name="theme-color" content="#080812" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@600&display=swap" rel="stylesheet">
diff --git a/ui/public/apple-touch-icon.png b/ui/public/apple-touch-icon.png
new file mode 100644
index 000000000..519f7f906
Binary files /dev/null and b/ui/public/apple-touch-icon.png differ
diff --git a/ui/public/icon-192.png b/ui/public/icon-192.png
new file mode 100644
index 000000000..43b506119
Binary files /dev/null and b/ui/public/icon-192.png differ
diff --git a/ui/public/icon-512.png b/ui/public/icon-512.png
new file mode 100644
index 000000000..0b09e26f8
Binary files /dev/null and b/ui/public/icon-512.png differ
diff --git a/ui/public/manifest.webmanifest b/ui/public/manifest.webmanifest
new file mode 100644
index 000000000..65ddc4676
--- /dev/null
+++ b/ui/public/manifest.webmanifest
@@ -0,0 +1,15 @@
+{
+ "name": "Vibe Remote",
+ "short_name": "Vibe Remote",
+ "description": "Talk to your AI coding agents from any messaging app.",
+ "start_url": "/",
+ "scope": "/",
+ "display": "standalone",
+ "background_color": "#080812",
+ "theme_color": "#080812",
+ "orientation": "portrait",
+ "icons": [
+ { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable" },
+ { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
+ ]
+}
diff --git a/ui/src/components/AppShell.tsx b/ui/src/components/AppShell.tsx
index 0b9c86c3a..988d0df6e 100644
--- a/ui/src/components/AppShell.tsx
+++ b/ui/src/components/AppShell.tsx
@@ -14,6 +14,7 @@ import { VersionBadge } from './VersionBadge';
import { WorkbenchSidebar } from './workbench/WorkbenchSidebar';
import { NewSessionSheet } from './workbench/NewSessionSheet';
import { Button } from './ui/button';
+import { InstallHint } from './InstallHint';
import logoImg from '../assets/logo.png';
import { getEnabledPlatforms, platformSupportsChannels } from '../lib/platforms';
import { useViewportHeightVar } from '../lib/useViewportHeightVar';
@@ -81,7 +82,19 @@ type CenterButton = { label: string; icon: React.ComponentType<{ className?: str
// center FAB. Workbench: center = + (new session). Control Panel: center =
// Workbench (jump back) — the symmetric counterpart Alex asked for, so each
// shell can reach the other from the tab bar.
-const MobileTabBar: React.FC<{ items: ShellNavItem[]; center: CenterButton }> = ({ items, center }) => {
+const MobileTabBar: React.FC<{ items: ShellNavItem[]; center?: CenterButton }> = ({ items, center }) => {
+ // No center FAB → a plain even row of tabs. The Control Panel uses this so
+ // "Workbench" is just the first tab, which reads cleaner than an asymmetric
+ // raised center button.
+ if (!center) {
+ return (
+ <nav className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/96 px-2 pt-2 pb-[calc(0.5rem+env(safe-area-inset-bottom))] backdrop-blur md:hidden">
+ <div className="flex items-end justify-between gap-1">
+ {items.map((item) => <MobileNavLink key={item.to} item={item} />)}
+ </div>
+ </nav>
+ );
+ }
const half = Math.ceil(items.length / 2);
const left = items.slice(0, half);
const right = items.slice(half);
@@ -312,9 +325,10 @@ export const AppShell: React.FC = () => {
/>
<span className="truncate text-[13px] font-semibold">{t('appShell.title')}</span>
</div>
- {/* Version / language / theme / account moved into the More tab — the
- mobile header stays just brand. (Desktop keeps them in the admin
- sidebar bottom.) */}
+ {/* Right side: the Add-to-Home-Screen nudge (renders only on iOS Safari
+ when not yet installed; null everywhere else). Version / language /
+ theme / account live in the More tab. */}
+ <InstallHint />
</header>
)}
@@ -336,8 +350,7 @@ export const AppShell: React.FC = () => {
{showBottomNav && (
shellMode === 'admin' ? (
<MobileTabBar
- items={adminItems}
- center={{ to: '/', label: t('appShell.backToWorkbench'), icon: Sparkles }}
+ items={[{ to: '/', label: t('nav.workbench'), icon: Sparkles }, ...adminItems]}
/>
) : (
<MobileTabBar
diff --git a/ui/src/components/InstallHint.tsx b/ui/src/components/InstallHint.tsx
new file mode 100644
index 000000000..61e8b5d69
--- /dev/null
+++ b/ui/src/components/InstallHint.tsx
@@ -0,0 +1,134 @@
+import { useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Plus, Share, Sparkles, X } from 'lucide-react';
+
+import { Popover, PopoverContent, PopoverTrigger } from './ui/popover';
+import { Button } from './ui/button';
+
+const STORAGE_KEY = 'vibe-remote-a2hs';
+
+// iOS in-app webviews (IM/social apps) and alt browsers can't "Add to Home
+// Screen" and don't expose Safari's share flow, so the nudge would give
+// impossible steps to exactly the IM-launched users this app targets. Only real
+// Safari qualifies — it carries both a "Version/<n>" and a "Safari" token, which
+// WKWebview-based in-app browsers and CriOS/FxiOS/etc. lack.
+const NON_SAFARI_UA = /CriOS|FxiOS|EdgiOS|OPiOS|mercury/i;
+const IN_APP_UA =
+ /MicroMessenger|FBAN|FBAV|FB_IAB|Instagram|Line\/|Twitter|WhatsApp|Snapchat|DingTalk|QQ\/|QQTheme|Slack|Discord|Feishu|Lark|; wv\)/i;
+
+function shouldShowHint(): boolean {
+ if (typeof window === 'undefined' || !window.matchMedia) return false;
+ if (!window.matchMedia('(max-width: 767px)').matches) return false;
+ const ua = navigator.userAgent || '';
+ const isIOS =
+ /iP(hone|ad|od)/.test(ua) ||
+ (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
+ if (!isIOS) return false;
+ const isRealSafari =
+ /Safari/.test(ua) && /Version\//.test(ua) && !NON_SAFARI_UA.test(ua) && !IN_APP_UA.test(ua);
+ if (!isRealSafari) return false;
+ const standalone =
+ (navigator as unknown as { standalone?: boolean }).standalone === true ||
+ window.matchMedia('(display-mode: standalone)').matches;
+ return !standalone;
+}
+
+// Top-right nudge to install the app to the iOS Home Screen (standalone PWA),
+// which removes Safari's chrome and the keyboard whitespace/accessory issues.
+// The ✕ collapses it to a persistent gold dot (we keep nudging rather than
+// dismissing for good); both the bar and the dot open a popover with the
+// Share → Add to Home Screen steps. Mounted in both the brand header and the
+// chat header (only one renders at a time) so chat-first / IM-launched users
+// see it too. Self-gates to null off iOS Safari / when installed.
+export const InstallHint: React.FC = () => {
+ const { t } = useTranslation();
+ const [visible, setVisible] = useState(false);
+ const [collapsed, setCollapsed] = useState(false);
+ const [open, setOpen] = useState(false);
+
+ useEffect(() => {
+ setVisible(shouldShowHint());
+ try {
+ setCollapsed(window.localStorage.getItem(STORAGE_KEY) === 'dot');
+ } catch {
+ /* private mode / storage blocked — keep it expanded */
+ }
+ }, []);
+
+ if (!visible) return null;
+
+ const collapse = () => {
+ setOpen(false);
+ setCollapsed(true);
+ try {
+ window.localStorage.setItem(STORAGE_KEY, 'dot');
+ } catch {
+ /* ignore */
+ }
+ };
+
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ {collapsed ? (
+ <PopoverTrigger asChild>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ aria-label={t('installHint.cta')}
+ className="relative size-7 shrink-0 hover:bg-transparent"
+ >
+ <span className="size-2.5 rounded-full bg-gold shadow-[0_0_8px_rgba(245,200,92,0.9)]" />
+ <span className="absolute inline-flex size-2.5 animate-ping rounded-full bg-gold/60" />
+ </Button>
+ </PopoverTrigger>
+ ) : (
+ <div className="inline-flex shrink-0 items-center gap-0.5">
+ <PopoverTrigger asChild>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="h-7 gap-1 rounded-full border-gold/40 bg-gold/[0.12] px-2.5 text-[11px] font-semibold text-gold hover:bg-gold/20 hover:text-gold"
+ >
+ <Sparkles className="size-3" />
+ <span>{t('installHint.cta')}</span>
+ </Button>
+ </PopoverTrigger>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ onClick={collapse}
+ aria-label={t('installHint.dismiss')}
+ className="size-6 shrink-0 text-gold/70 hover:bg-transparent hover:text-gold"
+ >
+ <X className="size-3.5" />
+ </Button>
+ </div>
+ )}
+
+ <PopoverContent align="end" sideOffset={8} className="w-[18rem] border-gold/30">
+ <div className="flex flex-col gap-2.5">
+ <div className="flex items-center gap-2">
+ <span className="grid size-7 shrink-0 place-items-center rounded-lg border border-gold/40 bg-gold/[0.12] text-gold">
+ <Sparkles className="size-3.5" />
+ </span>
+ <div className="text-[13px] font-semibold text-foreground">{t('installHint.title')}</div>
+ </div>
+ <p className="text-[12px] leading-relaxed text-muted">{t('installHint.body')}</p>
+ <ol className="flex flex-col gap-1.5 rounded-lg border border-border bg-foreground/[0.02] p-2.5 text-[12px] text-foreground">
+ <li className="flex items-center gap-2">
+ <Share className="size-4 shrink-0 text-cyan" />
+ <span>{t('installHint.step1')}</span>
+ </li>
+ <li className="flex items-center gap-2">
+ <Plus className="size-4 shrink-0 text-cyan" />
+ <span>{t('installHint.step2')}</span>
+ </li>
+ </ol>
+ </div>
+ </PopoverContent>
+ </Popover>
+ );
+};
diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsx
index aceb3bc43..ab2519300 100644
--- a/ui/src/components/workbench/ChatPage.tsx
+++ b/ui/src/components/workbench/ChatPage.tsx
@@ -12,6 +12,7 @@ import { useIosKeyboardInset } from '../../lib/useIosKeyboardInset';
import { isProxyMediaUrl } from '../../lib/mediaProxy';
import { formatLocalDateTime } from '../../lib/relativeTime';
import { AgentRoutePicker } from './AgentRoutePicker';
+import { InstallHint } from '../InstallHint';
import { Button } from '../ui/button';
import { ChatImage } from '../ui/chat-image';
import { FileCard } from '../ui/file-card';
@@ -852,6 +853,10 @@ const ChatHeaderBar: React.FC<ChatHeaderBarProps> = ({ session, agents, onPatch,
</Button>
<TitleField key={session.id} title={session.title} onCommit={(title) => onPatch({ title })} />
<AgentRoutePicker value={session} agents={agents} onChange={onPatch} />
+ {/* Chat hides the brand header, so mount the install nudge here too —
+ IM-launched users often land straight in a chat. Renders only on iOS
+ Safari + not-installed; null otherwise. */}
+ <InstallHint />
</div>
</div>
);
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index cddd02429..b95bd3402 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -1,4 +1,12 @@
{
+ "installHint": {
+ "cta": "Add to Home Screen",
+ "title": "Use Vibe Remote like an app",
+ "body": "Add it to your Home Screen so the keyboard stops covering the input, with no browser bars and a more native feel.",
+ "step1": "Tap the Share button at the bottom",
+ "step2": "Choose “Add to Home Screen”",
+ "dismiss": "Collapse"
+ },
"common": {
"back": "Back",
"continue": "Continue",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index e6e5c8cd4..213df54d8 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -1,4 +1,12 @@
{
+ "installHint": {
+ "cta": "装到主屏幕",
+ "title": "把 Vibe Remote 当 App 用",
+ "body": "添加到主屏幕后,键盘不再挡住输入框,也没有浏览器工具栏,体验更接近原生 App。",
+ "step1": "点底部的「分享」按钮",
+ "step2": "选「添加到主屏幕」",
+ "dismiss": "收起"
+ },
"common": {
"back": "返回",
"continue": "继续",
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 898e8ae16..31d9bb4e8 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -43,6 +43,10 @@ from vibe.sentry_integration import init_sentry
logger = logging.getLogger(__name__)
+# Python's mimetypes map omits .webmanifest; register it so the PWA manifest is
+# served as a type browsers accept (an octet-stream manifest is rejected).
+mimetypes.add_type("application/manifest+json", ".webmanifest")
+
app = CompatApp(title="Vibe Remote UI", docs_url=None, redoc_url=None, openapi_url=None)
# Global server instance for graceful shutdown on reload