feat: interactive collapsible sidebars with arrow toggle buttons and ultra-wide chart maximizer
This commit is contained in:
+123
-20
@@ -15,7 +15,7 @@ import { SecurityGate } from "@/components/auth/SecurityGate";
|
|||||||
import { TradePosition } from "@/components/positions/ActiveTradesTable";
|
import { TradePosition } from "@/components/positions/ActiveTradesTable";
|
||||||
import { AccountVaultModal, MT5AccountVaultItem } from "@/components/broker/AccountVaultModal";
|
import { AccountVaultModal, MT5AccountVaultItem } from "@/components/broker/AccountVaultModal";
|
||||||
import { useExnessWebSocket } from "@/hooks/useExnessWebSocket";
|
import { useExnessWebSocket } from "@/hooks/useExnessWebSocket";
|
||||||
import { KeyRound, Layers, ChevronRight } from "lucide-react";
|
import { KeyRound, Layers, ChevronRight, ChevronLeft, Activity, Bot } from "lucide-react";
|
||||||
import { soundFX } from "@/lib/soundEffects";
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
|
|
||||||
export default function TitanQuantTerminalPage() {
|
export default function TitanQuantTerminalPage() {
|
||||||
@@ -29,6 +29,43 @@ export default function TitanQuantTerminalPage() {
|
|||||||
orderType: "BUY" | "SELL";
|
orderType: "BUY" | "SELL";
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
|
// Interactive Collapsible Sidebars State (Left Radar & Right Quant Desk)
|
||||||
|
const [isLeftCollapsed, setIsLeftCollapsed] = useState(false);
|
||||||
|
const [isRightCollapsed, setIsRightCollapsed] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
try {
|
||||||
|
const savedLeft = localStorage.getItem("aura_trade_left_collapsed");
|
||||||
|
const savedRight = localStorage.getItem("aura_trade_right_collapsed");
|
||||||
|
if (savedLeft === "true") setIsLeftCollapsed(true);
|
||||||
|
if (savedRight === "true") setIsRightCollapsed(true);
|
||||||
|
} catch (e) {}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleLeftSidebar = () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
setIsLeftCollapsed((prev) => {
|
||||||
|
const next = !prev;
|
||||||
|
try {
|
||||||
|
localStorage.setItem("aura_trade_left_collapsed", String(next));
|
||||||
|
} catch (e) {}
|
||||||
|
setTimeout(() => window.dispatchEvent(new Event("resize")), 320);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleRightSidebar = () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
setIsRightCollapsed((prev) => {
|
||||||
|
const next = !prev;
|
||||||
|
try {
|
||||||
|
localStorage.setItem("aura_trade_right_collapsed", String(next));
|
||||||
|
} catch (e) {}
|
||||||
|
setTimeout(() => window.dispatchEvent(new Event("resize")), 320);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Dynamic Multi-Account Vault State
|
// Dynamic Multi-Account Vault State
|
||||||
const [accounts, setAccounts] = useState<MT5AccountVaultItem[]>([]);
|
const [accounts, setAccounts] = useState<MT5AccountVaultItem[]>([]);
|
||||||
const [activeAccount, setActiveAccount] = useState<MT5AccountVaultItem | null>(null);
|
const [activeAccount, setActiveAccount] = useState<MT5AccountVaultItem | null>(null);
|
||||||
@@ -417,17 +454,49 @@ export default function TitanQuantTerminalPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 2. Dynamic Institutional Workspace (Pro, Focus, or Agentic Cockpit) */}
|
{/* 2. Dynamic Institutional Workspace with Collapsible Sidebars */}
|
||||||
<div className="flex-1 grid grid-cols-1 xl:grid-cols-12 gap-2.5 p-2.5">
|
<div className="flex-1 flex flex-col xl:flex-row gap-2.5 p-2.5 min-h-0 relative select-none">
|
||||||
|
|
||||||
{/* Left Column (3 cols on xl in Pro mode): Multi-Asset Radar & Macro Calendar */}
|
{/* Left Column: Multi-Asset Radar & Macro Calendar (Collapsible) */}
|
||||||
{workspaceMode === "pro" && (
|
{workspaceMode === "pro" && (
|
||||||
<aside className="xl:col-span-3 flex flex-col gap-2.5">
|
isLeftCollapsed ? (
|
||||||
|
/* Slim Collapsed Left Rail */
|
||||||
|
<aside
|
||||||
|
onClick={toggleLeftSidebar}
|
||||||
|
title="ক্লিক করে বড় করুন (Expand Market Radar & Calendar)"
|
||||||
|
className="w-full xl:w-10 shrink-0 bg-[#070d18]/90 border border-cyan-500/30 hover:border-cyan-400 rounded-xl flex xl:flex-col items-center justify-between xl:justify-start p-2.5 xl:py-3.5 gap-3 cursor-pointer transition-all duration-300 shadow-xl group select-none hover:bg-[#0a1628]"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="w-7 h-7 rounded-lg bg-cyan-950/80 border border-cyan-500/50 text-cyan-300 flex items-center justify-center group-hover:bg-cyan-500 group-hover:text-black transition shadow-sm"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4 group-hover:translate-x-0.5 transition-transform" />
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div className="flex-1 flex items-center xl:flex-col justify-center gap-2">
|
||||||
|
<Activity className="w-4 h-4 text-cyan-400 shrink-0" />
|
||||||
|
<span
|
||||||
|
className="text-[10px] font-mono font-bold tracking-widest text-gray-400 group-hover:text-cyan-300 transition uppercase hidden xl:block"
|
||||||
|
style={{ writingMode: "vertical-rl", transform: "rotate(180deg)" }}
|
||||||
|
>
|
||||||
|
MARKET RADAR & CALENDAR
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] font-mono font-bold tracking-wider text-gray-400 group-hover:text-cyan-300 transition uppercase xl:hidden">
|
||||||
|
MARKET RADAR
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span className="w-2 h-2 rounded-full bg-emerald-400 animate-pulse" />
|
||||||
|
</aside>
|
||||||
|
) : (
|
||||||
|
/* Expanded Left Sidebar */
|
||||||
|
<aside className="w-full xl:w-[320px] 2xl:w-[350px] shrink-0 flex flex-col gap-2.5 transition-all duration-300">
|
||||||
<div className="h-[280px]">
|
<div className="h-[280px]">
|
||||||
<WatchlistRadar
|
<WatchlistRadar
|
||||||
activeSymbol={activeSymbol}
|
activeSymbol={activeSymbol}
|
||||||
onSelectSymbol={(sym) => setActiveSymbol(sym)}
|
onSelectSymbol={(sym) => setActiveSymbol(sym)}
|
||||||
liveGoldTick={packet?.tick || null}
|
liveGoldTick={packet?.tick || null}
|
||||||
|
onCollapse={toggleLeftSidebar}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 min-h-[300px]">
|
<div className="flex-1 min-h-[300px]">
|
||||||
@@ -437,26 +506,27 @@ export default function TitanQuantTerminalPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Center Stage: Dual-Engine Charting Stage & Cockpit Dock */}
|
{/* Center Stage: Dual-Engine Charting Stage & Cockpit Dock */}
|
||||||
<section
|
<section className="flex-1 min-w-0 flex flex-col gap-2.5 transition-all duration-300">
|
||||||
className={`flex flex-col gap-2.5 ${
|
|
||||||
workspaceMode === "focus"
|
|
||||||
? "xl:col-span-12"
|
|
||||||
: workspaceMode === "agentic"
|
|
||||||
? "xl:col-span-7"
|
|
||||||
: "xl:col-span-6"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<ChartStageContainer
|
<ChartStageContainer
|
||||||
symbol={activeSymbol}
|
symbol={activeSymbol}
|
||||||
timeframe={activeTimeframe}
|
timeframe={activeTimeframe}
|
||||||
onSelectTimeframe={(tf) => setActiveTimeframe(tf)}
|
onSelectTimeframe={(tf) => setActiveTimeframe(tf)}
|
||||||
liveTick={packet?.tick || null}
|
liveTick={packet?.tick || null}
|
||||||
onOpenConnectModal={() => setShowVaultModal(true)}
|
onOpenConnectModal={() => setShowVaultModal(true)}
|
||||||
isTheaterMode={workspaceMode === "focus"}
|
isTheaterMode={workspaceMode === "focus" || (isLeftCollapsed && isRightCollapsed)}
|
||||||
onToggleTheaterMode={() => setWorkspaceMode(workspaceMode === "focus" ? "pro" : "focus")}
|
onToggleTheaterMode={() => {
|
||||||
|
if (isLeftCollapsed && isRightCollapsed) {
|
||||||
|
setIsLeftCollapsed(false);
|
||||||
|
setIsRightCollapsed(false);
|
||||||
|
} else {
|
||||||
|
setIsLeftCollapsed(true);
|
||||||
|
setIsRightCollapsed(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
exnessAccount={activeAccount ? String(activeAccount.account_id) : exnessAccount}
|
exnessAccount={activeAccount ? String(activeAccount.account_id) : exnessAccount}
|
||||||
exnessServer={activeAccount ? activeAccount.server : exnessServer}
|
exnessServer={activeAccount ? activeAccount.server : exnessServer}
|
||||||
/>
|
/>
|
||||||
@@ -477,18 +547,50 @@ export default function TitanQuantTerminalPage() {
|
|||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* Right Column: Hermes Agentic Copilot & Multi-Tier Execution Terminal */}
|
{/* Right Column: Hermes Agentic Copilot & Multi-Tier Execution Terminal (Collapsible) */}
|
||||||
{workspaceMode !== "focus" && (
|
{workspaceMode !== "focus" && (
|
||||||
|
isRightCollapsed ? (
|
||||||
|
/* Slim Collapsed Right Rail */
|
||||||
<aside
|
<aside
|
||||||
className={`flex flex-col gap-2.5 ${
|
onClick={toggleRightSidebar}
|
||||||
workspaceMode === "agentic" ? "xl:col-span-5" : "xl:col-span-3"
|
title="ক্লিক করে বড় করুন (Expand Hermes Quant Desk & Copilot)"
|
||||||
}`}
|
className="w-full xl:w-10 shrink-0 bg-[#070d18]/90 border border-cyan-500/30 hover:border-cyan-400 rounded-xl flex xl:flex-col items-center justify-between xl:justify-start p-2.5 xl:py-3.5 gap-3 cursor-pointer transition-all duration-300 shadow-xl group select-none hover:bg-[#0a1628]"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="w-7 h-7 rounded-lg bg-cyan-950/80 border border-cyan-500/50 text-cyan-300 flex items-center justify-center group-hover:bg-cyan-500 group-hover:text-black transition shadow-sm"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4 group-hover:-translate-x-0.5 transition-transform" />
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div className="flex-1 flex items-center xl:flex-col justify-center gap-2">
|
||||||
|
<Bot className="w-4 h-4 text-cyan-400 shrink-0" />
|
||||||
|
<span
|
||||||
|
className="text-[10px] font-mono font-bold tracking-widest text-gray-400 group-hover:text-cyan-300 transition uppercase hidden xl:block"
|
||||||
|
style={{ writingMode: "vertical-rl", transform: "rotate(180deg)" }}
|
||||||
|
>
|
||||||
|
HERMES QUANT & EXECUTION
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] font-mono font-bold tracking-wider text-gray-400 group-hover:text-cyan-300 transition uppercase xl:hidden">
|
||||||
|
QUANT DESK
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span className="w-2 h-2 rounded-full bg-cyan-400 animate-pulse" />
|
||||||
|
</aside>
|
||||||
|
) : (
|
||||||
|
/* Expanded Right Sidebar */
|
||||||
|
<aside
|
||||||
|
className={`w-full ${
|
||||||
|
workspaceMode === "agentic" ? "xl:w-[480px]" : "xl:w-[360px] 2xl:w-[400px]"
|
||||||
|
} shrink-0 flex flex-col gap-2.5 transition-all duration-300`}
|
||||||
>
|
>
|
||||||
{/* Autonomous Pilot Mode Switcher (Armed Quant vs Supervised Advisory) */}
|
{/* Autonomous Pilot Mode Switcher (Armed Quant vs Supervised Advisory) */}
|
||||||
<AutonomousPilotToggle
|
<AutonomousPilotToggle
|
||||||
isArmed={isArmedPilot}
|
isArmed={isArmedPilot}
|
||||||
onToggle={(armed) => setIsArmedPilot(armed)}
|
onToggle={(armed) => setIsArmedPilot(armed)}
|
||||||
maxRiskDollars={Math.max(0.15, Number((accountEquity * 0.01).toFixed(2)))}
|
maxRiskDollars={Math.max(0.15, Number((accountEquity * 0.01).toFixed(2)))}
|
||||||
|
onCollapse={toggleRightSidebar}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Hermes Agentic Copilot HUD */}
|
{/* Hermes Agentic Copilot HUD */}
|
||||||
@@ -518,6 +620,7 @@ export default function TitanQuantTerminalPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { ShieldAlert, ShieldCheck, Zap, Radio, AlertTriangle } from "lucide-react";
|
import { ShieldAlert, ShieldCheck, Zap, Radio, AlertTriangle, ChevronRight } from "lucide-react";
|
||||||
import { soundFX } from "@/lib/soundEffects";
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
|
|
||||||
interface AutonomousPilotToggleProps {
|
interface AutonomousPilotToggleProps {
|
||||||
isArmed: boolean;
|
isArmed: boolean;
|
||||||
onToggle: (armed: boolean) => void;
|
onToggle: (armed: boolean) => void;
|
||||||
maxRiskDollars?: number;
|
maxRiskDollars?: number;
|
||||||
|
onCollapse?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AutonomousPilotToggle: React.FC<AutonomousPilotToggleProps> = ({
|
export const AutonomousPilotToggle: React.FC<AutonomousPilotToggleProps> = ({
|
||||||
isArmed,
|
isArmed,
|
||||||
onToggle,
|
onToggle,
|
||||||
maxRiskDollars = 0.15,
|
maxRiskDollars = 0.15,
|
||||||
|
onCollapse,
|
||||||
}) => {
|
}) => {
|
||||||
const handleToggle = () => {
|
const handleToggle = () => {
|
||||||
soundFX.playClick();
|
soundFX.playClick();
|
||||||
@@ -53,6 +55,7 @@ export const AutonomousPilotToggle: React.FC<AutonomousPilotToggleProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
<button
|
<button
|
||||||
onClick={handleToggle}
|
onClick={handleToggle}
|
||||||
className={`px-3 py-1.5 rounded-lg font-bold text-[10px] flex items-center gap-1.5 transition active:scale-95 shadow-sm ${
|
className={`px-3 py-1.5 rounded-lg font-bold text-[10px] flex items-center gap-1.5 transition active:scale-95 shadow-sm ${
|
||||||
@@ -73,6 +76,20 @@ export const AutonomousPilotToggle: React.FC<AutonomousPilotToggleProps> = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{onCollapse && (
|
||||||
|
<button
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onCollapse();
|
||||||
|
}}
|
||||||
|
title="সাইডবার চিপুন (Collapse Quant Desk)"
|
||||||
|
className="p-1.5 rounded-lg bg-[#091528] hover:bg-cyan-500/20 border border-cyan-500/40 text-cyan-300 hover:text-white transition flex items-center group active:scale-95 shadow-sm"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-3.5 h-3.5 group-hover:translate-x-0.5 transition-transform" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { TrendingUp, TrendingDown, Search, Activity, Zap, CheckCircle2 } from "lucide-react";
|
import { TrendingUp, TrendingDown, Search, Activity, Zap, CheckCircle2, ChevronLeft } from "lucide-react";
|
||||||
import { soundFX } from "@/lib/soundEffects";
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
|
|
||||||
export interface WatchlistAsset {
|
export interface WatchlistAsset {
|
||||||
@@ -72,12 +72,14 @@ interface WatchlistRadarProps {
|
|||||||
activeSymbol: string;
|
activeSymbol: string;
|
||||||
onSelectSymbol: (symbol: string) => void;
|
onSelectSymbol: (symbol: string) => void;
|
||||||
liveGoldTick?: { bid: number; ask: number; spread_pips: number } | null;
|
liveGoldTick?: { bid: number; ask: number; spread_pips: number } | null;
|
||||||
|
onCollapse?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WatchlistRadar: React.FC<WatchlistRadarProps> = ({
|
export const WatchlistRadar: React.FC<WatchlistRadarProps> = ({
|
||||||
activeSymbol,
|
activeSymbol,
|
||||||
onSelectSymbol,
|
onSelectSymbol,
|
||||||
liveGoldTick,
|
liveGoldTick,
|
||||||
|
onCollapse,
|
||||||
}) => {
|
}) => {
|
||||||
const [filter, setFilter] = useState("");
|
const [filter, setFilter] = useState("");
|
||||||
const [tab, setTab] = useState<"all" | "metals" | "forex" | "crypto">("all");
|
const [tab, setTab] = useState<"all" | "metals" | "forex" | "crypto">("all");
|
||||||
@@ -116,9 +118,23 @@ export const WatchlistRadar: React.FC<WatchlistRadarProps> = ({
|
|||||||
<Activity className="w-3.5 h-3.5 text-cyan-400" />
|
<Activity className="w-3.5 h-3.5 text-cyan-400" />
|
||||||
<h2 className="font-bold text-xs tracking-wider text-gray-200 uppercase font-mono">Market Radar</h2>
|
<h2 className="font-bold text-xs tracking-wider text-gray-200 uppercase font-mono">Market Radar</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 flex items-center gap-1">
|
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 flex items-center gap-1">
|
||||||
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" /> LIVE
|
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" /> LIVE
|
||||||
</span>
|
</span>
|
||||||
|
{onCollapse && (
|
||||||
|
<button
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onCollapse();
|
||||||
|
}}
|
||||||
|
title="সাইডবার চিপুন (Collapse Market Radar)"
|
||||||
|
className="p-1 rounded bg-[#060b16] hover:bg-cyan-500/20 border border-cyan-500/30 text-cyan-400 hover:text-white transition flex items-center group active:scale-95 shadow-sm"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-3.5 h-3.5 group-hover:-translate-x-0.5 transition-transform" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
|
|||||||
Reference in New Issue
Block a user