feat(UI): 展开箭头全站统一为 ExpandChevron 共享组件

- 新增 src/client/views/ExpandChevron.jsx:14x14 chevron-right、success 绿、展开旋转 90°(源自策略 tab 表格行图标)
- 设置页策略分组行首 ▸/▾ 文字箭头改用该组件,并修复箭头与策略名的水平对齐(基线 trick 改 flex 精确居中)
- StrategyTab / TradeRecordsTab 两处重复内联 SVG 收敛为共享组件
- 去掉字段编辑器展开区冗余「收起」按钮(行首箭头/「收起字段」已可收起),清理 onClose prop
- docs: 新增 UI约束-006(展开/收起箭头全站统一)
This commit is contained in:
2026-09-03 17:39:49 +08:00
parent d793d2cf35
commit ed43ecae39
6 changed files with 49 additions and 50 deletions
+2 -22
View File
@@ -18,6 +18,7 @@
import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
import { useRpc } from './connection.jsx';
import { LoadState } from './LoadState.jsx';
import { ExpandChevron } from './ExpandChevron.jsx'; // 行展开图标共享组件
import { RangeSelector } from './RangeSelector.jsx';
const POLL_INTERVAL_MS = 4000; // 3-5s 轮询(取 4s
@@ -411,28 +412,7 @@ function OrderRows({ order, expanded, onToggle, attributionCandidates, onLoadCan
>
<td style={{ ...tdStyle, textAlign: 'center', width: 28 }}>
{hasTrades ? (
<svg
width="14"
height="14"
viewBox="0 0 14 14"
style={{
display: 'inline-block',
transition: 'transform .15s ease',
transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',
cursor: 'pointer',
color: 'var(--dsw-alias-state-success-primary, #2e7d32)',
verticalAlign: 'middle',
}}
>
<path
d="M4.5 2.5 L9.5 7 L4.5 11.5"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
<ExpandChevron expanded={expanded} style={{ cursor: 'pointer' }} />
) : (
<span style={{ color: 'var(--dsw-alias-border-l3, #ccc)', fontSize: 10 }}>·</span>
)}