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(ux): make boot splash route-safe and preserve deferred Spotlight loading

rahmanefe27a12a68ce7
diff --cc app/boot-splash.tsx
index 00000000,00000000..4fbf8aca
new file mode 100644
--- /dev/null
+++ b/app/boot-splash.tsx
@@@ -1,0 -1,0 +1,18 @@@
++"use client";
++
++import { useSyncExternalStore } from "react";
++const subscribe = () => () => {};
++
++export function BootSplash() {
++ const booting = useSyncExternalStore(subscribe, () => false, () => true);
++ if (!booting) return null;
++ return (
++ <div id="mso-boot-splash" aria-hidden="true" style={{
++ position: "fixed", inset: 0, zIndex: 2147483000, display: "grid",
++ placeItems: "center", pointerEvents: "none",
++ background: "var(--mso-boot-background, linear-gradient(145deg, #d3c5bd 0%, #d9dce7 56%, #b7c8dc 100%))",
++ }}>
++ <div className="mso-boot-spinner" />
++ </div>
++ );
++}
diff --cc app/globals.css
index f3860b8e,75c8ecb2..59fcd53a
--- a/app/globals.css
+++ b/app/globals.css
@@@ -233,6 -233,6 +233,14 @@@ body
touch-action: manipulation;
}
++.mso-boot-spinner {
++ width: 24px; height: 24px;
++ border: 2px solid rgba(255,255,255,.9); border-top-color: transparent;
++ border-radius: 50%; animation: mso-boot-spin .8s linear infinite;
++}
++@keyframes mso-boot-spin { to { transform: rotate(360deg); } }
++@media (prefers-reduced-motion: reduce) { .mso-boot-spinner { animation: none; } }
++
/* glass helper — applied alongside theme tokens, never raw hex in components */
.glass {
-webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
diff --cc app/layout.tsx
index 816ff845,6559d087..77785828
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@@ -5,6 -5,6 +5,7 @@@ import { GeistMono } from "./mono-font"
import { RegisterSW } from "./register-sw";
import { InstallPrompt } from "./install-prompt";
import "./globals.css";
++import { BootSplash } from "./boot-splash";
import { publicMsoOrigin } from "@/lib/mcp/ui-config";
export function generateMetadata(): Metadata {
@@@ -88,41 -88,9 +89,10 @@@ export default async function RootLayou
suppressHydrationWarning
dangerouslySetInnerHTML={{
__html:
- 'try{var t=JSON.parse(localStorage.getItem("mso:tweaks"));if(t&&t.theme)document.documentElement.dataset.theme=t.theme;var s=document.getElementById("mso-boot-splash");if(s&&t&&t.theme==="dark")s.style.background="linear-gradient(145deg,#161629 0%,#10152c 58%,#0b1223 100%)";}catch(e){}',
- 'try{var t=JSON.parse(localStorage.getItem("mso:tweaks"));if(t&&t.theme)document.documentElement.dataset.theme=t.theme;}catch(e){}',
++ 'try{var t=JSON.parse(localStorage.getItem("mso:tweaks"));if(t&&t.theme)document.documentElement.dataset.theme=t.theme;if(t&&t.theme==="dark")document.documentElement.style.setProperty("--mso-boot-background","linear-gradient(145deg,#161629 0%,#10152c 58%,#0b1223 100%)");}catch(e){}',
}}
/>
- {/* Pre-paint boot splash (UX-02): wallpaper gradient + spinner so cold
- load is not blank grey while JS/CSS hydrate. Removed by OsRoot. */}
- <div
- id="mso-boot-splash"
- aria-hidden="true"
- style={{
- position: "fixed",
- inset: 0,
- zIndex: 2147483000,
- display: "grid",
- placeItems: "center",
- background:
- "linear-gradient(145deg, #d3c5bd 0%, #d9dce7 56%, #b7c8dc 100%)",
- pointerEvents: "none",
- }}
- >
- <div
- style={{
- width: 24,
- height: 24,
- border: "2px solid rgba(255,255,255,0.9)",
- borderTopColor: "transparent",
- borderRadius: "50%",
- animation: "mso-boot-spin 0.8s linear infinite",
- }}
- />
- <style
- dangerouslySetInnerHTML={{
- __html: "@keyframes mso-boot-spin{to{transform:rotate(360deg)}}",
- }}
- />
- </div>
++ <BootSplash />
{children}
<RegisterSW />
<InstallPrompt />
diff --cc docs/PROGRESS.md
index 42ddb099,ef8425ec..8c9a7de8
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@@ -1,3 -1,19 +1,23 @@@
++## 2026-10-08: Make shell startup and Spotlight feedback reliable
++
++The boot splash now removes itself on hydration on every route, including the standalone Integrations and OAuth pages, and uses the saved theme before hydration. Spotlight reports pending folder searches and retries focus after its deferred mount while retaining first-open lazy loading. Its foreground and placeholder colors remain readable over the desktop wallpaper. The update badge uses the Settings public entry point and sits above the separate install prompt. The release journey checks that the standalone Integrations page has no remaining boot overlay.
++
+ ## 2026-10-08: Complete the scan hardening audit and repair verification
+
+ The three Codex Security Cloud scans overlap across authority, credentials, ingress, resource ceilings and installation provenance. The security branch now includes webhook authentication, distinct PAT principals, refresh-family replay revocation, explicit exec authority for loopback discovery, immutable managed-app update targets, provider environment SecretRefs, proven gateway ownership, bounded audit tails, backup retention and pinned NodeSource bootstrap bytes.
+
+ Independent verification additionally found that archive admission ended before its unlinked output descriptor closed, temporary-directory failure could strand admission, and delegated write could replace user-local launchers or their parent directories. The shared guards now cover those paths and managed-runtime trees; archive admission lasts until stream closure with a bounded lifetime. Backups recheck file/byte limits during copying and remove incomplete snapshots on failure. Installer bootstrap checksums were refreshed after the core hardening. Gateway test launchers now emit valid JavaScript, and the equivalent listener-port comparison parses correctly under strict Semgrep. OAuth and workflow fixtures explicitly exercise replay revocation and live approved-device authority.
+
+ These are source and verification changes. Production deployment and scan closure require the verified main revision and live runtime evidence; local tests alone do not establish either.
+
+ ## 2026-10-07: Harden delegated workflow, ingress and credential boundaries
+
+ Two repository security scans (October 2 and October 7) exposed overlapping authority and ingress gaps. Project dotenv files are now credential material everywhere, recursive archives exclude them, exact-loopback A2A is opt-in, and pre-auth A2A traffic cannot evict authenticated rate-limit state. Project ingress requires bounded framing and forwards only protocol headers, not cockpit cookies or Authorization.
+
+ Workflow Graph execution now treats stored definitions as data rather than grants: live web-device role and deployment scope are rechecked before execution, Operator authority caps at write, unattended stored non-web principals fail closed, error workflows carry ancestry, and typed/short secret variables are redacted from receipts. Public JSON/form readers used by login, OAuth, Discord and setup enforce actual byte ceilings and deadlines before parsing; login admission is reserved before password comparison so a distributed source cannot continue the password oracle past the global budget. OAuth consent now describes the real breadth of write authority.
+
+ Regression coverage was added for these boundaries. This entry does not claim closure of the remaining archive-size, backup-retention, audit-growth, installer-supply-chain, OpenClaw argv, workflow-webhook authentication, or write-to-control-plane findings; those require separate verified changes.
+
## 2026-10-06: Patch source-map-js and retain the 9Router proposal
Hosted Verify and OSV identified GHSA-68fv-2mgg-jv7q in the locked source-map-js 1.2.1 dependency. The targeted update resolves it to the patched 1.2.2 without changing package ranges, audit policy or existing dependency patches. A fresh frozen install loads the native PTY module, and both strict and native Bun audits are clean. Full combined-head repository, build, browser and security verification remains required before integration.
diff --cc frontend/slices/appshell/features/search/components/spotlight.tsx
index c801dadf,a54cb1e8..9f455306
--- a/frontend/slices/appshell/features/search/components/spotlight.tsx
+++ b/frontend/slices/appshell/features/search/components/spotlight.tsx
@@@ -15,8 -15,8 +15,7 @@@ import { matches, type Command } from "
import { loadRecents, pushRecent } from "../history";
import { ResultList } from "./spotlight-results";
--// The panel MOUNTS per open (and unmounts on close), so query/selection state
--// starts fresh every time without effect-driven resets (set-state-in-effect).
++// Mount per open so query and selection reset together.
export function Spotlight() {
const open = useSpotlightOpen();
return open ? <SpotlightPanel /> : null;
@@@ -29,25 -29,18 +28,20 @@@ function SpotlightPanel()
const { theme, setTheme } = useShellAppearance();
const [q, setQ] = useState("");
const [sel, setSel] = useState(0);
-- // Read MRU once per open (panel mounts on open), so recents refresh each time.
const [recents] = useState(loadRecents);
const inputRef = useRef<HTMLInputElement>(null);
+ // Ignore backdrop dismiss for the opening gesture (hot-corner / first click race).
+ const dismissReady = useRef(false);
const LISTBOX_ID = "spotlight-listbox";
const ios = useActiveShell().id === "ios"; // iOS = top-anchored full-width search over the wallpaper
-- // Debounced folder search under ~/projects (live) — opens Files at the hit.
-- // Results are state, but "no query → no hits" is derived below (stale hits
-- // stay visible during the debounce, matching the old behaviour).
++ // Keep prior folder results visible during the debounce.
const [found, setFound] = useState<{ key: string; hits: SearchHit[]; error?: string } | null>(null);
const folderHits = useMemo(() => (q.trim() ? (found?.hits ?? []) : []), [q, found]);
- const searchError = q.trim() && found?.key === q.trim() ? found.error : undefined;
+ const trimmed = q.trim();
+ const searchError = trimmed && found?.key === trimmed ? found.error : undefined;
- // Pending while a non-empty query has not yet settled on matching folder hits
- // (debounce + in-flight). Commands may already match; empty-command + pending
- // must not flash "No matches" (UX-05).
++ // Do not report no matches until the folder query settles.
+ const folderPending = Boolean(trimmed && found?.key !== trimmed);
useEffect(() => {
const query = q.trim();
if (!query) return;
@@@ -55,9 -48,9 +49,6 @@@
const t = setTimeout(() => {
search(query)
.then((h) => alive && setFound({ key: query, hits: h }))
-- // Keep the reason. Reporting a dead host API as "No matches" is a lie the
-- // user cannot act on — an expired session looks exactly like an empty
-- // folder. Files does this right (use-files.ts toasts the real message).
.catch((e: unknown) => {
const msg = e instanceof Error ? e.message : String(e);
if (alive) setFound({ key: query, hits: [], error: msg });
@@@ -88,7 -81,7 +79,6 @@@
run: () => setTheme(theme === "dark" ? "light" : "dark"),
},
];
-- // Registry-contributed commands (apps/features/shells register at runtime).
const registered: Command[] = dynamic.map((c) => ({
id: c.id,
label: c.label,
@@@ -101,8 -94,8 +91,6 @@@
const results = useMemo(() => {
let base = commands.filter((c) => matches(q, c.keywords ? `${c.label} ${c.keywords}` : c.label));
-- // Empty query → float recently-run commands to the top (recency order).
-- // Array.sort is stable, so non-recent commands keep their catalog order.
if (!q.trim() && recents.length) {
const rank = new Map(recents.map((id, i) => [id, i]));
base = [...base].sort((a, b) => (rank.get(a.id) ?? Infinity) - (rank.get(b.id) ?? Infinity));
@@@ -116,34 -109,19 +104,29 @@@
return [...base, ...folderCmds];
}, [commands, q, folderHits, recents]);
-- // Focus the input after the open transition paints (mount = open), and on
-- // close return focus to whatever was focused before — so keyboard/AT users
-- // aren't dumped at the top of the document when Spotlight dismisses.
- // Double rAF + short timeout covers deferred-chunk mount (UX-04).
++ // Retry focus after deferred mount; restore the opener on close.
useEffect(() => {
const prev = document.activeElement as HTMLElement | null;
- const id = requestAnimationFrame(() => inputRef.current?.focus());
+ let cancelled = false;
+ const focus = () => {
+ if (!cancelled) inputRef.current?.focus();
+ };
+ const id1 = requestAnimationFrame(() => {
+ focus();
+ requestAnimationFrame(focus);
+ });
+ const id2 = window.setTimeout(focus, 50);
+ const ready = window.setTimeout(() => {
+ dismissReady.current = true;
+ }, 180);
return () => {
- cancelAnimationFrame(id);
+ cancelled = true;
+ cancelAnimationFrame(id1);
+ window.clearTimeout(id2);
+ window.clearTimeout(ready);
prev?.focus?.();
};
}, []);
--
-- // Clamp the selection in render when results shrink — no clamp effect.
const selIdx = Math.min(sel, Math.max(0, results.length - 1));
const close = () => setSpotlightOpen(false);
diff --cc frontend/slices/os-settings/components/update-shell-badge.tsx
index 5886507e,00000000..e9df693a
mode 100644,000000..100644
--- a/frontend/slices/os-settings/components/update-shell-badge.tsx
+++ b/frontend/slices/os-settings/components/update-shell-badge.tsx
@@@ -1,62 -1,0 +1,62 @@@
+"use client";
+
+import { useEffect, useState } from "react";
+import { ArrowDownToLine } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { defineFeature, openWindow } from "@/features/appshell";
+import { useSession } from "@/features/auth";
+import { IS_DEMO } from "@/lib/demo";
+import { hasAvailableUpdate, readStatus } from "./update-status-client";
+
+/**
+ * Shell-level "new version" affordance (UX-10) — dock-adjacent, not buried in
+ * Account. Settings nav badge (`UpdateNavBadge`) stays as the in-app cue.
+ */
+function UpdateShellBadge() {
+ const { status, role } = useSession();
+ const [available, setAvailable] = useState(false);
+
+ useEffect(() => {
+ if (IS_DEMO || status !== "in" || role !== "owner") return;
+ let alive = true;
+ readStatus(true)
+ .then((next) => {
+ if (alive) setAvailable(hasAvailableUpdate(next));
+ })
+ .catch(() => {
+ if (alive) setAvailable(false);
+ });
+ return () => {
+ alive = false;
+ };
+ }, [status, role]);
+
+ if (IS_DEMO || status !== "in" || role !== "owner" || !available) return null;
+
+ return (
+ <div
+ className="pointer-events-none fixed inset-x-0 z-[var(--z-spotlight)] flex justify-center px-4"
- style={{ bottom: "calc(5.5rem + var(--sai-bottom, 0px))" }}
++ style={{ bottom: "calc(8.5rem + var(--sai-bottom, 0px))" }}
+ data-slot="shell-update-badge"
+ >
+ <Button
+ type="button"
+ variant="secondary"
+ className="pointer-events-auto h-auto gap-2 rounded-2xl border border-border bg-card/95 px-3 py-2 text-sm shadow-[var(--shadow-win)] backdrop-blur"
- aria-label="New MSO version available — open Settings Updates"
++ aria-label="New MSO version available — open Settings"
+ onClick={() => openWindow("os-settings", "Settings")}
+ >
+ <ArrowDownToLine className="size-4 shrink-0 text-primary" />
+ <span>New version available</span>
+ <span className="rounded-md bg-primary/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary">
+ Open
+ </span>
+ </Button>
+ </div>
+ );
+}
+
+export const updateShellBadgeFeature = defineFeature({
+ id: "update-shell-badge",
+ slots: { overlay: UpdateShellBadge },
+});
diff --cc frontend/slices/os-settings/index.ts
index 8beb4428,8beb4428..81255414
--- a/frontend/slices/os-settings/index.ts
+++ b/frontend/slices/os-settings/index.ts
@@@ -1,5 -1,5 +1,6 @@@
import { Settings } from "lucide-react";
import type { AppDescriptor } from "@/features/appshell";
++export { updateShellBadgeFeature } from "./components/update-shell-badge";
// Barrel: the only thing the app layer imports. Exposes the app descriptor;
// the component itself is lazy-loaded via `load` so its bundle is deferred.
diff --cc frontend/slices/os-shell/shell.manifest.ts
index 6b624510,ab0c5a23..911fb763
--- a/frontend/slices/os-shell/shell.manifest.ts
+++ b/frontend/slices/os-shell/shell.manifest.ts
@@@ -17,7 -17,7 +17,7 @@@ import { createAppApp } from "@/feature
import { systemMonitorApp } from "@/features/system-monitor";
import { assistantApp } from "@/features/assistant";
import { hermesApp, nineRouterApp, openclawApp } from "@/features/managed-apps";
--import { osSettingsApp } from "@/features/os-settings";
++import { osSettingsApp, updateShellBadgeFeature } from "@/features/os-settings";
import { quicklinksApp } from "@/features/quicklinks";
import { docsApp } from "@/features/docs";
import { integrationsApp } from "@/features/integrations";
diff --cc scripts/e2e/release.mjs
index e248ba69,e248ba69..701f753a
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@@ -29,6 -29,6 +29,7 @@@ try
const errors = [];
page.on("pageerror", error => errors.push(error.message));
await page.goto(fixture.base + "/integrations");
++ await expect(page.locator("#mso-boot-splash")).toHaveCount(0);
await expect(page.getByRole("navigation", { name: "Integrations sections", exact: true })).toBeVisible();
await expect(page.getByRole("heading", { name: "GitHub", exact: true, level: 2 })).toBeVisible();
if (viewport.width < 600) {await page.getByRole("button", { name: "Integrations sections", exact: true }).click();await page.getByRole("navigation", { name: "Integrations sections", exact: true }).getByRole("button", { name:"GitHub", exact:true }).click();}