-
{title}
{t ? `Version ${t.version}` : 'No version'}
- {t && (
-
- {(['ios', 'android'] as const).map(s => {
- const r = t[s];
- const ph = phaseText(r);
- return [
- - {s === 'ios' ? 'App Store' : 'Google Play'}
,
- - {ph.text}{r?.build && build {r.build}}{r?.track && r.track !== 'production' && · {r.track}}
,
- ];
- })}
-
- )}
+
+
+
+
+
+
+
{name}
+ {e?.summary?.profile && {t(`profile.${e.summary.profile}` as 'profile.app')}}
+
+
+
{iosNow && <>{iosNow.version}>}
+
{androidNow && <>{androidNow.version}>}
+
+
+
+
+ {ios && }
+ {android && }
+
+
+
+
+ {APP_TABS.map((x, i) => (
+
+ ))}
+
+
+ {tab === 'releases' && }
+ {tab === 'catalog' && }
+ {tab === 'listings' && }
+ {tab === 'health' && }
+ {tab === 'reviews' && }
+ {tab === 'testflight' && }
+ {tab === 'checks' && }
+
);
}
-
-export function AppView({ data, project, tab, setTab }: { data: Data; project: Project; tab: AppTab; setTab: (t: AppTab) => void }) {
- const e = data.statusOf(project);
- const ios = e?.app?.platforms.ios, android = e?.app?.platforms.android;
- return (
- <>
-
-
- {TABS.map(([t, label]) => )}
-
-
- {data.portfolioError &&
{data.portfolioError}
}
- {tab === 'releases' && (
- e?.release.source === 'live' ? (
-
- ) : (
-
Release trains
One version across the App Store and Google Play: build, review, TestFlight, phased release and rollout state. Map store accounts to this app in App folders, then read the stores.
- )
- )}
- {tab === 'catalog' && (
-
-
In-app catalog
Products and subscriptions are defined once in the config and created on both stores; parity compares them.
- {e?.catalog ? (
-
- - Products
- {e.catalog.products}
- - Subscriptions
- {e.catalog.subscriptions}
- - Compared with
- {e.catalog.checked === 'live' ? 'both stores' : 'the config only (read the stores to compare)'}
- {e.catalog.checked === 'live' && <>
- - Missing on iOS
- {e.catalog.missingIos.join(', ') || 'none'}
- - Missing on Android
- {e.catalog.missingAndroid.join(', ') || 'none'}
- - Only on one store
- {[...e.catalog.onlyIos.map(x => `${x} (iOS)`), ...e.catalog.onlyAndroid.map(x => `${x} (Android)`)].join(', ') || 'none'}
- >}
-
- ) :
Not checked yet.
}
-
- )}
- {tab !== 'releases' && tab !== 'catalog' && (
-
-
{TABS.find(x => x[0] === tab)![1]}
-
{NEXT[tab][0]}
-
Today in a terminal: {NEXT[tab][1]}
-
- )}
-
- >
- );
-}
diff --git a/apps/desktop/src/screens/Dependencies.tsx b/apps/desktop/src/screens/Dependencies.tsx
index 8b252edf..b0195416 100644
--- a/apps/desktop/src/screens/Dependencies.tsx
+++ b/apps/desktop/src/screens/Dependencies.tsx
@@ -1,69 +1,137 @@
+// Dependencies: local tools for screenshots, previews, icons and captures. ffmpeg and Chrome for Testing download
+// into the app data folder in one click (checksum or signature verified, progress, cancel); the rest link out.
+// Store work needs none of them. Sources and licenses: docs/desktop.md.
import { useCallback, useEffect, useState } from 'react';
-import { api, errorText, type ToolStatus } from '../api';
-import type { Data } from '../App';
+import { api, type DownloadInfo, errorText, newJob, onDownload, type ToolStatus } from '../api';
+import { t } from '../i18n';
+import { bytes } from '../lib/format';
import { shortPath } from '../paths';
+import { useData } from '../store';
+import { Icon, type IconName } from '../ui/icons';
+import { Card, Chip, Notice, Skeleton } from '../ui/kit';
-/** Status tag of one tool. */
-export function toolState(t: ToolStatus): { text: string; tone: 'ok' | 'warn' | 'local' } {
- if (!t.found) return { text: 'missing', tone: 'warn' };
- return t.source === 'app' ? { text: 'app copy', tone: 'local' } : { text: 'installed', tone: 'ok' };
+const TOOL_ICON: Record
= { ffmpeg: 'image', ffprobe: 'search', chrome: 'globe', xcode: 'terminal', simctl: 'phone', adb: 'phone', git: 'layers' };
+
+/** Status chip of one tool. */
+export function toolState(x: ToolStatus): { text: string; tone: 'ok' | 'warn' | 'accent' } {
+ if (!x.found) return { text: t('deps.missing'), tone: 'warn' };
+ return x.source === 'app' ? { text: t('deps.appCopy'), tone: 'accent' } : { text: t('deps.installed'), tone: 'ok' };
}
-/**
- * Local tools storebound uses for screenshots, previews, icons and captures. ffmpeg and Chrome for Testing will be
- * downloadable into the app's data folder (checksum or signature verified, never system-wide, never bundled);
- * Xcode and the Android SDK are link-out only. Sources and licenses: docs/desktop.md.
- */
-export function Dependencies({ data }: { data: Data }) {
- const [tools, setTools] = useState(data.sidecar?.tools?.tools ?? null);
+interface Dl { job: string; stage: string; received: number; total: number | null }
+
+export function Dependencies() {
+ const d = useData();
+ const [tools, setTools] = useState(d.sidecar?.tools?.tools ?? null);
+ const [info, setInfo] = useState([]);
const [error, setError] = useState(null);
const [busy, setBusy] = useState(false);
+ const [dl, setDl] = useState>({});
+
const refresh = useCallback(async () => {
setBusy(true); setError(null);
- try { setTools((await api.call<{ tools: ToolStatus[] }>('system.tools')).tools); } catch (e) { setError(errorText(e)); } finally { setBusy(false); }
+ try {
+ const [s, i] = await Promise.all([api.call<{ tools: ToolStatus[] }>('system.tools'), api.toolsInfo()]);
+ setTools(s.tools); setInfo(i);
+ } catch (e) { setError(errorText(e)); } finally { setBusy(false); }
}, []);
- useEffect(() => { if (!tools) refresh(); }, [tools, refresh]);
+ useEffect(() => { refresh(); }, [refresh]);
+ useEffect(() => {
+ const un = onDownload(e => setDl(m => {
+ const k = Object.keys(m).find(x => m[x]!.job === e.job);
+ return k ? { ...m, [k]: { ...m[k]!, stage: e.stage, received: e.received, total: e.total } } : m;
+ }));
+ return () => { un.then(f => f()); };
+ }, []);
+
+ const install = async (tool: 'ffmpeg' | 'chrome') => {
+ const job = newJob(`dl-${tool}`);
+ setDl(m => ({ ...m, [tool]: { job, stage: 'resolve', received: 0, total: null } }));
+ const tid = d.toast({ id: job, kind: 'job', title: t('deps.downloading', { tool: tool === 'chrome' ? 'Chrome for Testing' : 'ffmpeg' }), detail: t('dl.resolve'), progress: null, job });
+ try {
+ const v = await api.installTool(tool, job);
+ d.updateToast(tid, { kind: 'ok', title: t('deps.installedToast', { tool: tool === 'chrome' ? 'Chrome for Testing' : 'ffmpeg' }), detail: v, progress: undefined, job: undefined });
+ } catch (e) {
+ const msg = errorText(e);
+ d.updateToast(tid, { kind: msg === 'cancelled' ? 'info' : 'bad', title: msg === 'cancelled' ? t('toast.cancelled') : t('deps.failed'), detail: msg === 'cancelled' ? t('deps.cancelledDetail') : msg, progress: undefined, job: undefined });
+ } finally {
+ setDl(m => { const { [tool]: _gone, ...rest } = m; return rest; });
+ refresh();
+ }
+ };
+ const uninstall = async (tool: 'ffmpeg' | 'chrome') => {
+ try { await api.uninstallTool(tool); d.toast({ kind: 'ok', title: t('deps.removed') }); } catch (e) { setError(errorText(e)); }
+ refresh();
+ };
const open = (url: string) => api.openExternal(url).catch(e => setError(errorText(e)));
+ const copy = (s: string) => { navigator.clipboard?.writeText(s).then(() => d.toast({ kind: 'ok', title: t('deps.copied') }), () => {}); };
+
+ const found = tools?.filter(x => x.found).length ?? 0;
+ const managed = (id: string): DownloadInfo | undefined => info.find(i => i.tool === (id === 'ffprobe' ? 'ffmpeg' : id));
return (
- <>
-
-
-
Dependencies
-
Local tools for screenshots, app previews, icons and simulator or emulator captures. Store work (listings, products, releases) needs none of them.
-
-
-
-
- {error &&
{error}
}
-
-
- | Tool | Status | Version | Used for | Get it |
-
- {(tools ?? []).map(t => {
- const st = toolState(t);
- return (
-
- {t.name} {t.path && {shortPath(t.path, data.home)} } |
- {st.text} |
- {t.version ?? ''} |
- {t.usedFor} |
-
- {t.install.kind === 'download'
- ?
- : }
- |
-
- );
- })}
- {!tools && | Checking... |
}
-
-
-
-
- ffmpeg and Chrome for Testing will download into this app's data folder only, verified before use, and are never part of the installer. Xcode and the Android SDK come from Apple and Google.
-
+
+
+
{t('nav.dependencies')}
{t('deps.lead')}
+
- >
+ {error &&
{error}}
+
+ {!tools ?
: (
+
+ {tools.map(x => {
+ const st = toolState(x);
+ const m = x.install.kind === 'download' ? managed(x.id) : undefined;
+ const running = m ? dl[m.tool] : undefined;
+ const pct = running?.total ? running.received / running.total : null;
+ return (
+
+
+
+ {x.name}{st.text}{x.version && {x.version}}
+ {x.usedFor}
+ {x.path && {shortPath(x.path, d.info?.home)}}
+
+
+ {running ? (
+
+
+
{t(`dl.${running.stage}` as 'dl.download')}{running.total ? `${bytes(running.received)} / ${bytes(running.total)}` : ''}
+
+ ) : null}
+ {running ?
+ : m && x.id !== 'ffprobe' ? (
+ m.available ? (
+ m.installed ?
+ :
+ ) :
{t('deps.unavailable')}
+ ) : x.install.kind === 'link' && !x.found ?
: null}
+
+
+ );
+ })}
+
+ )}
+
+
+ {info.map(m => (
+
+
+ - {t('deps.source')}
- {m.source}
+ - {t('deps.license')}
- {m.license}
+ - {t('deps.verify')}
- {m.tool === 'chrome' ? t('deps.verifyChrome') : t('deps.verifyFfmpeg')}
+
+
+
+ ))}
+
+
+
+ {['storebound doctor', 'bun add -d playwright', 'brew install ffmpeg'].map(c => (
+
{c}
+ ))}
+
+
+
);
}
diff --git a/apps/desktop/src/screens/Onboarding.tsx b/apps/desktop/src/screens/Onboarding.tsx
new file mode 100644
index 00000000..c4c25af4
--- /dev/null
+++ b/apps/desktop/src/screens/Onboarding.tsx
@@ -0,0 +1,204 @@
+// First-run guide: what the app does, add or start an app folder, store keys into the keychain, local tools, and the
+// first read of the stores. Every step can be skipped; it opens again from Settings or the command palette.
+import { type KeyboardEvent, useEffect, useRef, useState } from 'react';
+import { api, errorText, newJob } from '../api';
+import { devSwitch } from '../dev/switches';
+import { type Key, t } from '../i18n';
+import { ago } from '../lib/format';
+import { useData } from '../store';
+import { Icon, type IconName, Mark } from '../ui/icons';
+import { Illo } from '../ui/illustrations';
+import { AppIcon, Chip, Notice, Seg } from '../ui/kit';
+
+const STEPS: [Key, IconName][] = [['wz.s1', 'sparkle'], ['wz.s2', 'folder'], ['wz.s3', 'key'], ['wz.s4', 'package'], ['wz.s5', 'refresh']];
+type Profile = 'app' | 'game' | 'subscription-app';
+
+export function Onboarding({ onClose }: { onClose: () => void }) {
+ const d = useData();
+ const v = devSwitch('start');
+ const [step, setStep] = useState(() => (v.startsWith('welcome:') ? Math.max(0, Math.min(4, Number(v.split(':')[1]) - 1)) : 0));
+ const [busy, setBusy] = useState
(null);
+ const [error, setError] = useState(null);
+ const [mode, setMode] = useState<'add' | 'init'>('add');
+ const [profile, setProfile] = useState('app');
+ const [playLabel, setPlayLabel] = useState('');
+ const [appleLabel, setAppleLabel] = useState('');
+ const [keyId, setKeyId] = useState('');
+ const [issuerId, setIssuerId] = useState('');
+ const root = useRef(null);
+ const before = useRef(null);
+
+ useEffect(() => {
+ before.current = document.activeElement;
+ root.current?.querySelector('.wz-body h2')?.focus();
+ return () => { (before.current as HTMLElement | null)?.focus?.(); };
+ }, []);
+ useEffect(() => { root.current?.querySelector('.wz-body h2')?.focus(); setError(null); }, [step]);
+
+ const act = async (key: string, fn: () => Promise) => {
+ setBusy(key); setError(null);
+ try { await fn(); await d.reload(); } catch (e) { setError(errorText(e)); } finally { setBusy(null); }
+ };
+ // focus stays inside the dialog; Esc closes it
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') { e.preventDefault(); onClose(); return; }
+ if (e.key !== 'Tab' || !root.current) return;
+ const f = [...root.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex="0"], h2[tabindex]')];
+ if (!f.length) return;
+ const first = f[0]!, last = f.at(-1)!;
+ if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }
+ else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }
+ };
+
+ const tools = d.sidecar?.tools?.tools ?? [];
+ const install = (tool: 'ffmpeg' | 'chrome') => act(`dl-${tool}`, async () => {
+ const job = newJob(`dl-${tool}`);
+ const tid = d.toast({ id: job, kind: 'job', title: t('deps.downloading', { tool: tool === 'chrome' ? 'Chrome for Testing' : 'ffmpeg' }), progress: null, job });
+ try { const r = await api.installTool(tool, job); d.updateToast(tid, { kind: 'ok', title: t('deps.installedToast', { tool }), detail: r, job: undefined, progress: undefined }); }
+ catch (e) { d.updateToast(tid, { kind: 'bad', title: t('deps.failed'), detail: errorText(e), job: undefined, progress: undefined }); }
+ });
+ const done = [d.projects.length > 0 || step > 0, d.projects.length > 0, d.accounts.length > 0, tools.length > 0 && tools.filter(x => x.id === 'ffmpeg' || x.id === 'chrome').every(x => x.found), !!d.live];
+ const liveApps = d.live?.value.apps.length ?? 0;
+
+ return (
+
+
+
+
+
+ {step === 0 && (
+ <>
+
+
{t('wz.welcomeTitle')}
+
{t('wz.welcomeLead')}
+
+ {([['portfolio', 'wz.p1t', 'wz.p1s'], ['shield', 'wz.p2t', 'wz.p2s'], ['key', 'wz.p3t', 'wz.p3s']] as [IconName, Key, Key][]).map(([ic, a, b]) => (
+
+ ))}
+
+ >
+ )}
+ {step === 1 && (
+ <>
+
{t('wz.appsTitle')}
+
{t('wz.appsLead')}
+
+
+
+
+ {mode === 'init' && (
+
+
+ {t(`folders.profileHint.${profile}` as Key)}
+
+ )}
+
+ {mode === 'add'
+ ?
+ : }
+
+ {d.projects.length > 0 && (
+
+ {d.projects.map(p =>
{d.statusOf(p)?.app?.name ?? p.name}
{t('wz.added')}
{t('wz.ready')})}
+
+ )}
+ >
+ )}
+ {step === 2 && (
+ <>
+
{t('wz.keysTitle')}
+
{t('wz.keysLead')}
+
+ {d.accounts.length > 0 && d.projects.length > 0 && (
+
+ {d.projects.map(p => (
+
+
+
{p.name}
{t('wz.mapHint')}
+
+
+
+ ))}
+
+ )}
+
{t('accounts.safety')}
+ >
+ )}
+ {step === 3 && (
+ <>
+
{t('wz.toolsTitle')}
+
{t('wz.toolsLead')}
+
+ {tools.map(x => (
+
+
+
{x.name}{x.version ? · {x.version} : null}
{x.usedFor}
+ {!x.found && (x.id === 'ffmpeg' || x.id === 'chrome') &&
}
+ {!x.found && x.install.kind === 'link' &&
}
+ {x.found &&
{x.source === 'app' ? t('deps.appCopy') : t('deps.installed')}}
+
+ ))}
+ {!tools.length &&
{t('common.loading')}
}
+
+
{t('wz.toolsNote')} storebound doctor
+ >
+ )}
+ {step === 4 && (
+ <>
+
+
{t('wz.readTitle')}
+
{t('wz.readLead')}
+
+
+ {d.live && {t('wz.readDone', { count: liveApps, when: ago(d.live.at) })}}
+
+ {!d.projects.length &&
{t('wz.needApp')}}
+ >
+ )}
+ {error &&
{error}}
+
+
+
+
+ {step > 0 && }
+ {step < 4 ?
+ : }
+
+
+
+
+ );
+}
diff --git a/apps/desktop/src/screens/Portfolio.tsx b/apps/desktop/src/screens/Portfolio.tsx
index c43153b7..4b1ed210 100644
--- a/apps/desktop/src/screens/Portfolio.tsx
+++ b/apps/desktop/src/screens/Portfolio.tsx
@@ -1,85 +1,220 @@
-import type { AppStatus, Project, ReleaseTrain, StoreRelease } from '../api';
-import type { Data } from '../App';
-import { shortPath } from '../paths';
+// Portfolio: every app on both stores. KPIs, one row per app (live version and state per store with its place on
+// the release track, next version, catalog parity, config check), what needs attention, and the workspace state.
+import { useEffect, useState } from 'react';
+import { api, type AppStatus, type Project, type StoreRelease, type ToolResult } from '../api';
+import { type Key, t } from '../i18n';
+import { ago, pct, share } from '../lib/format';
+import { type Attention, attention, healthSeries, type HealthSnapshot, isError, laneOf, PLAY_THRESHOLDS, STAGES, storeNow, type Tone } from '../lib/model';
+import { useNav } from '../nav';
+import { useData } from '../store';
+import { Icon, StoreGlyph } from '../ui/icons';
+import { AppIcon, Card, Chip, Empty, Kpi, Notice, PhaseChip, Skeleton, Sparkline } from '../ui/kit';
-export type Tone = 'ok' | 'warn' | 'bad' | 'muted' | 'local';
-
-/** Tag text and tone of one app's offline config check. */
-export function checkState(e: Pick): { text: string; tone: Tone } {
- if (e.errors.length || !e.check) return { text: 'not loaded', tone: 'bad' };
- if (e.check.problems.length) return { text: `${e.check.problems.length} problem${e.check.problems.length === 1 ? '' : 's'}`, tone: 'bad' };
- if (e.check.warnings.length) return { text: `${e.check.warnings.length} warning${e.check.warnings.length === 1 ? '' : 's'}`, tone: 'warn' };
- return { text: 'config ok', tone: 'ok' };
+/** Tag of one app's offline config check. */
+export function checkState(e: Pick | undefined): { text: string; tone: Tone } {
+ if (!e) return { text: t('check.notChecked'), tone: 'neutral' };
+ if (e.errors.length || !e.check) return { text: t('check.notLoaded'), tone: 'bad' };
+ if (e.check.problems.length) return { text: t('check.problems', { count: e.check.problems.length }), tone: 'bad' };
+ if (e.check.warnings.length) return { text: t('check.warnings', { count: e.check.warnings.length }), tone: 'warn' };
+ return { text: t('check.ok'), tone: 'ok' };
}
-const PHASE_TONE: Record = { live: 'ok', rollout: 'local', halted: 'bad', approved: 'local', review: 'warn', rejected: 'bad', testing: 'local', draft: 'muted', other: 'muted' };
-
-/** "live", "rollout 20%", "review" ... for one store of a train. */
-export function phaseText(r: StoreRelease | null): { text: string; tone: Tone } {
- if (!r) return { text: 'not on this store', tone: 'muted' };
- const pct = r.fraction !== null && r.phase === 'rollout' ? ` ${Math.round(r.fraction * 100)}%` : '';
- return { text: `${r.phase}${pct}`, tone: PHASE_TONE[r.phase] };
-}
-
-export function trainText(t: ReleaseTrain | null, source: 'none' | 'live'): string {
- if (source === 'none') return 'not read';
- return t ? t.version : 'none';
-}
-
-export function Portfolio({ data, open, go }: { data: Data; open: (p: Project) => void; go: (s: 'apps') => void }) {
- const busy = data.portfolioBusy;
+export function Pips({ r, store }: { r: StoreRelease | null; store: 'ios' | 'android' }) {
+ const lane = laneOf(store, r);
return (
- <>
-