From a7aab01f051487327e5ce52b6a8905208c546e8c Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 15:49:44 +0800 Subject: [变更性质] feat(frontend) [新增功能] 12 页面组件全量 shadcn:Card/Button/Table/Tabs/Select/Alert;375 底部 Tab Bar 改用 Tabs 组件实现 [实现方案] 页面级手写 class 全部移除(.btn/.banner/table.data/.badge/.tabs/.metric-row/.m-tile/.hint 等改为 shadcn + tailwind 工具类);Modal/DatasetWizard/DatasetCard/DiffView/CodeEditor/Status/Layout 同步 [影响范围] src/pages/*.svelte、src/components/*.svelte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ProjectStrategyTab.svelte | 182 +++++++++++++-------------- 1 file changed, 91 insertions(+), 91 deletions(-) (limited to 'frontend/src/pages/ProjectStrategyTab.svelte') diff --git a/frontend/src/pages/ProjectStrategyTab.svelte b/frontend/src/pages/ProjectStrategyTab.svelte index 8614cc0..e4269e3 100644 --- a/frontend/src/pages/ProjectStrategyTab.svelte +++ b/frontend/src/pages/ProjectStrategyTab.svelte @@ -9,6 +9,7 @@ import { Alert } from '$lib/components/ui/alert'; import { Badge } from '$lib/components/ui/badge'; import * as Card from '$lib/components/ui/card'; + import * as Table from '$lib/components/ui/table'; import { projectsStore } from '../lib/listsStore.svelte'; import { getProject, @@ -185,7 +186,7 @@ try { const [a, b] = await Promise.all([getVersionCode(projectId, v.id), getVersionCode(projectId, prev.id)]); comparing = { - label: `${a.code ? '' : ''}${v.hash.slice(0, 8)}(新)对比 ${prev.hash.slice(0, 8)}(旧)`, + label: `${v.hash.slice(0, 8)}(新)对比 ${prev.hash.slice(0, 8)}(旧)`, before: b.code, after: a.code }; @@ -261,29 +262,29 @@ } -
+
{#if !initBusy && !initErr} - -
-

策略代码(Backtrader Python)

- + +
+

策略代码(Backtrader Python)

+ {saveStatus === 'saved' && `已保存${saveMsg ? ` · ${saveMsg}` : ''}`} {#if saveStatus === 'dirty'}有未保存修改{/if} {#if saveStatus === 'saving'}保存中…{/if} {#if saveStatus === 'conflict'}冲突{/if}
-

+

编辑器修改会自动保存(约 0.8 秒停顿后提交)。草稿代 {baseGeneration} · 回测与获取 AI 建议使用当前草稿快照

-
+
{ if (ev.key === 'Enter') void snapshot(); }} @@ -302,119 +303,118 @@ {#if conflictServer} - + 服务器上的草稿已被其他修改更新(代 {conflictServer.generation}),你正在编辑的本地内容不会自动覆盖。 -
+
{/if} -
-

AI 助手

- - - -
- -
- {#if aiErr} - - - {aiErr} - - {/if} + +

AI 助手

+ + +
+ +
+ {#if aiErr} + + + {aiErr} + + {/if} - {#if aiResult} -
-
-

建议解释 {aiResult.model}

- - tokens {aiResult.usage?.input_tokens ?? '—'} 入 / {aiResult.usage?.output_tokens ?? '—'} 出 - -
-

{aiResult.explanation}

-

完整建议源码

- {}} readOnly={true} label="AI 返回代码(只读)" height={280} /> -

与当前草稿的差异

- -
- - - {#if aiResult.base_generation !== baseGeneration} - 草稿代 {aiResult.base_generation} 与当前 {baseGeneration} 不一致,接受会失败;请重新发起说明 - {/if} - {#if aiAcceptErr} - {aiAcceptErr} - {/if} -
+ {#if aiResult} +
+
+

建议解释 {aiResult.model}

+ + tokens {aiResult.usage?.input_tokens ?? '—'} 入 / {aiResult.usage?.output_tokens ?? '—'} 出 +
- {/if} - {#if aiNote} - {aiNote} - {/if} - -
+

{aiResult.explanation}

+

完整建议源码

+ {}} readOnly={true} label="AI 返回代码(只读)" height={280} /> +

与当前草稿的差异

+ +
+ + + {#if aiResult.base_generation !== baseGeneration} + 草稿代 {aiResult.base_generation} 与当前 {baseGeneration} 不一致,接受会失败;请重新发起说明 + {/if} + {#if aiAcceptErr} + {aiAcceptErr} + {/if} +
+
+ {/if} + {#if aiNote} + {aiNote} + {/if} +
-
-

版本历史

+ +

版本历史

{#if !versionsBusy && versions.length === 0} {/if} {#if !versionsBusy && versions.length > 0} -
- - - - - - - - - - - +
+ + + + 时间 + 摘要 + 哈希 + 来源 + 操作 + + + {#each versions as v, i (v.id)} -
- - - - - - + + {/each} - -
时间摘要哈希来源操作
{fmtDateTime(v.created_at)} + + {fmtDateTime(v.created_at)} + {v.message?.trim() || '(无说明)'} - 版本代 {v.hash?.slice(0, 8) || '—'} - {v.hash?.slice(0, 12)}{versionSourceLabel[v.source]} -
+ 版本代 {v.hash?.slice(0, 8) || '—'} + + {v.hash?.slice(0, 12)} + {versionSourceLabel[v.source]} + +
{#if i + 1 < versions.length} {/if}
-
+ +
{/if} -

版本为不可变记录,恢复均创建新草稿,从不改写历史。获取到最新草稿修改内容请刷新页面查看。

-
+

版本为不可变记录,恢复均创建新草稿,从不改写历史。获取到最新草稿修改内容请刷新页面查看。

+
{#if comparing} (comparing = null)}> -- cgit v1.2.3