docs/archives/121-context-editor-refactor/tasks.md
1.1.1 确认ConversationManager当前状态
1.1.2 更新ConversationManager的类型定义
1.2.1 确认轻量化UI设计已到位
1.2.2 增强内联编辑体验(轻量化边界)
1.2.3 保持现有数据绑定模式
2.2.1 分析backup组件的模板管理实现
2.2.2 在ContextEditor中实现模板管理
2.2.3 添加optimizationMode参数支持到ContextEditor
2.3.1 分析现有useContextEditor的导入导出能力
2.3.2 在ContextEditor中实现导入导出功能
4.2.1 删除ConversationMessageEditor.vue和ConversationSection.vue
4.2.2 更新组件导出配置
4.3.1 清理测试中的废弃组件引用
4.3.2 更新Web App中的无效props和事件
4.4.1 执行完整回归测试
4.4.2 更新相关文档
// 推荐:可选类型 + withDefaults
interface Props {
scanVariables?: (content: string) => string[]
}
const props = withDefaults(defineProps<Props>(), {
scanVariables: () => []
})
// 统一为number类型,组件内部拼接px
interface Props {
maxHeight?: number // 而不是 number | string
}
// 组件内部
const style = computed(() => ({
maxHeight: props.maxHeight ? `${props.maxHeight}px` : undefined
}))
<!-- 优先使用NInput自带能力 -->
<NInput
:autosize="{ minRows: 1, maxRows: 3 }"
@update:value="handleUpdate"
/>
<!-- 缺失变量提示保持克制 -->
<NTag v-if="missingCount > 0" size="small" type="warning">
缺失: {{ missingCount }}
</NTag>
这些都是非常务实的工程优化建议,避免了常见的类型不一致、字符串拼接错误、开发联调困难等问题。