Add Foundry mobile layout with Tauri iOS/Android support

- Add responsive mobile layout with bottom pill tab bar, swipe navigation, and task list as home screen
- Add platform detection (useIsMobile hook) with viewport breakpoint and VITE_MOBILE build flag
- Mobile-optimize settings/billing/account pages (single-column layout with horizontal tabs)
- Add iOS safe area inset handling with 47px minimum padding
- Scaffold Tauri v2 mobile targets (iOS/Android) with platform-gated sidecar and capabilities
- Add notification sound support and mobile build script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nicholas Kissel 2026-03-12 22:35:54 -07:00
parent 436eb4a3a3
commit f464fa96ad
68 changed files with 8006 additions and 631 deletions

View file

@ -0,0 +1,42 @@
import { execSync } from "node:child_process";
import { cpSync, readFileSync, writeFileSync, rmSync, existsSync } from "node:fs";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const desktopRoot = resolve(__dirname, "..");
const repoRoot = resolve(desktopRoot, "../../..");
const frontendDist = resolve(desktopRoot, "../frontend/dist");
const destDir = resolve(desktopRoot, "frontend-dist");
function run(cmd: string, opts?: { cwd?: string; env?: NodeJS.ProcessEnv }) {
console.log(`> ${cmd}`);
execSync(cmd, {
stdio: "inherit",
cwd: opts?.cwd ?? repoRoot,
env: { ...process.env, ...opts?.env },
});
}
// Step 1: Build the frontend for mobile (no hardcoded backend endpoint)
console.log("\n=== Building frontend for mobile ===\n");
run("pnpm --filter @sandbox-agent/foundry-frontend build", {
env: {
VITE_MOBILE: "1",
},
});
// Step 2: Copy dist to frontend-dist/
console.log("\n=== Copying frontend build output ===\n");
if (existsSync(destDir)) {
rmSync(destDir, { recursive: true });
}
cpSync(frontendDist, destDir, { recursive: true });
// Step 3: Strip react-scan script from index.html (it loads unconditionally)
const indexPath = resolve(destDir, "index.html");
let html = readFileSync(indexPath, "utf-8");
html = html.replace(/<script\s+src="https:\/\/unpkg\.com\/react-scan\/dist\/auto\.global\.js"[^>]*><\/script>\s*/g, "");
writeFileSync(indexPath, html);
console.log("\n=== Mobile frontend build complete ===\n");