docs/archives/130-test-area-version-model-selection/findings.md
basic-user(后续再推广到其他子模式)。workspace / v0..vn)。
workspace:下方工作区当前内容,包含未保存草稿v0:原始提示词(不在历史链中作为一条 record 存在)v1..vn:历史链版本号workspace / v0..vn)v0 vs workspace。workspace 为空则直接报错,不再 silently fallback。packages/core/src/services/history/types.ts 定义 PromptRecord / PromptRecordChain。version = 1..n;v0 单独由原始提示词代表。packages/ui/src/components/basic-mode/BasicUserWorkspace.vue → <TestAreaPanel>packages/ui/src/composables/workspaces/useBasicWorkspaceLogic.ts#handleTest 驱动。TestAreaPanel 包含:TestControlBar + TestResultSection。TestResultSection 负责结果卡片 header + 评估入口。SelectWithConfig 默认注入 style: { minWidth: '160px' }(见 packages/ui/src/components/SelectWithConfig.vue)。
| 决策 | 理由 |
|---|---|
在 useBasicUserSession 中持久化 per-panel 的 version+model 选择(testPanels) | session 已持久化 compare/testContent 等状态;符合“session-scoped”的预期。 |
version 使用 `'workspace' | 0 |
| 通过确定性 resolver 将选择值解析为 prompt 文本 | 解耦 UI 与测试逻辑,并对缺失/非法版本做 fallback。 |
TestResultSection 增加 header-extra slots,TestAreaPanel 透传 | 组件保持通用;各 workspace 仅注入自己的控制区。 |
| 决策 | 理由 |
|---|---|
| 结果卡 header/actions 允许换行(flex-wrap) | 避免窄屏时标题+选择器+评估入口溢出。 |
限制选择器宽度:version 固定 100px;model 覆盖为 min-width: 120px; width: 160px | 解决 SelectWithConfig 默认 minWidth=160 造成的宽度压力,同时保持可用性。 |
在 header-extra 内使用 NFlex 对齐与 spacing | 比 NSpace wrap=false 更可控,且在 header 换行时更稳定。 |
packages/core/src/services/history/types.tspackages/ui/src/composables/workspaces/useBasicWorkspaceLogic.tspackages/ui/src/components/basic-mode/BasicUserWorkspace.vuepackages/ui/src/components/TestAreaPanel.vue / packages/ui/src/components/TestResultSection.vue / packages/ui/src/components/TestControlBar.vuedocs/architecture/test-area-version-model-selection.md