feat(frontend): rebuild as Ambient/WebGL console with all pages + command palette

Ground-up rombak UI: hapus semua component/page lama, bangun ulang dengan
desain sistem Ambient (WebGL haze + drifting motes, signal-driven color)
di atas kontrak API/WS/type yang sudah ada.

- Design system: globals.css tokens + primitives (glass, button, badge,
  select, avatar, toast, chart SVG murni).
- Shell: nav rail, topbar (status WS + pill signal + theme), AppFrame.
- 8 halaman: dashboard, voice (orbital stage), media, messages (live feed +
  detail AI), moderation, analysis (search), recordings, + chatbot floating.
- Command palette (Cmd/Ctrl+K) untuk navigasi cepat.
- Server fetch di-page di-try/catch agar render graceful saat backend mati.

Verified: tsc clean, next build 8/8 halaman, semua route 200.
This commit is contained in:
asepharyana
2026-08-15 17:53:48 +07:00
parent b98101c576
commit 1b56212d1a
104 changed files with 2905 additions and 7048 deletions
@@ -0,0 +1,74 @@
"use client";
import { usePathname } from "next/navigation";
import { useTheme } from "next-themes";
import { Moon, Sun } from "lucide-react";
import { navItems } from "@/lib/navigation";
import { useAmbient } from "@/components/ambient/ambient-context";
import { ConnectionStatus } from "./status-dot";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
function useActiveLabel() {
const pathname = usePathname();
const item = [...navItems]
.sort((a, b) => b.matchPrefix.length - a.matchPrefix.length)
.find((i) => pathname.startsWith(i.matchPrefix));
return item?.label ?? "Console";
}
export function TopBar() {
const label = useActiveLabel();
const { state } = useAmbient();
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
const signalTone =
state.tone === "vermilion"
? "text-vermilion"
: state.tone === "amber"
? "text-amber"
: "text-signal";
return (
<header className="sticky top-0 z-40 flex items-center gap-4 px-5 py-3.5">
<div className="flex min-w-0 items-baseline gap-3">
<span className="eyebrow">GMW</span>
<h1 className="display truncate text-[1.5rem] text-ink">{label}</h1>
</div>
<div className="ml-auto flex items-center gap-3">
<span className={cn("pill", signalTone)}>
<span
className={cn(
"size-1.5 rounded-full bg-current animate-breathe",
)}
/>
{state.label ?? "nominal"}
</span>
<ConnectionStatus />
<button
type="button"
aria-label="Open command palette"
onClick={() => window.dispatchEvent(new Event("command-palette:open"))}
className="hidden items-center gap-1.5 rounded-[11px] border border-hairline bg-white/5 px-2.5 py-1.5 text-xs text-ink-soft transition-colors hover:text-ink hover:border-signal/40 sm:flex"
>
<span className="mono text-[0.65rem]">K</span>
</button>
<button
type="button"
aria-label="Toggle theme"
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
className="flex size-9 items-center justify-center rounded-[11px] border border-hairline bg-white/5 text-ink-soft transition-colors hover:text-ink hover:border-signal/40"
>
{mounted && theme === "light" ? (
<Moon className="size-4" />
) : (
<Sun className="size-4" />
)}
</button>
</div>
</header>
);
}