让工作流步骤标题映射显式穷举
使用覆盖全部 UiEditorStepId 的 switch 映射步骤标题 增加 never 穷举检查以便新增步骤触发类型错误
This commit is contained in:
+10
-3
@@ -13,7 +13,14 @@ export function appendWorkflowCheckPrompt(message: string): string {
|
||||
}
|
||||
|
||||
export function workflowStepLabel(step: UiEditorStepId): string {
|
||||
if (step === 'reference-analysis') return '分析参考图';
|
||||
if (step === 'structure-recognition') return '识别界面结构';
|
||||
return '绑定视觉素材';
|
||||
switch (step) {
|
||||
case 'reference-analysis':
|
||||
return '分析参考图';
|
||||
case 'structure-recognition':
|
||||
return '识别界面结构';
|
||||
case 'visual-binding':
|
||||
return '绑定视觉素材';
|
||||
}
|
||||
const exhaustiveCheck: never = step;
|
||||
return exhaustiveCheck;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user