Skip to content

armgit / mso

Public Imported from GitHub
0

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.

refactor(integrations): source compact width from responsive SSOT

Rahman0b4e11cdc3d8
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 44f81010..ca2637a2 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -26,6 +26,10 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `integrations` expose native shell and managed SC project bindings
- `mcp` fall back when project MCP discover returns -32601
+**Changed**
+
+- `integrations` source compact width from responsive SSOT
+
## 2026-09-12
**Added**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index fc0ace40..483d0f30 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,7 @@
+## 2026-09-15 — Integrations removes its final local layout constant
+
+The compact master/detail threshold is no longer written directly in Integrations styles. Generated `@container` rules now interpolate `SETTINGS_COMPACT_MAX` from the shared presentation responsive contract. This keeps the unavoidable query value in one reviewed SSOT while provider content, setup and Transfer source files contain no local color, length, typography, radius, spacing or breakpoint constants. The style contract tests both generated CSS and the feature source files to prevent regression.
+
## 2026-09-15 — Integrations content is fully token-driven
The Settings-style Integrations shell and its content pane now consume one semantic visual contract instead of feature-local colors, dimensions, radii, typography, or spacing constants. Provider cards, credential rows, menus, setup forms, Transfer & backup, status pills, buttons, and empty states use shared `background/card/primary/muted/border` aliases plus the MSO widget spacing/type/radius tokens. A regression test rejects feature-local hex/RGB, px/rem visual lengths, numeric font weights, and literal white/black in Integrations styles; only the structural container breakpoint is exempt because CSS custom properties cannot parameterize media/container-query conditions.
diff --git a/lib/infra/connection-ui-style.ts b/lib/infra/connection-ui-style.ts
index fe4f3d5e..a3508e11 100644
--- a/lib/infra/connection-ui-style.ts
+++ b/lib/infra/connection-ui-style.ts
@@ -1,3 +1,4 @@
+import { SETTINGS_COMPACT_MAX } from "@/lib/presentation/responsive-contract";
// Shared by the browser route and the MCP Page; all visual values come from widget/shell semantic tokens.
export const CONNECTION_MANAGER_STYLE = String.raw`
.integration{color:var(--foreground);font:var(--type-small)/var(--line-body) var(--font-body)}
@@ -49,7 +50,7 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .integration-sidebar-footer{flex:none;border-top:var(--stroke) solid var(--border);padding:var(--space-3)}.integration .integration-sidebar-footer button{width:100%;justify-content:center;border-color:transparent;background:transparent;color:var(--muted-foreground)}
.integration .integration-settings-content{min-width:0;min-height:0;overflow-y:auto;background:var(--settings-canvas)}.integration .integration-settings-detail,.integration .identity-feedback{width:min(100%,var(--settings-content-width));margin-inline:auto}.integration .integration-settings-detail{padding:var(--space-5);padding-bottom:max(var(--space-5),env(safe-area-inset-bottom))}.integration .identity-feedback{padding:0 var(--space-5) var(--space-5)}
.integration .integration-mobile-toolbar{display:none}.integration .integration-sidebar-backdrop{display:none}.integration .integration-sidebar-toggle{min-height:var(--control-size)}
-@container integration (max-width:37.5rem){
+@container integration (max-width:${SETTINGS_COMPACT_MAX}){
.integration .integration-settings-shell{display:block;position:relative;min-height:100%}
.integration .integration-settings-sidebar{position:absolute;inset:0 auto 0 0;z-index:var(--settings-layer-drawer);width:min(100%,var(--settings-sidebar-sheet-width));transform:translateX(-100%);transition:transform var(--settings-transition);box-shadow:var(--shadow-pop)}
.integration .integration-settings-sidebar[data-open=true]{transform:translateX(0)}
diff --git a/lib/infra/integration-style-contract.test.ts b/lib/infra/integration-style-contract.test.ts
index 39f92aab..cefcd0d4 100644
--- a/lib/infra/integration-style-contract.test.ts
+++ b/lib/infra/integration-style-contract.test.ts
@@ -3,6 +3,8 @@ import { CONNECTION_MANAGER_STYLE } from "./connection-ui-style";
import { INTEGRATION_FORM_STYLE } from "./setup-ui";
import { PORTABILITY_STYLE } from "./portable/ui";
import { INTEGRATION_PAGE_STYLE } from "./setup-page";
+import { SETTINGS_COMPACT_MAX } from "@/lib/presentation/responsive-contract";
+import { readFileSync } from "node:fs";
const styles = {
manager: CONNECTION_MANAGER_STYLE,
@@ -11,16 +13,16 @@ const styles = {
page: INTEGRATION_PAGE_STYLE,
};
-// CSS custom properties cannot be substituted inside container-query conditions,
-// so the one shared structural breakpoint is intentionally exempt. Every visual
-// declaration inside the feature must consume semantic tokens instead of literals.
-function withoutStructuralBreakpoint(css: string) {
- return css.replaceAll("37.5rem", "TOKEN_BREAKPOINT");
+// CSS custom properties cannot be substituted inside container-query conditions.
+// The generated CSS receives the query threshold from the shared responsive SSOT;
+// feature source files themselves must not own that value.
+function withoutSharedBreakpoint(css: string) {
+ return css.replaceAll(SETTINGS_COMPACT_MAX, "TOKEN_BREAKPOINT");
}
describe("Integrations visual token contract", () => {
it.each(Object.entries(styles))("%s has no feature-local colors or absolute visual lengths", (_name, css) => {
- const value = withoutStructuralBreakpoint(css);
+ const value = withoutSharedBreakpoint(css);
expect(value).not.toMatch(/#[0-9a-f]{3,8}\b/i);
expect(value).not.toMatch(/rgba?\s*\(/i);
expect(value).not.toMatch(/hsla?\s*\(/i);
@@ -39,4 +41,12 @@ describe("Integrations visual token contract", () => {
expect(CONNECTION_MANAGER_STYLE).toContain("color:var(--settings-action-text)");
expect(INTEGRATION_FORM_STYLE).toContain("color:var(--settings-action-text)");
});
+ it("keeps the structural query threshold outside Integrations feature source", () => {
+ for (const file of ["connection-ui-style.ts", "setup-ui.ts", "portable/ui.ts"]) {
+ const source = readFileSync(new URL(file, import.meta.url), "utf8");
+ expect(source).not.toContain(SETTINGS_COMPACT_MAX);
+ expect(source).toContain("SETTINGS_COMPACT_MAX");
+ }
+ });
+
});
diff --git a/lib/infra/portable/ui.ts b/lib/infra/portable/ui.ts
index af2023ea..90ac3128 100644
--- a/lib/infra/portable/ui.ts
+++ b/lib/infra/portable/ui.ts
@@ -1,3 +1,4 @@
+import { SETTINGS_COMPACT_MAX } from "@/lib/presentation/responsive-contract";
// Owner-only transfer workbench. The default Integrations screen stays simple;
// this surface is opened explicitly from Integrations sidebar → Transfer & backup.
export const PORTABILITY_SCRIPT=String.raw`
@@ -70,5 +71,5 @@ export const PORTABILITY_STYLE=String.raw`
.portable-transfer .identity-check{display:flex;gap:var(--space-2);align-items:center;font-weight:var(--weight-regular)}.portable-transfer .identity-check input{width:var(--icon-size);height:var(--icon-size);margin:0;order:-1;flex:none;accent-color:var(--primary)}
.portable-transfer .transfer-tree{max-height:var(--settings-scroll-max-height);overflow:auto;margin:var(--space-3) 0;padding:var(--space-3);border:var(--stroke) solid var(--border);border-radius:var(--radius-control);background:var(--background)}.portable-transfer .transfer-tree-user{padding:var(--space-2) 0;border-bottom:var(--stroke) solid var(--border)}.portable-transfer .transfer-tree-provider{padding-left:var(--space-6)}.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:var(--space-6);color:var(--muted-foreground)}
.portable-transfer pre{max-height:var(--settings-code-max-height);overflow:auto;font:var(--type-caption)/var(--line-body) var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--muted);border-radius:var(--radius-control);padding:var(--space-3)}.portable-transfer [role=status]{font-size:var(--type-small);overflow-wrap:anywhere}.portable-transfer .transfer-hint{font-size:var(--type-caption);color:var(--muted-foreground);margin-top:var(--space-3)}.portable-transfer button{min-height:var(--control-size);margin:var(--space-2) var(--space-2) var(--space-2) 0}
-@container integration (max-width:37.5rem){.portable-transfer .transfer-card{padding:var(--space-4)}.portable-transfer .transfer-tabs button{flex:1}.portable-transfer .transfer-tree-provider,.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:var(--space-3)}}
+@container integration (max-width:${SETTINGS_COMPACT_MAX}){.portable-transfer .transfer-card{padding:var(--space-4)}.portable-transfer .transfer-tabs button{flex:1}.portable-transfer .transfer-tree-provider,.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:var(--space-3)}}
`;
diff --git a/lib/infra/setup-ui.ts b/lib/infra/setup-ui.ts
index 44c1b578..88bfcd96 100644
--- a/lib/infra/setup-ui.ts
+++ b/lib/infra/setup-ui.ts
@@ -1,3 +1,4 @@
+import { SETTINGS_COMPACT_MAX } from "@/lib/presentation/responsive-contract";
// The same DOM-only form runs in a temporary browser page and in MSO Page.
// No input, capability, or provider response is sent through the MCP bridge.
export const INTEGRATION_FORM_STYLE = String.raw`
@@ -9,7 +10,7 @@ export const INTEGRATION_FORM_STYLE = String.raw`
.integration .input-row{display:flex;gap:var(--space-2)}.integration .input-row input{flex:1;width:0}.integration button{font-size:var(--type-small);min-height:var(--control-size);white-space:normal}.integration .field{margin-bottom:var(--space-4);min-width:0}.integration small{display:block;margin-top:var(--space-1);color:var(--muted-foreground);overflow-wrap:anywhere}
.integration details{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-3);background:var(--settings-card);margin:var(--space-3) 0}.integration summary{cursor:pointer;font-weight:var(--weight-strong)}.integration li{margin:var(--space-2) 0}.integration a{color:var(--settings-action-text);text-underline-offset:var(--space-1);overflow-wrap:anywhere}.integration .setup-status{min-height:var(--control-size);overflow-wrap:anywhere}.integration button:disabled{cursor:not-allowed;opacity:var(--settings-disabled-opacity)}
.integration .setup-tag{display:inline-block;border:var(--stroke) solid var(--border);border-radius:var(--radius-pill);padding:var(--space-1) var(--space-3);margin-bottom:var(--space-3);font-size:var(--type-caption);background:var(--muted)}.integration .setup-actions{display:flex;gap:var(--space-2);flex-wrap:wrap}.integration .primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
-@container integration (max-width:37.5rem){.integration .setup-grid{grid-template-columns:1fr;gap:0}}
+@container integration (max-width:${SETTINGS_COMPACT_MAX}){.integration .setup-grid{grid-template-columns:1fr;gap:0}}
`;
export const INTEGRATION_FORM_SCRIPT = String.raw`
diff --git a/lib/presentation/responsive-contract.ts b/lib/presentation/responsive-contract.ts
new file mode 100644
index 00000000..8307bb2b
--- /dev/null
+++ b/lib/presentation/responsive-contract.ts
@@ -0,0 +1,6 @@
+/**
+ * Shared width contracts for Settings-like master/detail surfaces rendered as
+ * generated CSS resources. CSS custom properties cannot be used in @media or
+ * @container conditions, so query thresholds live here as one reviewed SSOT.
+ */
+export const SETTINGS_COMPACT_MAX = "37.5rem" as const;
diff --git a/package.json b/package.json
index 9de1fc11..9c722f44 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mso",
- "version": "0.2.14",
+ "version": "0.2.15",
"private": true,
"engines": {
"node": ">=20.9",