From c52a727d11b87d70ec00a7e2569841e6e6abcd9c Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 18:11:53 +0800 Subject: [变更性质] 用户旅程重排:项目首页指标摘要+项目卡、结果页首屏 capital 三卡+交易分页、数据/策略/回测 CTA 与三态统一,token 白名单清扫(docs/ui-user-journey-round6.md §1/§2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/ProjectStrategyTab.svelte | 94 +++++++++++++++++----------- 1 file changed, 57 insertions(+), 37 deletions(-) (limited to 'frontend/src/pages/ProjectStrategyTab.svelte') diff --git a/frontend/src/pages/ProjectStrategyTab.svelte b/frontend/src/pages/ProjectStrategyTab.svelte index e4269e3..53c8bea 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 Textarea from '$lib/components/ui/textarea'; import * as Table from '$lib/components/ui/table'; import { projectsStore } from '../lib/listsStore.svelte'; import { @@ -262,28 +263,34 @@ } -
- - - {#if !initBusy && !initErr} - -
-

策略代码(Backtrader Python)

- +
+ {#if initBusy} + + {:else if initErr} + + {#snippet errorCta()} + + {/snippet} + + {:else} + +
+

策略代码(Backtrader Python)

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

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

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

-
+
{ if (ev.key === 'Enter') void snapshot(); @@ -300,7 +307,11 @@ 草稿与上一快照对比
- + {#if snapshotErr} + + {:else if snapshotMsg} + + {/if} {#if conflictServer} @@ -310,20 +321,18 @@ -
+
{/if} - -

AI 助手

- - -
+ +
+

AI 助手

{#if aiErr} @@ -333,20 +342,25 @@ {/if} +
+ + +
+ {#if aiResult} -
-
-

建议解释 {aiResult.model}

- +
+
+

建议解释 {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} 不一致,接受会失败;请重新发起说明 + 草稿代 {aiResult.base_generation} 与当前 {baseGeneration} 不一致,接受会失败;请重新发起说明 {/if} {#if aiAcceptErr} {aiAcceptErr} @@ -370,14 +384,20 @@ {/if} - -

版本历史

- - {#if !versionsBusy && versions.length === 0} + +

版本历史

+ {#if versionsBusy} + + {:else if versionsErr} + + {#snippet errorCta()} + + {/snippet} + + {:else if versions.length === 0} - {/if} - {#if !versionsBusy && versions.length > 0} -
+ {:else} +
@@ -394,7 +414,7 @@ {fmtDateTime(v.created_at)} {v.message?.trim() || '(无说明)'} - 版本代 {v.hash?.slice(0, 8) || '—'} + 版本代 {v.hash?.slice(0, 8) || '—'} {v.hash?.slice(0, 12)} {versionSourceLabel[v.source]} @@ -413,7 +433,7 @@
{/if} -

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

+

版本为不可变记录,恢复均创建新草稿,从不改写历史。

{#if comparing} -- cgit v1.2.3