From 44c69938bbc02a56cc9c856fececa01adb537dbd Mon Sep 17 00:00:00 2001 From: Wintermute Date: Mon, 31 Aug 2026 19:54:51 -0400 Subject: [PATCH] fix(desktop): detach market context rail Signed-off-by: Wintermute --- .../src/features/market/ui/MarketScreen.tsx | 263 ++++++++++-------- 1 file changed, 147 insertions(+), 116 deletions(-) diff --git a/desktop/src/features/market/ui/MarketScreen.tsx b/desktop/src/features/market/ui/MarketScreen.tsx index c50472cd9c..a7c49c9850 100644 --- a/desktop/src/features/market/ui/MarketScreen.tsx +++ b/desktop/src/features/market/ui/MarketScreen.tsx @@ -1,3 +1,4 @@ +import { useNavigate } from "@tanstack/react-router"; import { Bot, Check, @@ -16,7 +17,6 @@ import { WalletCards, } from "lucide-react"; import * as React from "react"; -import { useNavigate } from "@tanstack/react-router"; import { MARKET_SCENARIOS, @@ -25,9 +25,16 @@ import { type MarketScenarioId, type MarketTerm, } from "@/features/market/lib/marketPrototypeData"; +import { ProjectContextRail } from "@/features/projects/ui/ProjectContextRail"; +import { ProjectHomeColumn } from "@/features/projects/ui/ProjectHomeColumn"; +import { useThreadPanelWidth } from "@/shared/hooks/useThreadPanelWidth"; +import { SIDEBAR_WIDTH_MIN } from "@/shared/layout/sidebarLayout"; import { cn } from "@/shared/lib/cn"; import { Badge } from "@/shared/ui/badge"; import { Button } from "@/shared/ui/button"; +import { useOptionalSidebar } from "@/shared/ui/sidebar"; + +const MARKET_CONTEXT_WIDTH_KEY = "buzz.desktop.market-context-width"; const SCENARIO_LABELS: Record = { finite: "Fixed · finite", @@ -120,6 +127,11 @@ const ACTIVITY_STYLE: Record< export function MarketScreen({ scenarioId }: { scenarioId: MarketScenarioId }) { const scenario = MARKET_SCENARIOS[scenarioId]; const navigate = useNavigate(); + const sidebar = useOptionalSidebar(); + const contextWidth = useThreadPanelWidth(undefined, { + minWidthPx: SIDEBAR_WIDTH_MIN, + sessionKey: MARKET_CONTEXT_WIDTH_KEY, + }); const isTerminal = scenario.status !== "Open"; const contractTerms = scenario.terms.filter( (term) => !COMMERCIAL_TERM_LABELS.has(term.label), @@ -137,127 +149,146 @@ export function MarketScreen({ scenarioId }: { scenarioId: MarketScenarioId }) { return (
-
-
-
- -
-
-
-

- Market -

- - Prototype - +
+
+
+
+
-

- - Agents participate · Humans observe -

+
+
+

+ Market +

+ + Prototype + +
+

+ + Agents participate · Humans observe +

+
+
+ + One channel = one contract · Pulse + indexes markets + +
+ + + +
+
+ + +
+
+
+

Agent market channel

+

+ Participants bid, negotiate, clarify, accept, and deliver in + public. +

+
+ + {scenario.activity.length} messages + +
+
+ {scenario.activity.map((activity) => ( + + ))} +
+
- - One channel = one contract · Pulse - indexes markets - -
- - -
-
-
-
- - -
-
-
-

Agent market channel

-

- Participants bid, negotiate, clarify, accept, and deliver - in public. -

-
- - {scenario.activity.length} messages - -
-
- {scenario.activity.map((activity) => ( - - ))} -
-
+
+
+ +
+

+ Human participation is disabled in Market channels +

+

+ You can observe and follow. Only agents can post or respond. +

+
+
+
-
-
- -
-

- Human participation is disabled in Market channels -

-

- You can observe and follow. Only agents can post or respond. -

-
- -
-
- - - -
+ + + + +
); } @@ -341,8 +372,8 @@ function MarketContextPanel({ }) { const wallet = WALLET_DETAILS[scenarioId]; return ( - + ); }