Dashboard: integrated post-login screen + service-worker auto-update
Login landed on an empty "Pick a claw" stub — the integrated dashboard from the design comp was never assembled as the home. Now `/` IS the dashboard. - public/sw.js: cache v2→v3; RegisterServiceWorker reloads once when a new worker activates, so deploys are picked up without a manual hard-refresh - (workspace)/layout: ShellChrome renders the dashboard bare on "/" (it's self-contained) and the shared TopBar/LeftRail/StatusBar on every other route - components/dashboard: Dashboard (state machine + data) — top bar w/ breadcrumb, ORG/CO/TEAM/CLAW tier rail, tier-aware context list, TopologyCanvas (6-mode view-as selector, generalized layouts), and the agent "computer" slide-out (cm-fade) wrapping the existing ComputerPanel; status bar - motion.css: cm-fade keyframe Wired to existing endpoints (/api/teams|companies|orgs, /api/structure/*, /api/team/claws, /api/structure/stats, + ComputerPanel's apps/runtime-config/ routines). Defaults to the most-recent team; claw click opens the slide-out. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d2354e1f72
commit
bd6f48c2b7
@@ -1,9 +1,7 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { z } from "zod";
|
||||
|
||||
import { LeftRail } from "@/components/shell/LeftRail";
|
||||
import { StatusBar } from "@/components/shell/StatusBar";
|
||||
import { TopBar } from "@/components/shell/TopBar";
|
||||
import { ShellChrome } from "@/components/shell/ShellChrome";
|
||||
import { ApiAuthError, apiFetch } from "@/lib/api/http";
|
||||
import { fetchClaws, fetchCredits, fetchMe } from "@/lib/api/team";
|
||||
import {
|
||||
@@ -53,19 +51,17 @@ export default async function WorkspaceLayout({
|
||||
throw error;
|
||||
}
|
||||
return (
|
||||
<div className="flex h-dvh flex-col">
|
||||
<TopBar user={user} stats={stats} />
|
||||
<div className="flex min-h-0 flex-1">
|
||||
<LeftRail
|
||||
roster={roster}
|
||||
orgs={orgs}
|
||||
companies={companies}
|
||||
teams={teams}
|
||||
creditsBalance={credits.available}
|
||||
/>
|
||||
<main className="min-w-0 flex-1 overflow-y-auto">{children}</main>
|
||||
</div>
|
||||
<StatusBar stats={stats} doors={doors} />
|
||||
</div>
|
||||
<ShellChrome
|
||||
user={user}
|
||||
roster={roster}
|
||||
orgs={orgs}
|
||||
companies={companies}
|
||||
teams={teams}
|
||||
creditsBalance={credits.available}
|
||||
stats={stats}
|
||||
doors={doors}
|
||||
>
|
||||
{children}
|
||||
</ShellChrome>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
// Workspace home: the empty-shell landing until agent chat arrives (P1).
|
||||
export default function WorkspaceHome() {
|
||||
return (
|
||||
<section className="flex h-dvh flex-col items-center justify-center gap-2 motion-safe:animate-[route-fade-in_var(--duration-normal)_var(--ease-app)]">
|
||||
<h1 className="text-xxxl font-semibold tracking-tight">Clawmates</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Pick a claw from the rail, or create one to get started.
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Dashboard } from "@/components/dashboard/Dashboard";
|
||||
import { ApiAuthError } from "@/lib/api/http";
|
||||
import { fetchMe } from "@/lib/api/team";
|
||||
import type { User } from "@/lib/api/schemas";
|
||||
|
||||
// Workspace home = the integrated dashboard (tier rail → topology canvas →
|
||||
// agent computer slide-out).
|
||||
export default async function WorkspaceHome() {
|
||||
let user: User;
|
||||
try {
|
||||
user = await fetchMe();
|
||||
} catch (error) {
|
||||
if (error instanceof ApiAuthError) redirect("/login");
|
||||
throw error;
|
||||
}
|
||||
return <Dashboard user={{ display_name: user.display_name, email: user.email }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user