summaryrefslogtreecommitdiff
path: root/frontend/src/pages/ProjectResultsTab.svelte
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-18 18:36:34 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-18 18:36:34 +0800
commitb2c2f9db4b334427c34b2111a4b6609b7af0339b (patch)
tree10aefefa7f7498fe1061cbd3a0febfac5296e172 /frontend/src/pages/ProjectResultsTab.svelte
parentef81ecafcb5a07efd557e15fe686cb434cf45261 (diff)
downloadstrategy-lab-b2c2f9db4b334427c34b2111a4b6609b7af0339b.tar.gz
[实现方案] 结果页默认折叠 Collapsible「技术口径」渲染 result.assumptions 键值对;warnings Alert 仅显示真实警告(无 assumptions 字段不渲染)
Diffstat (limited to 'frontend/src/pages/ProjectResultsTab.svelte')
-rw-r--r--frontend/src/pages/ProjectResultsTab.svelte19
1 files changed, 19 insertions, 0 deletions
diff --git a/frontend/src/pages/ProjectResultsTab.svelte b/frontend/src/pages/ProjectResultsTab.svelte
index 860fab2..2afb7c1 100644
--- a/frontend/src/pages/ProjectResultsTab.svelte
+++ b/frontend/src/pages/ProjectResultsTab.svelte
@@ -18,6 +18,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 Collapsible from '$lib/components/ui/collapsible';
import * as Table from '$lib/components/ui/table';
import * as Select from '$lib/components/ui/select';
import * as Tabs from '$lib/components/ui/tabs';
@@ -197,6 +198,24 @@ import type { Run, BacktestResult } from '../lib/types';
</Alert>
{/if}
+ {#if result.assumptions && Object.keys(result.assumptions).length}
+ <Collapsible.Root>
+ <Collapsible.Trigger
+ class="flex w-full items-center justify-between p-4 text-sm font-medium hover:bg-muted/50"
+ data-testid="assumptions-toggle">技术口径</Collapsible.Trigger>
+ <Collapsible.Content class="px-4 pb-4">
+ <dl class="text-xs" data-testid="assumptions-list">
+ {#each Object.entries(result.assumptions) as [k, v] (k)}
+ <div class="flex gap-4 py-1">
+ <dt class="text-muted-foreground shrink-0">{k}</dt>
+ <dd>{v}</dd>
+ </div>
+ {/each}
+ </dl>
+ </Collapsible.Content>
+ </Collapsible.Root>
+ {/if}
+
<Card.Root size="sm" class="p-4 flex flex-col gap-4">
{#if result.metrics}
{@const mrow = result.metrics}