- Rust host: spawns storebound serve --stdio with fixed args, hands over a per-session secret, mints confirm tokens only after a native dialog showing the summary and the dry run - every app command re-checks window label and page origin; one capability (main window, app commands + event listen only, no plugin API in the webview); strict CSP; tests/security.rs pins it - store keys picked in native dialogs, kept in the OS keychain, passed per call in memory only - plugins: shell (Rust only), single-instance, deep-link storebound://, window-state, opener, dialog, notification, updater (placeholder endpoint and key until signing), process - app-centric UI: Portfolio, App (Releases, Catalog, Listings, Health, Reviews, TestFlight), App folders, Accounts, Dependencies, Settings; light / dark with the storebound.dev tokens, reduced motion, home folder shown as ~ - macOS menu: Cmd+Q quits, Edit menu, Window menu keeps the main window; Linux DMABUF fix - Bun workspace (npm files unchanged), ci runs desktop typecheck, build, cargo test and clippy; scrub covers home paths; docs/desktop.md (protocol, safety, dependency sources and licenses)
13 lines
611 B
TypeScript
13 lines
611 B
TypeScript
/** Home folder shown as "~", so screenshots and screen shares do not show the account name. */
|
|
export function shortPath(p: string, home: string | null | undefined): string {
|
|
if (!home) return p;
|
|
const h = home.replace(/[\\/]+$/, '');
|
|
if (p === h) return '~';
|
|
return p.startsWith(h + '/') || p.startsWith(h + '\\') ? `~${p.slice(h.length)}` : p;
|
|
}
|
|
|
|
/** Every occurrence of the home folder in a log text as "~". */
|
|
export function tildeText(text: string, home: string | null | undefined): string {
|
|
const h = home?.replace(/[\\/]+$/, '');
|
|
return h && h.length > 1 ? text.split(h).join('~') : text;
|
|
}
|