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(a11y): close the four keyboard defects the audit found
Abdurrahman Fakhrul29504715074f
diff --git a/app/os-root.tsx b/app/os-root.tsxindex 384f6d6d..ff7ffbe6 100644--- a/app/os-root.tsx+++ b/app/os-root.tsx@@ -66,7 +66,7 @@ export function OsRoot({<QuicklinksProvider><A11yCommands /><a- href="#main-content"+ href="#shell-main"className="sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-[var(--z-skip-link)] focus:rounded-md focus:bg-foreground focus:px-3 focus:py-2 focus:text-background focus:outline-2 focus:outline-ring">Skip to main contentdiff --git a/frontend/slices/appshell/components/mobile-shell.tsx b/frontend/slices/appshell/components/mobile-shell.tsxindex 476234c3..590d029a 100644--- a/frontend/slices/appshell/components/mobile-shell.tsx+++ b/frontend/slices/appshell/components/mobile-shell.tsx@@ -155,7 +155,7 @@ export function MobileShell() {{/* --sai-top (notch/Dynamic-Island floor) now comes from the shared[data-shell="ios"] rule in globals.css — one source of truth for bothtouch shells, inherited by every iOS surface (home, nav, spotlight). */}- <div className={cn("absolute inset-0 z-[10] flex flex-col", locked && "invisible")} inert={locked || undefined}>+ <div id="shell-main" role="main" tabIndex={-1} className={cn("absolute inset-0 z-[10] flex flex-col", locked && "invisible")} inert={locked || undefined}><divdata-slot="system-status-host"data-status-placement="ios-status-bar"diff --git a/frontend/slices/appshell/components/shells/macos/macos-shell.tsx b/frontend/slices/appshell/components/shells/macos/macos-shell.tsxindex d90fa832..585c83db 100644--- a/frontend/slices/appshell/components/shells/macos/macos-shell.tsx+++ b/frontend/slices/appshell/components/shells/macos/macos-shell.tsx@@ -62,6 +62,13 @@ export function DesktopChrome() {<><MenuBar /><section+ // The skip link targets the desktop, not #main-content: that wrapper also contains the+ // menu bar, so skipping to it skipped nothing. tabIndex -1 makes it focusable+ // programmatically without adding a tab stop; role="main" is what tells assistive tech+ // this is the primary content region.+ id="shell-main"+ role="main"+ tabIndex={-1}style={{ top: TOPBAR }}className={cn("absolute inset-x-0 bottom-0 z-[10]", interactive && "pointer-events-none [&>*]:pointer-events-auto")}// Open the desktop menu for any right-click NOT inside a window. Icons +diff --git a/frontend/slices/appshell/components/shells/windows/windows-shell.tsx b/frontend/slices/appshell/components/shells/windows/windows-shell.tsxindex c672c95c..f81aa7a4 100644--- a/frontend/slices/appshell/components/shells/windows/windows-shell.tsx+++ b/frontend/slices/appshell/components/shells/windows/windows-shell.tsx@@ -63,6 +63,9 @@ function WindowsShell() {an interactive live wallpaper is active it goes click-through so thewallpaper gets empty-desktop clicks; windows stay interactive. */}<section+ id="shell-main"+ role="main"+ tabIndex={-1}className={cn("absolute inset-0 z-[10]", interactive && "pointer-events-none [&>*]:pointer-events-auto")}// Any right-click not inside a window opens the desktop menu (icons/widgets// stopPropagation; windows carry [data-window]). Generalizes the old strictdiff --git a/lib/infra/connection-ui.ts b/lib/infra/connection-ui.tsindex 2f02b727..08a10d06 100644--- a/lib/infra/connection-ui.ts+++ b/lib/infra/connection-ui.ts@@ -30,7 +30,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){async function reload(){const version=++sequence;if(!bridge.query){draw();return}try{const next=await bridge.query({view:"snapshot",...(user?{user}:{})});if(disposed||version!==sequence)return;snapshot=next;user=next.user||user;draw();remember()}catch(e){if(!disposed){draw();status.textContent=textError(e)}}}async function change(args,after=reload){if(!bridge.manage)return;try{status.textContent="Saving connection metadata…";await bridge.manage({...args,confirm:true});await after()}catch(e){status.textContent=textError(e)}}function guide(method,parent=detail){const d=n("details",undefined,"identity-guide");d.open=parent!==detail;d.append(n("summary","How to get this credential / authorization"));const g=method.guidance,ol=n("ol");for(const step of g.steps)ol.append(n("li",step));d.append(ol);for(const[url,label]of [[g.url,"Official setup page"],[g.reference,"Documentation"]]){const a=n("a",label);a.href=url;a.rel="noopener noreferrer";a.target="_blank";if(bridge.openLink)a.addEventListener("click",e=>{e.preventDefault();Promise.resolve(bridge.openLink(url)).catch(error=>status.textContent=textError(error))});d.append(a)}parent.append(d)}- function setSidebar(open){const wasOpen=sidebarOpen;sidebarOpen=Boolean(open);if(sidebarPanel)sidebarPanel.dataset.open=String(sidebarOpen);if(sidebarBackdrop)sidebarBackdrop.hidden=!sidebarOpen;if(sidebarToggle)sidebarToggle.setAttribute("aria-expanded",String(sidebarOpen));if(content){content.inert=sidebarOpen;if(sidebarOpen)content.setAttribute("inert","");else content.removeAttribute("inert");}if(sidebarOpen)setTimeout(()=>sidebarPanel?.focus(),0);else if(wasOpen&&sidebarToggle)setTimeout(()=>sidebarToggle.focus(),0)}+ function setSidebar(open){const wasOpen=sidebarOpen;sidebarOpen=Boolean(open);if(sidebarPanel)sidebarPanel.dataset.open=String(sidebarOpen);if(sidebarBackdrop)sidebarBackdrop.hidden=!sidebarOpen;if(sidebarToggle)sidebarToggle.setAttribute("aria-expanded",String(sidebarOpen));if(content){content.inert=sidebarOpen;if(sidebarOpen)content.setAttribute("inert","");else content.removeAttribute("inert");}if(sidebarPanel){sidebarPanel.inert=!sidebarOpen;if(sidebarOpen)sidebarPanel.removeAttribute("inert");else sidebarPanel.setAttribute("inert","")}if(sidebarOpen)setTimeout(()=>sidebarPanel?.focus(),0);else if(wasOpen&&sidebarToggle)setTimeout(()=>sidebarToggle.focus(),0)}function activateNav(mode){navMode=mode;for(const entry of navButtons){const on=entry.mode===mode&&(mode!=="provider"||entry.provider===provider.id);entry.button.setAttribute("aria-current",on?"page":"false");entry.button.setAttribute("aria-pressed",String(on))}}function showProfiles(){navMode="owners";activateNav(navMode);setSidebar(false);profiles()}function showBindings(){navMode="routing";activateNav(navMode);setSidebar(false);bindings()}@@ -57,7 +57,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){function draw(){root.replaceChildren();root.classList.add("integration","manager");const shell=n("div",undefined,"integration-settings-shell");- sidebarBackdrop=b("",()=>setSidebar(false),"integration-sidebar-backdrop");sidebarBackdrop.hidden=true;sidebarBackdrop.setAttribute("aria-label","Close Integrations sections");+ sidebarBackdrop=b("",()=>setSidebar(false),"integration-sidebar-backdrop");sidebarBackdrop.addEventListener("keydown",event=>{if(event.key==="Escape"){event.preventDefault();setSidebar(false)}});sidebarBackdrop.hidden=true;sidebarBackdrop.setAttribute("aria-label","Close Integrations sections");sidebarPanel=n("aside",undefined,"integration-settings-sidebar");sidebarPanel.id="integration-settings-sidebar";sidebarPanel.dataset.open="false";sidebarPanel.tabIndex=-1;const sidebarHeader=n("div",undefined,"integration-sidebar-header"),brand=n("div",undefined,"integration-sidebar-brand"),brandIcon=n("span",undefined,"integration-brand-icon"),brandCopy=n("span");brandIcon.setAttribute("aria-hidden","true");const brandSvg=typeof DOMParser!=="undefined"?new DOMParser().parseFromString(MSO_LOGO_SVG,"image/svg+xml").documentElement:null;if(brandSvg)brandIcon.append(brandSvg);brandCopy.append(n("strong","MSO"),n("small","Integrations"));brand.append(brandIcon,brandCopy);const search=n("input");search.type="search";search.placeholder="Search";search.setAttribute("aria-label","Search integrations");@@ -185,7 +185,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){const rows=snapshot.connections.filter(c=>c.provider===provider.id);if(rows.length){const count=rows.filter(ready).length;detail.append(n("p",rows.length+" connection"+(rows.length===1?"":"s")+" · "+count+" verified","identity-summary-line"));}if(!rows.length){const empty=n("div",undefined,"identity-empty");empty.append(n("h3","Connect "+provider.title),n("p",user?"Add an account to start using "+provider.title+" in your projects.":bridge.manage?"Select a credential owner to add an account.":"Read the setup guide below, then sign in to connect your account."));const start=b("Add "+provider.title+" account",newConnection,"primary");start.disabled=!user||!bridge.manage;if(bridge.manage)empty.append(start);detail.append(empty);const help=n("details");help.append(n("summary","Connection methods & setup guides"));for(const s of provider.sources)for(const m of s.methods){const info=n("section");info.append(n("h3",s.label+" · "+m.label));guide(m,info);help.append(info)}detail.append(help)}- for(const c of rows){const card=n("article",undefined,"connection-card");const top=n("header",undefined,"connection-heading"),name=n("div");name.append(n("h3",c.label),n("small",c.id));const state=n("span",stateLabel(c),"connection-state");state.dataset.ready=String(ready(c));top.append(name,state);card.append(top);const tags=n("div",undefined,"identity-tags");for(const value of [human(c.source),human(c.authMethod),c.sharedFrom?"Shared from "+c.sharedFrom.user:"",c.isDefault?"Default account":""])if(value)tags.append(n("span",value));card.append(tags);const actions=n("div",undefined,"identity-actions"),more=n("details",undefined,"identity-tools"),secondary=n("div",undefined,"identity-actions");more.append(n("summary","More"));more.append(secondary);+ for(const c of rows){const card=n("article",undefined,"connection-card");const top=n("header",undefined,"connection-heading"),name=n("div");name.append(n("h3",c.label),n("small",c.id));const state=n("span",stateLabel(c),"connection-state");state.dataset.ready=String(ready(c));top.append(name,state);card.append(top);const tags=n("div",undefined,"identity-tags");for(const value of [human(c.source),human(c.authMethod),c.sharedFrom?"Shared from "+c.sharedFrom.user:"",c.isDefault?"Default account":""])if(value)tags.append(n("span",value));card.append(tags);const actions=n("div",undefined,"identity-actions"),more=n("details",undefined,"identity-tools"),secondary=n("div",undefined,"identity-actions");more.addEventListener("keydown",event=>{if(event.key==="Escape"){event.preventDefault();more.open=false;const summary=more.querySelector("summary");if(summary)summary.focus()}});more.addEventListener("toggle",()=>{if(!more.open)return;const away=event=>{if(!more.contains(event.target)){more.open=false;document.removeEventListener("pointerdown",away,true)}};document.addEventListener("pointerdown",away,true)});more.append(n("summary","More"));more.append(secondary);if(provider.nativeGoogle&&!provider.configurationOnly){mountNativeGoogleConnection(card,c,{n,b,user,provider,catalog,snapshot,bridge,status,reload,selectProvider});detail.append(card);continue}const open=b(c.source==="direct"?(c.fields.some(f=>f.stored)?"Update credentials":"Finish setup"):"Authorize",()=>{if(c.source==="direct")void bridge.openSetup({user,provider:provider.id,connection:c.id}).catch(e=>status.textContent=textError(e));else external(c)});open.disabled=!bridge.manage;if(!c.sharedFrom)actions.append(open);const verify=b("Verify",async()=>{try{status.textContent="Checking selected connection…";const result=await bridge.execute({user,provider:provider.id,connection:c.id,operation:"verify"});await reload();status.textContent=(result.ok===true?"Verified: ":"Status: ")+result.detail}catch(e){status.textContent=textError(e)}});verify.disabled=!bridge.execute;actions.append(verify);diff --git a/lib/infra/integration-keyboard-a11y.test.ts b/lib/infra/integration-keyboard-a11y.test.tsnew file mode 100644index 00000000..b301a8c4--- /dev/null+++ b/lib/infra/integration-keyboard-a11y.test.ts@@ -0,0 +1,55 @@+import { readFileSync } from "node:fs";+import { describe, expect, it } from "vitest";++// Four keyboard defects found by a browser audit of the integrations page. All four are the kind+// that pass every unit test: they are about what the DOM does when you press keys, not about what+// the code says.+//+// 1. the skip link pointed at #main-content, which wraps the menu bar, so skipping to it skipped+// nothing, and the target was not focusable+// 2. the closed mobile drawer was only translated off-screen, so its 30 items stayed in the tab+// order and a keyboard user passed 31 invisible stops before reaching the toggle+// 3. the full-screen backdrop is a Tab stop, but the Escape handler lived on the panel, so Escape+// did nothing while focus was on it+// 4. the "More" popover is a <details> with no Escape and no outside-click close, so Tab left it+// open over the next card++const read = (p: string) => readFileSync(p, "utf8");++describe("skip link reaches the primary content", () => {+ it("targets a focusable element that is not the whole-shell wrapper", () => {+ const osRoot = read("app/os-root.tsx");+ expect(osRoot, "the old target wrapped the menu bar, so it skipped nothing").not.toContain('href="#main-content"');+ expect(osRoot).toContain('href="#shell-main"');+ });++ it.each([+ ["frontend/slices/appshell/components/shells/macos/macos-shell.tsx", "macos"],+ ["frontend/slices/appshell/components/shells/windows/windows-shell.tsx", "windows"],+ ["frontend/slices/appshell/components/mobile-shell.tsx", "mobile"],+ ])("%s provides the target and a main landmark", (file) => {+ const src = read(file);+ expect(src, `${file} must carry the skip target`).toContain('id="shell-main"');+ expect(src, `${file} must declare the primary region`).toContain('role="main"');+ // tabIndex -1 makes it focusable by the hash jump without adding a tab stop of its own.+ expect(src).toMatch(/tabIndex=\{-1\}/);+ });+});++describe("integrations sidebar keyboard behaviour", () => {+ const src = read("lib/infra/connection-ui.ts");++ it("makes the closed drawer inert so its items leave the tab order", () => {+ expect(src, "a translated-off-screen drawer is still focusable").toContain("sidebarPanel.inert=!sidebarOpen");+ });++ it("lets the backdrop answer Escape, not just the panel", () => {+ expect(src).toContain("sidebarBackdrop.addEventListener");+ });++ it("closes the More popover on Escape and on an outside click", () => {+ expect(src).toContain('more.addEventListener("keydown"');+ expect(src).toContain('more.addEventListener("toggle"');+ expect(src).toMatch(/more\.open=false/);+ });+});