fix(kline): widen dialog, balance chart split, keep intraday view on switching

- 弹窗 max-w 1100→1200, 日K/分时并排改 1.4:1 (日K为主视图),
  图表信息栏(悬停含「至今/周期」)有足够宽度单行容纳, 不再换行
- 修复: 分时 tab 下弹窗内切股会跳回日K —
  视图重置仅在弹窗首次打开(symbol 从 null 变非空)时发生, 切股保留当前视图

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
richard
2026-09-02 13:14:14 +08:00
co-authored by Claude
parent 7038c7d627
commit 41a97888b6
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -190,10 +190,11 @@ export function StockPanel({
{infoBarOnly ? null : (
<div className="flex gap-3 items-start">
{/* 日K为主视图占更宽 (与分时约 1.4:1): 图表自带信息栏(悬停含「至今/周期」)需要更宽才能单行容纳 */}
<StockDailyKChart
symbol={symbol}
height={height}
className="flex-1 min-w-0"
className="flex-[1.4] min-w-0"
dateRange={dateRange}
markers={markers}
ranges={ranges}
@@ -231,8 +231,12 @@ export function StockPreviewDialog({ symbol, name, onClose, triggerInfo, navList
return () => document.removeEventListener('keydown', handler)
}, [symbol, go, showMonitorEditor, priceAlertDraft])
// 弹窗内切股时保留当前视图 (分时 tab 下切股不应跳回日K);
// 仅当弹窗首次打开 (symbol 从 null 变非空) 时重置为日K。
const prevSymbolRef = useRef<string | null>(symbol)
useEffect(() => {
if (symbol) setView('daily')
if (prevSymbolRef.current == null && symbol != null) setView('daily')
prevSymbolRef.current = symbol
setPriceAlertDraft(null)
}, [symbol])
@@ -307,7 +311,7 @@ export function StockPreviewDialog({ symbol, name, onClose, triggerInfo, navList
transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}
className={cn(
'relative rounded-card border border-border bg-base shadow-2xl overflow-hidden flex flex-col transition-all duration-200 ease-smooth',
maximized ? 'w-screen h-screen max-w-none max-h-none' : 'w-[92vw] max-w-[1100px] max-h-[95vh]',
maximized ? 'w-screen h-screen max-w-none max-h-none' : 'w-[92vw] max-w-[1200px] max-h-[95vh]',
)}
>
{/* 顶栏 */}