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.

fix(a11y): label settings controls and expose selected options

Rahman3523bf8a26c5
diff --git a/components/ui/segmented.tsx b/components/ui/segmented.tsx
index 9138e80d..d5ada178 100644
--- a/components/ui/segmented.tsx
+++ b/components/ui/segmented.tsx
@@ -30,9 +30,10 @@ function Segmented<T extends string>({
type="button"
data-slot="segmented-option"
data-selected={value === o.value}
+ aria-pressed={value === o.value}
onClick={() => onChange(o.value)}
className={cn(
- "flex-1 rounded-md px-2.5 py-1 text-xs font-semibold transition-colors min-h-9 sm:min-h-8",
+ "flex-1 rounded-md px-2.5 py-1 text-xs font-semibold transition-colors min-h-11",
value === o.value
? "bg-primary text-primary-foreground shadow-sm"
: "text-muted-foreground hover:text-foreground",
diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx
index ad83a0e9..24138804 100644
--- a/components/ui/switch.tsx
+++ b/components/ui/switch.tsx
@@ -24,18 +24,11 @@ function Switch({
aria-label={ariaLabel}
disabled={disabled}
onClick={() => onCheckedChange(!checked)}
- className={cn(
- "relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors disabled:opacity-40",
- checked ? "bg-primary" : "bg-muted-foreground/40",
- className,
- )}
+ className={cn("relative inline-flex size-11 shrink-0 items-center justify-center rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:opacity-40", className)}
>
- <span
- className={cn(
- "inline-block size-4 rounded-full bg-white shadow transition-transform",
- checked ? "translate-x-4" : "translate-x-0.5",
- )}
- />
+ <span aria-hidden className={cn("inline-flex h-5 w-9 items-center rounded-full transition-colors", checked ? "bg-primary" : "bg-muted-foreground/40")}>
+ <span className={cn("inline-block size-4 rounded-full bg-primary-foreground shadow transition-transform", checked ? "translate-x-4" : "translate-x-0.5")} />
+ </span>
</button>
);
}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index b64d388a..8733215d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -8,6 +8,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `a11y` label settings controls and expose selected options
- `settings` clarify MCP navigation and enforce zero-warning tests
- persist the ready tunnel process identity after launcher exec
- reject login redirects normalized into external destinations
diff --git a/frontend/slices/os-settings/components/appearance-section.tsx b/frontend/slices/os-settings/components/appearance-section.tsx
index ffc4a5eb..47dbd99c 100644
--- a/frontend/slices/os-settings/components/appearance-section.tsx
+++ b/frontend/slices/os-settings/components/appearance-section.tsx
@@ -41,6 +41,7 @@ function ChoiceCard({
return (
<button
type="button"
+ aria-pressed={active}
onClick={onClick}
className={cn(
"min-h-20 rounded-2xl border bg-card/60 p-2.5 text-left transition hover:bg-accent/70",
@@ -154,7 +155,7 @@ export function AppearanceSection() {
/>
</Row>
<Row label="Reduce transparency">
- <Switch checked={tweaks.reduceGlass} onCheckedChange={(reduceGlass) => setTweaks({ reduceGlass })} />
+ <Switch aria-label="Reduce transparency" checked={tweaks.reduceGlass} onCheckedChange={(reduceGlass) => setTweaks({ reduceGlass })} />
</Row>
{/* Dock controls apply to the macOS dock (desktop surface only). */}
{activeSurface === "desktop" && (
@@ -163,7 +164,7 @@ export function AppearanceSection() {
<Segmented options={DOCK_SIZE_OPTIONS} value={dock.size} onChange={(v) => setDockPrefs({ size: v as DockSize })} />
</Row>
<Row label="Dock magnification">
- <Switch checked={dock.magnify} onCheckedChange={(magnify) => setDockPrefs({ magnify })} />
+ <Switch aria-label="Dock magnification" checked={dock.magnify} onCheckedChange={(magnify) => setDockPrefs({ magnify })} />
</Row>
</>
)}
diff --git a/frontend/slices/os-settings/components/theme-section.tsx b/frontend/slices/os-settings/components/theme-section.tsx
index 1eeb25d8..02ef053c 100644
--- a/frontend/slices/os-settings/components/theme-section.tsx
+++ b/frontend/slices/os-settings/components/theme-section.tsx
@@ -105,7 +105,7 @@ export function ThemeSection() {
<Segmented options={FONT_SCALE_OPTIONS} value={String(tweaks.fontScale)} onChange={(v) => setTweaks({ fontScale: Number(v) })} />
</Row>
<Row label="High contrast">
- <Switch checked={tweaks.highContrast} onCheckedChange={(highContrast) => setTweaks({ highContrast })} />
+ <Switch aria-label="High contrast" checked={tweaks.highContrast} onCheckedChange={(highContrast) => setTweaks({ highContrast })} />
</Row>
</Section>
diff --git a/frontend/slices/shell-settings/components/row.tsx b/frontend/slices/shell-settings/components/row.tsx
index 4006cc6e..4f5d917b 100644
--- a/frontend/slices/shell-settings/components/row.tsx
+++ b/frontend/slices/shell-settings/components/row.tsx
@@ -1,6 +1,6 @@
"use client";
-import type { ReactNode } from "react";
+import { useId, type ReactNode } from "react";
import { cn } from "@/lib/utils";
// One grouped-list row: label left, control right, with a hairline divider drawn
@@ -16,16 +16,19 @@ export function SettingsRow({
children: ReactNode;
className?: string;
}) {
+ const labelId = useId();
return (
<div
data-slot="settings-row"
+ role="group"
+ aria-labelledby={labelId}
className={cn(
"relative flex min-h-[46px] flex-col gap-2 px-4 py-[11px] @min-[600px]:flex-row @min-[600px]:items-center @min-[600px]:justify-between",
"after:absolute after:inset-x-0 after:bottom-0 after:left-4 after:h-px after:bg-border/60 last:after:hidden",
className,
)}
>
- <span data-slot="settings-row-label" className="text-sm text-foreground">{label}</span>
+ <span id={labelId} data-slot="settings-row-label" className="text-sm text-foreground">{label}</span>
<div className="min-w-0 w-full @min-[600px]:w-auto @min-[600px]:shrink-0">{children}</div>
</div>
);
diff --git a/scripts/e2e/mcp-settings.mjs b/scripts/e2e/mcp-settings.mjs
index 4afe16af..492c0fc7 100644
--- a/scripts/e2e/mcp-settings.mjs
+++ b/scripts/e2e/mcp-settings.mjs
@@ -79,3 +79,12 @@ export async function mcpOwnerJourneys(page, fixture) {
expect(errors).toEqual([]);
console.log("PASS MCP failed-load recovery and activity error states");
}
+
+export async function settingsAccessibilityJourney(page, base) {
+ await page.goto(base + "/settings?section=appearance");
+ await expect(page.getByRole("switch", { name: "Reduce transparency", exact: true })).toBeVisible();
+ await expect(page.getByRole("group", { name: "Device preview", exact: true }).getByRole("button", { pressed: true })).toHaveCount(1);
+ await page.goto(base + "/settings?section=theme");
+ await expect(page.getByRole("switch", { name: "High contrast", exact: true })).toBeVisible();
+ await expect(page.getByRole("group", { name: "Text size", exact: true }).getByRole("button", { pressed: true })).toHaveCount(1);
+}
diff --git a/scripts/e2e/release.mjs b/scripts/e2e/release.mjs
index 9ef2c66f..a4c8ea9f 100644
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@ -3,7 +3,7 @@
import { execFileSync } from "node:child_process";
import { chromium, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
-import { mcpOwnerJourneys, mcpPublicJourney } from "./mcp-settings.mjs";
+import { mcpOwnerJourneys, mcpPublicJourney, settingsAccessibilityJourney } from "./mcp-settings.mjs";
import { releaseFixture } from "./release-fixture.mjs";
const fixture = await releaseFixture();
@@ -53,6 +53,7 @@ try {
}).toBe(true);
}
await mcpPublicJourney(page);
+ await settingsAccessibilityJourney(page, fixture.base);
expect(errors).toEqual([]);
await context.close();
console.log(`PASS public guides, login entry, launcher and reflow ${viewport.width}x${viewport.height}`);