mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-18 03:00:42 +00:00
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:
parent
436eb4a3a3
commit
f464fa96ad
68 changed files with 8006 additions and 631 deletions
42
foundry/packages/desktop/scripts/build-frontend-mobile.ts
Normal file
42
foundry/packages/desktop/scripts/build-frontend-mobile.ts
Normal 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");
|
||||
Loading…
Add table
Add a link
Reference in a new issue