Skip to content

Commit d57d5fa

Browse files
josers18claude
andcommitted
fix(usage): mount spend panel in-flow per surface; drop floating dock
- Ask My Data: panel at foot of the ContextRail, under Suggested follow-ups / Memory cues / Related threads - Analyze: panel pinned to the bottom of the left model-list sidebar, below all semantic models (sidebar is now flex-col: list scrolls, panel pins) - removed TokenSpendDock (the fixed overlay that floated into the left margin) - Today unchanged (right aside, under Agent Log) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 623dd8c commit d57d5fa

4 files changed

Lines changed: 16 additions & 32 deletions

File tree

app/(banker)/layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { cookies } from "next/headers";
33
import { LeftRail } from "@/components/nav/LeftRail";
44
import { MobileNav } from "@/components/horizon/mobile/MobileNav";
55
import { SessionUsageProvider } from "@/components/horizon/SessionUsageProvider";
6-
import { TokenSpendDock } from "@/components/horizon/TokenSpendDock";
76

87
export const dynamic = "force-dynamic";
98

@@ -31,7 +30,8 @@ export default async function BankerLayout({
3130
// SessionUsageProvider wraps every banker surface (Today / Ask / Analyze)
3231
// so the token-spend tally is one shared, cross-tab total — the panel reads
3332
// from a single hz_sid session in Postgres regardless of which tab spent the
34-
// tokens. The dock renders the panel consistently on every tab.
33+
// tokens. Each surface mounts the panel in-flow in its own right rail /
34+
// sidebar (Today aside, Ask ContextRail, Analyze model sidebar).
3535
return (
3636
<SessionUsageProvider>
3737
<div className="flex min-h-dvh">
@@ -42,7 +42,6 @@ export default async function BankerLayout({
4242
<Suspense fallback={null}>{children}</Suspense>
4343
</div>
4444
<MobileNav signedIn={signedIn} />
45-
{signedIn && <TokenSpendDock />}
4645
</div>
4746
</SessionUsageProvider>
4847
);

components/analyze/AnalyzeWorkspace.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ModelList } from "./ModelList";
22
import { AnalyzeMobileSidebar } from "./AnalyzeMobileSidebar";
3+
import { TokenSpendPanel } from "@/components/horizon/TokenSpendPanel";
34

45
/**
56
* 2-column shell for /analyze and /analyze/[modelId].
@@ -16,8 +17,14 @@ export function AnalyzeWorkspace({ children }: { children: React.ReactNode }) {
1617
return (
1718
<div className="grid min-h-[calc(100vh-120px)] grid-cols-1 gap-6 lg:grid-cols-[280px_minmax(0,1fr)]">
1819
<aside className="hidden border-r border-border-soft/40 pt-4 lg:block">
19-
<div className="sticky top-[96px] h-[calc(100vh-120px)]">
20-
<ModelList />
20+
<div className="sticky top-[96px] flex h-[calc(100vh-120px)] flex-col">
21+
{/* Model list scrolls; spend panel pins to the foot of the rail. */}
22+
<div className="min-h-0 flex-1">
23+
<ModelList />
24+
</div>
25+
<div className="shrink-0 border-t border-border-soft/40 px-2 pb-2 pt-1">
26+
<TokenSpendPanel />
27+
</div>
2128
</div>
2229
</aside>
2330

components/ask-data/ContextRail.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { useFollowUps } from "./followUpsBus";
44
import { ASK_DATA_FOLLOW_UP_PICK_EVENT } from "./askDataEvents";
5+
import { TokenSpendPanel } from "@/components/horizon/TokenSpendPanel";
56

67
/**
78
* Right rail on /ask. Per spec §T1-2: "Suggested follow-ups / Memory
@@ -57,6 +58,10 @@ export function ContextRail() {
5758
<ContextCard title="Related threads">
5859
Past conversations touching similar clients or segments.
5960
</ContextCard>
61+
62+
{/* Session token spend — in-flow at the foot of the rail, expands
63+
downward. Renders null until there's spend to show. */}
64+
<TokenSpendPanel />
6065
</aside>
6166
);
6267
}

components/horizon/TokenSpendDock.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)