Skip to content

Commit b2b663f

Browse files
committed
Revert "refactor(home): split operator/publishing surfaces out of the consumer base"
This reverts commit 003068a.
1 parent 003068a commit b2b663f

13 files changed

Lines changed: 1248 additions & 72 deletions

File tree

app/(app)/apps/[id]/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,7 @@ export default function AppDetailPage() {
599599
// render base; for a private app with no catalog listing we derive it from the
600600
// pipeline so the same template still works.
601601
const pipeline = getPipelineById(id);
602-
// Owner/operator chrome (Settings/manage tab, publish controls) lives in the
603-
// stacked apps PR. In the consumer base the app detail is view-only for
604-
// everyone, so owner mode is gated off here; the stacked PR's revert removes
605-
// this flag to re-enable ownership.
606-
const OWNER_MODE_ENABLED = false;
607-
const isOwner = OWNER_MODE_ENABLED && isConnected && PIPELINE_APP_IDS.has(id);
602+
const isOwner = isConnected && PIPELINE_APP_IDS.has(id);
608603
const model =
609604
getCapabilityById(id) ??
610605
(pipeline ? pipelineToExploreApp(pipeline) : undefined);

app/(app)/apps/page.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use client";
2+
3+
import AppsView from "@/components/dashboard/AppsView";
4+
import SignInWall from "@/components/dashboard/SignInWall";
5+
import { useAuth } from "@/components/dashboard/AuthContext";
6+
7+
export default function AppsPage() {
8+
const { isConnected, isLoading } = useAuth();
9+
10+
if (isLoading) return null;
11+
12+
// Organization-only — logged-out users see the sign-in wall instead of the
13+
// apps list.
14+
if (!isConnected) return <SignInWall route="apps" />;
15+
16+
return <AppsView />;
17+
}

app/(app)/home/page.tsx

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { useEffect, useState } from "react";
44
import { useRouter } from "next/navigation";
55
import { House } from "lucide-react";
66
import { useAuth } from "@/components/dashboard/AuthContext";
7+
import { getOrgFleet } from "@/lib/dashboard/org-fleet";
78
import DashboardPageHeader from "@/components/dashboard/DashboardPageHeader";
89
import FirstRunChecklist, {
910
FIRST_RUN_CHANGED_EVENT,
1011
FIRST_RUN_DISMISSED_KEY,
1112
} from "@/components/dashboard/FirstRunChecklist";
1213
import HomeCommandBar from "@/components/dashboard/HomeCommandBar";
14+
import AppsHealthPanel from "@/components/dashboard/AppsHealthPanel";
1315
import ConsumedAppsPanel from "@/components/dashboard/ConsumedAppsPanel";
1416
import ActivityPanel from "@/components/dashboard/ActivityPanel";
1517
import SectionHeader from "@/components/dashboard/SectionHeader";
@@ -26,14 +28,18 @@ function HomePageHeader() {
2628

2729
// ─── Home Page ───
2830
//
29-
// The consumer home: what you're using on the network and what it costs.
30-
// (Operator/publishing surfaces — deployed apps, deploy onboarding — live in a
31-
// separate, stacked PR.) Composition:
32-
// 1. Command bar — org readout + greeting
33-
// 2. Get started — auto-detecting onboarding: create your account, get your
34-
// API key, call an app
35-
// 3. Usage (spend on the apps you call) beside Recent activity (your own
36-
// calls — a live preview of /calls)
31+
// "Mission control" rethink: an organization has two relationships with the
32+
// network — apps it DEPLOYS (which orchestrators serve on its behalf) and apps
33+
// it CONSUMES (the calls it makes across the network, mostly to apps it didn't
34+
// deploy). The Home is organized around those two directions, not personas.
35+
// Composition:
36+
// 1. Command bar — org readout + greeting + an adaptive attention line
37+
// naming the single most urgent thing on arrival
38+
// 2. Get started — auto-detecting onboarding, until the loop is done
39+
// 3. Two ledgers — Deployed apps (count + their 7-day call volume) beside
40+
// Usage (spend on the apps you call). Each leads with its own summary.
41+
// 4. Recent activity — the organization's own calls (what counts toward
42+
// its usage); a live preview of /calls
3743

3844
export default function HomePage() {
3945
const { isConnected, isLoading, user } = useAuth();
@@ -97,6 +103,10 @@ export default function HomePage() {
97103
const organization = "Flipbook";
98104
const firstName = user?.name?.split(" ")[0] ?? "there";
99105

106+
// The Fleet anchors the console split; a consumer-only org with no deployed
107+
// apps drops to a single column so the Vitals rail carries the page.
108+
const hasApps = getOrgFleet().count > 0;
109+
100110
// Signed-out users are redirected to / via the useEffect
101111
// above; render nothing in the meantime (one frame max) so they don't see
102112
// a flash of organization-mock data before the redirect lands.
@@ -131,8 +141,8 @@ export default function HomePage() {
131141
<HomeCommandBar organization={organization} firstName={firstName} />
132142
</div>
133143

134-
{/* Onboarding — auto-detecting: get your API key, then call an app.
135-
Shown until dismissed; full-width above the panels. */}
144+
{/* Onboarding — auto-detecting: deploy an example app, then call it.
145+
Shown until dismissed; full-width above the console split. */}
136146
{showFirstRun && (
137147
<div className="home-rise" style={{ animationDelay: "60ms" }}>
138148
<SectionHeader
@@ -151,13 +161,27 @@ export default function HomePage() {
151161
</div>
152162
)}
153163

154-
{/* Usage (what you spend calling apps) beside Recent activity (your
155-
own calls — a live preview of /calls). Even-height pair. */}
156-
<div
157-
className="home-rise mt-7 grid grid-cols-1 items-stretch gap-5 lg:grid-cols-2"
158-
style={{ animationDelay: "120ms" }}
159-
>
160-
<ConsumedAppsPanel organization={organization} />
164+
{/* The two ledgers — Deployed apps (what you've published to the
165+
network) beside Usage (what you consume from it). Each leads with
166+
its own summary, so there's no separate hero band. On a
167+
consumer-only org with no deployed apps, Usage carries the row. */}
168+
{hasApps ? (
169+
<div
170+
className="home-rise mt-7 grid grid-cols-1 items-stretch gap-5 lg:grid-cols-2"
171+
style={{ animationDelay: "120ms" }}
172+
>
173+
<AppsHealthPanel />
174+
<ConsumedAppsPanel organization={organization} />
175+
</div>
176+
) : (
177+
<div className="home-rise mt-7" style={{ animationDelay: "120ms" }}>
178+
<ConsumedAppsPanel organization={organization} />
179+
</div>
180+
)}
181+
182+
{/* Recent activity — the organization's own recent calls (what
183+
counts toward its usage); a live preview of /calls. */}
184+
<div className="home-rise mt-7" style={{ animationDelay: "220ms" }}>
161185
<ActivityPanel />
162186
</div>
163187
</div>

app/(app)/settings/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ import GeneralSection from "@/components/dashboard/settings/GeneralSection";
1111
import MembersSection from "@/components/dashboard/settings/MembersSection";
1212
import BillingSection from "@/components/dashboard/settings/BillingSection";
1313
import LimitsSection from "@/components/dashboard/settings/LimitsSection";
14+
import DeployTokensSection from "@/components/dashboard/settings/DeployTokensSection";
1415
import ProfileSection from "@/components/dashboard/settings/ProfileSection";
1516
import NotificationsSection from "@/components/dashboard/settings/NotificationsSection";
1617
import SecuritySection from "@/components/dashboard/settings/SecuritySection";
1718
import AppearanceSection from "@/components/dashboard/settings/AppearanceSection";
1819

19-
// The 7 settings sub-tabs, two groups (Organization + Account). The sidebar's
20+
// The 8 settings sub-tabs, two groups (Organization + Account). The sidebar's
2021
// SettingsRail is the navigation surface — there's no horizontal TabStrip on
2122
// this page; the rail and the breadcrumb together tell the user where they
2223
// are. `appearance` is the local-only theme picker (light/dark/system) added
@@ -26,6 +27,7 @@ type SettingsTab =
2627
| "members"
2728
| "billing"
2829
| "usage-limits"
30+
| "deploy-tokens"
2931
| "profile"
3032
| "notifications"
3133
| "security"
@@ -36,6 +38,7 @@ const VALID_TABS: SettingsTab[] = [
3638
"members",
3739
"billing",
3840
"usage-limits",
41+
"deploy-tokens",
3942
"profile",
4043
"notifications",
4144
"security",
@@ -47,6 +50,7 @@ const TAB_LABELS: Record<SettingsTab, string> = {
4750
members: "Members",
4851
billing: "Billing",
4952
"usage-limits": "Limits",
53+
"deploy-tokens": "Deploy tokens",
5054
profile: "Profile",
5155
notifications: "Notifications",
5256
security: "Security",
@@ -139,6 +143,7 @@ function SettingsContent() {
139143
{tab === "members" && <MembersSection />}
140144
{tab === "billing" && <BillingSection />}
141145
{tab === "usage-limits" && <LimitsSection />}
146+
{tab === "deploy-tokens" && <DeployTokensSection />}
142147
{tab === "profile" && <ProfileSection />}
143148
{tab === "notifications" && <NotificationsSection />}
144149
{tab === "security" && <SecuritySection />}

0 commit comments

Comments
 (0)