diff --git a/frontend/src/components/ChartRightToolbar.tsx b/frontend/src/components/ChartRightToolbar.tsx index 94287db..3c88244 100644 --- a/frontend/src/components/ChartRightToolbar.tsx +++ b/frontend/src/components/ChartRightToolbar.tsx @@ -43,6 +43,8 @@ export interface ChartRightToolbarProps { custom1OverlayActive?: boolean; onCustom1OverlayActiveChange?: (active: boolean) => void; onOpenCustom1OverlaySettings?: () => void; + /** true — 캔들 pane 상단 오버레이 토글만 (미니 차트 등) */ + overlayControlsOnly?: boolean; } const BTN_SIZE = 32; @@ -357,6 +359,7 @@ const ChartRightToolbar: React.FC = ({ onSplit, onRemove, onDuplicate, onExpand, onRestore, focusedId, onDragStart, onToggleHidden, onSettings, + overlayControlsOnly = false, }) => { const [paneLayouts, setPaneLayouts] = useState>([]); const [paneItems, setPaneItems] = useState>([]); @@ -413,7 +416,11 @@ const ChartRightToolbar: React.FC = ({ if (closeTimer.current) { clearTimeout(closeTimer.current); closeTimer.current = null; } }, []); + const candlePane = paneLayouts.find(l => l.paneIndex === 0); + const showOverlayIcons = !!(candleOverlayToggles?.length && candlePane && onToggleCandleOverlay); + if (paused || chartHeight <= 0) return null; + if (overlayControlsOnly && !showOverlayIcons) return null; const innerHeight = paneLayouts.reduce( (max, l) => Math.max(max, l.topY + l.height), @@ -427,10 +434,8 @@ const ChartRightToolbar: React.FC = ({ ? paneItems.find(p => p.id === openMenuId) : null; - const candlePane = paneLayouts.find(l => l.paneIndex === 0); - const showOverlayIcons = !!(candleOverlayToggles?.length && candlePane && onToggleCandleOverlay); - const showCustomBtn = !!(showOverlayIcons && onCustomOverlayActiveChange && onOpenCustomOverlaySettings); - const showCustom1Btn = !!(showOverlayIcons && onCustom1OverlayActiveChange && onOpenCustom1OverlaySettings); + const showCustomBtn = !!(showOverlayIcons && !overlayControlsOnly && onCustomOverlayActiveChange && onOpenCustomOverlaySettings); + const showCustom1Btn = !!(showOverlayIcons && !overlayControlsOnly && onCustom1OverlayActiveChange && onOpenCustom1OverlaySettings); const customMenuOpen = openMenuId === CUSTOM_MENU_ID; const custom1MenuOpen = openMenuId === CUSTOM1_MENU_ID; @@ -446,7 +451,10 @@ const ChartRightToolbar: React.FC = ({ : null; return ( -