Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
fix(integrations): the iOS zoom fix targeted a selector the page does not use
Abdurrahman Fakhrul9fd2b70561e6
diff --git a/lib/infra/connection-ui-style.ts b/lib/infra/connection-ui-style.tsindex ac62ada1..fd669497 100644--- a/lib/infra/connection-ui-style.ts+++ b/lib/infra/connection-ui-style.ts@@ -44,7 +44,7 @@ export const CONNECTION_MANAGER_STYLE = String.raw`.integration .integration-sidebar-header{display:grid;flex:none;max-height:calc(var(--control-size) * 4);overflow-y:auto;gap:var(--space-4);padding:var(--space-5) var(--space-3) var(--space-3)}.integration .integration-sidebar-brand{display:flex;align-items:center;gap:var(--space-3);padding-inline:var(--space-1)}.integration .integration-sidebar-brand strong,.integration .integration-sidebar-brand small{display:block}.integration .integration-sidebar-brand strong{font-size:var(--type-small);font-weight:var(--weight-strong)}.integration .integration-sidebar-brand small{margin-top:var(--space-1);color:var(--muted-foreground);font-size:var(--type-caption)}.integration .integration-brand-icon{display:flex;align-items:center;justify-content:center;width:var(--brand-size);height:var(--brand-size);flex:none}.integration .integration-brand-icon svg{display:block;width:100%;height:100%}-.integration .integration-sidebar-header>input[type=search]{width:100%;min-height:var(--control-size);margin:0;border-radius:var(--radius-control);background:var(--secondary);font-size:var(--type-caption)}.integration .integration-settings-sidebar .owner-picker-trigger{min-height:var(--control-size);font-size:var(--type-caption)}+.integration .integration-sidebar-header>input[type=search]{width:100%;min-height:var(--control-size);margin:0;border-radius:var(--radius-control);background:var(--secondary);font-size:var(--type-body)}.integration .integration-settings-sidebar .owner-picker-trigger{min-height:var(--control-size);font-size:var(--type-body)}.integration .integration-settings-nav{min-height:calc(var(--control-size) * 2);flex:1;overflow-y:auto;padding:0 var(--space-2) var(--space-4);scrollbar-width:thin}.integration .integration-nav-group{display:grid;gap:var(--space-1);margin-top:var(--space-3)}.integration .integration-nav-label{margin:0;padding:0 var(--space-2) var(--space-1);font-size:var(--type-caption);font-weight:var(--weight-medium);color:var(--muted-foreground)}.integration .integration-nav-item{position:relative;display:flex;width:100%;min-height:var(--control-size);align-items:center;gap:var(--space-2);border:0;border-radius:var(--radius-control);padding:var(--space-2);text-align:left;background:transparent;color:var(--foreground);font-size:var(--type-small);font-weight:var(--weight-regular)}.integration .integration-nav-item:hover:not(:disabled){background:var(--hover)}.integration .integration-nav-item[aria-current=page]{background:var(--settings-selected);color:var(--settings-selected-text);font-weight:var(--weight-strong)}.integration .integration-nav-item .provider-mark{width:var(--settings-nav-icon-size);height:var(--settings-nav-icon-size);border-radius:var(--radius-control)}.integration .integration-nav-item[aria-current=page] .provider-mark{border-color:var(--settings-selected-border);background:var(--settings-selected-subtle);color:var(--settings-selected-text)}.integration .integration-nav-item .provider-count{margin-left:auto;font-size:var(--type-caption);color:inherit;opacity:var(--settings-muted-opacity)}diff --git a/lib/infra/ios-zoom-threshold.test.ts b/lib/infra/ios-zoom-threshold.test.tsnew file mode 100644index 00000000..a1a286ba--- /dev/null+++ b/lib/infra/ios-zoom-threshold.test.ts@@ -0,0 +1,48 @@+import { describe, expect, it } from "vitest";+import { CONNECTION_MANAGER_STYLE } from "./connection-ui-style";++// iOS Safari zooms into any focused input whose font-size is below 16px, and it does not zoom back+// out. The page then looks broken until the user pinches.+//+// This test exists because the string assertion that was supposed to cover it passed while the real+// page was still wrong: it checked "input[type=search]", but the sidebar search is matched by the+// longer scoped selector ".integration .integration-sidebar-header>input[type=search]". Browser+// evidence caught the difference. So this file asserts the selector the page actually uses.+//+// --type-body is 1rem, which is exactly 16px, so it is the threshold with no raw literal.++const SEARCH = ".integration .integration-sidebar-header>input[type=search]";+const TRIGGER = ".integration .integration-settings-sidebar .owner-picker-trigger";++/** Every `selector{...}` block in the stylesheet, in order. */+function blocks(css: string): Array<{ selector: string; body: string }> {+ return [...css.matchAll(/([^{}]+)\{([^{}]*)\}/g)].map((m) => ({ selector: m[1].trim(), body: m[2] }));+}++function bodyFor(css: string, selector: string): string | undefined {+ return blocks(css).find((b) => b.selector === selector)?.body;+}++describe("iOS auto-zoom threshold", () => {+ it("sizes the scoped sidebar search at the body token, not the caption token", () => {+ const body = bodyFor(CONNECTION_MANAGER_STYLE, SEARCH);+ expect(body, `${SEARCH} must exist; the page's search box is matched by this scoped selector`).toBeDefined();+ expect(body).toContain("font-size:var(--type-body)");+ expect(body).not.toContain("font-size:var(--type-caption)");+ });++ it("sizes the owner picker trigger the same way", () => {+ const body = bodyFor(CONNECTION_MANAGER_STYLE, TRIGGER);+ expect(body, `${TRIGGER} must exist`).toBeDefined();+ expect(body).toContain("font-size:var(--type-body)");+ expect(body).not.toContain("font-size:var(--type-caption)");+ });++ it("uses no caption-sized text field anywhere in the stylesheet", () => {+ const offenders = blocks(CONNECTION_MANAGER_STYLE)+ .filter((b) => /font-size:var\(--type-caption\)/.test(b.body))+ .filter((b) => /\binput\b|\bselect\b|\btextarea\b|owner-picker-trigger/.test(b.selector))+ .map((b) => b.selector);+ expect(offenders, "a caption-sized field triggers Safari zoom").toEqual([]);+ });+});diff --git a/scripts/integrations-ui-evidence.mjs b/scripts/integrations-ui-evidence.mjsnew file mode 100644index 00000000..6de6eae2--- /dev/null+++ b/scripts/integrations-ui-evidence.mjs@@ -0,0 +1,158 @@+/**+ * Browser evidence harness for the integrations page.+ *+ * Written because every UI claim in this session so far was proven only against strings:+ * tests assert that CSS text exists, not that a browser lays it out that way. This drives a real+ * build and reports what actually renders.+ *+ * Usage: node scripts/integrations-ui-evidence.mjs [base-url]+ * Without a base URL it builds nothing; point it at a running instance.+ */+import { chromium } from "@playwright/test";+import { releaseFixture } from "./e2e/release-fixture.mjs";+import fs from "node:fs";+import path from "node:path";++const OUT = process.env.MSO_EVIDENCE_DIR ?? "/tmp/opencode/evidence";+fs.mkdirSync(OUT, { recursive: true, mode: 0o700 });++const VIEWPORTS = [+ { label: "320", width: 320, height: 640 },+ { label: "390", width: 390, height: 844 },+ { label: "768", width: 768, height: 1024 },+ { label: "1440", width: 1440, height: 900 },+];++const results = [];+const record = (area, viewport, check, ok, detail) => {+ results.push({ area, viewport, check, ok, detail });+ console.log(`${ok ? "PASS" : "FAIL"} ${area} @${viewport} ${check}${detail ? ` (${detail})` : ""}`);+};++const fixture = await releaseFixture();+const browser = await chromium.launch({ headless: true });+try {+ for (const vp of VIEWPORTS) {+ const context = await browser.newContext({ viewport: { width: vp.width, height: vp.height }, reducedMotion: "reduce" });+ await context.addInitScript(() => {+ localStorage.setItem("sv:shell", JSON.stringify({ desktop: "macos", mobile: "ios" }));+ localStorage.setItem("mso:onboarding:v1", "done");+ });+ const page = await context.newPage();+ const errors = [];+ page.on("pageerror", (e) => errors.push(String(e)));+ page.on("console", (m) => { if (m.type() === "error") errors.push(m.text()); });++ await page.goto(`${fixture.base}/integrations`, { waitUntil: "load", timeout: 60000 });+ await page.waitForTimeout(3500);++ // 1. Horizontal overflow: the page must never scroll sideways.+ const overflow = await page.evaluate(() => ({+ doc: document.documentElement.scrollWidth - document.documentElement.clientWidth,+ wide: [...document.querySelectorAll("*")]+ .filter((el) => el.getBoundingClientRect().right > document.documentElement.clientWidth + 1)+ .slice(0, 5)+ .map((el) => `${el.tagName}.${(el.className || "").toString().split(" ")[0]}`),+ }));+ record("overflow", vp.label, "no horizontal scroll", overflow.doc <= 0, `overflow=${overflow.doc}px${overflow.wide.length ? ` offenders=${overflow.wide.join(",")}` : ""}`);++ // 2. Exactly one main landmark and one h1.+ const landmarks = await page.evaluate(() => ({+ main: document.querySelectorAll("main").length,+ h1: document.querySelectorAll("h1").length,+ }));+ record("landmarks", vp.label, "one main", landmarks.main === 1, `count=${landmarks.main}`);+ record("landmarks", vp.label, "one h1", landmarks.h1 === 1, `count=${landmarks.h1}`);++ // 3. Tap targets on every interactive control.+ const small = await page.evaluate(() => {+ const nodes = [...document.querySelectorAll("button, a[href], summary, select, input:not([type=hidden]), label[for]")];+ return nodes+ .filter((el) => el.getBoundingClientRect().width > 0)+ .map((el) => ({ tag: el.tagName, h: Math.round(el.getBoundingClientRect().height), t: (el.textContent || "").trim().slice(0, 22) }))+ .filter((r) => r.h < 44);+ });+ record("tap-target", vp.label, "all controls >= 44px tall", small.length === 0, small.length ? `${small.length} small: ${small.slice(0, 3).map((s) => `${s.tag}(${s.h}px)`).join(",")}` : "");++ // 4. Accessible names on icon-only buttons, alt on images.+ const a11y = await page.evaluate(() => {+ const nameless = [...document.querySelectorAll("button")]+ .filter((b) => b.getBoundingClientRect().width > 0)+ .filter((b) => !(b.textContent || "").trim() && !b.getAttribute("aria-label") && !b.getAttribute("title")).length;+ const noAlt = [...document.querySelectorAll("img")].filter((i) => !i.hasAttribute("alt")).length;+ return { nameless, noAlt };+ });+ record("a11y", vp.label, "every button has a name", a11y.nameless === 0, `nameless=${a11y.nameless}`);+ record("a11y", vp.label, "every img has alt", a11y.noAlt === 0, `noAlt=${a11y.noAlt}`);++ // 5. iOS auto-zoom: any focused-able input under 16px will zoom Safari.+ const tiny = await page.evaluate(() =>+ [...document.querySelectorAll("input, select, textarea")]+ .filter((el) => el.getBoundingClientRect().width > 0 && parseFloat(getComputedStyle(el).fontSize) < 16)+ .map((el) => `${el.tagName}[${el.type || ""}]=${getComputedStyle(el).fontSize}`));+ record("ios-zoom", vp.label, "no input below 16px", tiny.length === 0, tiny.slice(0, 3).join(","));++ // 6. Keyboard: Tab reaches controls, focus is always visible.+ await page.keyboard.press("Tab");+ const focus = await page.evaluate(() => {+ const el = document.activeElement;+ if (!el || el === document.body) return { reachable: false };+ const s = getComputedStyle(el);+ return { reachable: true, outline: s.outlineStyle !== "none" || s.boxShadow !== "none", tag: el.tagName };+ });+ record("keyboard", vp.label, "Tab reaches a control", focus.reachable, focus.tag ?? "");+ if (focus.reachable) record("keyboard", vp.label, "focused element shows an indicator", focus.outline, "");++ // 7. No console errors during load.+ record("console", vp.label, "no page or console errors", errors.length === 0, errors.slice(0, 2).join(" | "));++ await page.screenshot({ path: path.join(OUT, `integrations-${vp.label}.png`), fullPage: true }).catch(() => {});+ await context.close();+ }++ // 8. Theme: a dark shell preference must produce dark tokens, not the OS preference.+ for (const scheme of ["light", "dark"]) {+ const context = await browser.newContext({ viewport: { width: 1440, height: 900 }, colorScheme: scheme });+ await context.addInitScript(() => {+ localStorage.setItem("sv:shell", JSON.stringify({ desktop: "macos", mobile: "ios" }));+ localStorage.setItem("mso:onboarding:v1", "done");+ });+ const page = await context.newPage();+ await page.goto(`${fixture.base}/integrations`, { waitUntil: "load", timeout: 60000 });+ await page.waitForTimeout(2500);+ const bg = await page.evaluate(() => getComputedStyle(document.body).backgroundColor);+ record("theme", scheme, "body renders a background", Boolean(bg) && bg !== "rgba(0, 0, 0, 0)", bg);+ await context.close();+ }++ // 9. Short iframe: the drawer must still be reachable.+ {+ const context = await browser.newContext({ viewport: { width: 400, height: 240 } });+ await context.addInitScript(() => {+ localStorage.setItem("sv:shell", JSON.stringify({ desktop: "macos", mobile: "ios" }));+ localStorage.setItem("mso:onboarding:v1", "done");+ });+ const page = await context.newPage();+ await page.goto(`${fixture.base}/integrations/manager`, { waitUntil: "load", timeout: 60000 });+ await page.waitForTimeout(2500);+ const nav = await page.evaluate(() => {+ const el = document.querySelector(".integration-settings-nav");+ if (!el) return null;+ return { height: Math.round(el.getBoundingClientRect().height), scrollable: el.scrollHeight > el.clientHeight };+ });+ record("short-iframe", "240", "sidebar nav keeps usable height", Boolean(nav) && nav.height >= 44, nav ? `height=${nav.height}px scrollable=${nav.scrollable}` : "nav missing");+ await context.close();+ }+} finally {+ await browser.close();+ await fixture.close();+}++const failed = results.filter((r) => !r.ok);+fs.writeFileSync(path.join(OUT, "integrations-ui-evidence.json"), JSON.stringify({ results, failed: failed.length }, null, 2), { mode: 0o600 });+console.log(`\n${results.length - failed.length}/${results.length} checks passed`);+if (failed.length) {+ console.log("\nFAILURES:");+ for (const f of failed) console.log(` ${f.area} @${f.viewport}: ${f.check} (${f.detail})`);+}+process.exitCode = failed.length ? 1 : 0;