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
+4 -4
View File
@@ -13,6 +13,7 @@ import { useState, useEffect, useCallback, Fragment } from 'react';
import { useRpc } from './connection.jsx';
import { ToastProvider, useToast } from './Toast.jsx';
import { StrategyFieldsEditor } from './StrategyFieldsEditor.jsx'; // R-013:策略自定义字段编辑器
import { ExpandChevron } from './ExpandChevron.jsx'; // 展开箭头与策略 tab 表格行图标统一
/** 确认弹窗 */
function ConfirmDialog({ title, message, onConfirm, onCancel }) {
@@ -349,12 +350,12 @@ function StrategyGroupSettings() {
<button onClick={() => setEditingId(null)} style={{ padding: '2px 8px', cursor: 'pointer', marginLeft: 4 }}>取消</button>
</span>
) : (
<span>
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 6 }}>
<button
onClick={() => { setExpandedId(expandedId === s.id ? null : s.id); }}
style={{ padding: '2px 6px', cursor: 'pointer', border: 'none', background: 'none', fontSize: 12, color: 'var(--dsw-alias-label-secondary, #666)', marginRight: 6 }}
style={{ padding: '2px 4px', cursor: 'pointer', border: 'none', background: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', lineHeight: 0 }}
title={expandedId === s.id ? '收起配置' : '展开配置自定义字段'}
>{expandedId === s.id ? '▾' : '▸'}</button>
><ExpandChevron expanded={expandedId === s.id} /></button>
{s.name}
</span>
)}
@@ -382,7 +383,6 @@ function StrategyGroupSettings() {
strategy={s}
saving={fieldSaving}
onSave={(fields) => handleSaveConfig(s.id, fields)}
onClose={() => setExpandedId(null)}
/>
</td>
</tr>