优化: AR-10 想法→灵感文案统一(13 文件)

用户可见文案 + 后端错误信息 + LLM 工具描述/系统提示词 + store toast + 注释统一改灵感:
i18n zh-CN(ideas/aiTool/projectDetail) + idea.rs 错误 + tool_registry/prompt LLM + stores/project toast + api/views 注释
en 版待定(用 Ideas/Idea)+ docs/crates 注释低优先本轮略;cargo check/vue-tsc 0 error
This commit is contained in:
2026-06-14 16:26:32 +08:00
parent d6cd2805be
commit 65c475b549
13 changed files with 50 additions and 50 deletions

View File

@@ -2,7 +2,7 @@ import { invoke } from '@tauri-apps/api/core'
import type { IdeaRecord, CreateIdeaInput, PromotionResult } from './types'
export const ideaApi = {
/** 列出想法,可选按 status 过滤draft/pending_review/promoted 等) */
/** 列出灵感,可选按 status 过滤draft/pending_review/promoted 等) */
list(status?: string): Promise<IdeaRecord[]> {
return invoke('list_ideas', { status: status ?? null })
},
@@ -24,7 +24,7 @@ export const ideaApi = {
return invoke('evaluate_idea', { id })
},
/** 将想法晋升为项目,返回晋升结果(含 project_id */
/** 将灵感晋升为项目,返回晋升结果(含 project_id */
promote(id: string): Promise<PromotionResult> {
return invoke('promote_idea', { id })
},

View File

@@ -1,7 +1,7 @@
//! TypeScript 类型定义 — 与 Rust Record 结构体严格对齐
// ============================================================
// 想法
// 灵感
// ============================================================
export interface IdeaRecord {
@@ -68,7 +68,7 @@ export interface AiScanResult {
raw: string | null
}
/** 想法晋升结果(后端 promote_idea 返回) */
/** 灵感晋升结果(后端 promote_idea 返回) */
export interface PromotionResult {
idea_id: string
project_id: string

View File

@@ -21,7 +21,7 @@ export default {
// completed 结果摘要(header 折叠态可见)
taskCount: '{n} 项任务',
projectCount: '{n} 个项目',
ideaCount: '{n} 条想法',
ideaCount: '{n} 条灵感',
createdWithName: '已创建:{name}',
created: '已创建',
updatedField: '已更新 {field}',

View File

@@ -15,7 +15,7 @@ export default {
},
// 空状态
emptyState: '选择一个想法查看详情',
emptyState: '选择一个灵感查看详情',
// 对抗式评估
adversarialTitle: '⚖️ 对抗式评估',
@@ -39,7 +39,7 @@ export default {
'with resources': '📦 配置资源后行动',
'research more': '🔍 需要更多研究',
monitor: '👁️ 持续监控',
cancel: '❌ 取消想法',
cancel: '❌ 取消灵感',
},
// 多维评分
@@ -62,17 +62,17 @@ export default {
// 操作按钮
promoteToProject: '🚀 立项为项目',
deleteIdea: '🗑️ 删除想法',
deleteIdea: '🗑️ 删除灵感',
// 捕捉模态框
captureTitle: '✨ 捕捉新想法',
captureTitle: '✨ 捕捉新灵感',
fieldTitle: '标题',
fieldDesc: '描述',
titlePlaceholder: '一句话描述你的想法...',
titlePlaceholder: '一句话描述你的灵感...',
descPlaceholder: '详细说明(可选)...',
// 原生对话框文案confirm / alert
confirmDelete: '确定删除想法「{title}」?此操作不可撤销。',
confirmDelete: '确定删除灵感「{title}」?此操作不可撤销。',
promoteFailed: '立项失败',
evalFailed: '评估失败',
},

View File

@@ -6,7 +6,7 @@ export default {
delete: '🗑 删除',
newTask: '+ 新任务',
// 阶段 pipeline
stageIdea: '💡 想法',
stageIdea: '💡 灵感',
stageRequirement: '📋 需求',
stageCoding: '💻 编码',
stageTesting: '🧪 测试',
@@ -21,9 +21,9 @@ export default {
confirmCreate: '确认创建',
// 项目信息面板
infoTitle: '📋 项目信息',
sourceIdea: '来源想法',
viewIdea: '查看想法详情',
ideaDeleted: '原始想法已删除',
sourceIdea: '来源灵感',
viewIdea: '查看灵感详情',
ideaDeleted: '原始灵感已删除',
createdAt: '创建时间',
updatedAt: '更新时间',
description: '描述',

View File

@@ -142,12 +142,12 @@ function createStore() {
}
}
// ── 想法 CRUD ──
// ── 灵感 CRUD ──
async function loadIdeas() {
try {
state.ideas = await ideaApi.list()
} catch (e: any) {
state.error = e?.toString() ?? '加载想法失败'
state.error = e?.toString() ?? '加载灵感失败'
}
}
@@ -157,7 +157,7 @@ function createStore() {
state.ideas.push(record)
return record
} catch (e: any) {
state.error = e?.toString() ?? '创建想法失败'
state.error = e?.toString() ?? '创建灵感失败'
return null
}
}
@@ -175,7 +175,7 @@ function createStore() {
await ideaApi.delete(id)
state.ideas = state.ideas.filter(i => i.id !== id)
} catch (e: any) {
state.error = e?.toString() ?? '删除想法失败'
state.error = e?.toString() ?? '删除灵感失败'
}
}
@@ -309,7 +309,7 @@ function createStore() {
type ProjectStore = ReturnType<typeof createStore>
let _storeInstance: ProjectStore | null = null
/** 项目/任务/想法/工作流 全局状态(单例,多组件复用同一 reactive 包装) */
/** 项目/任务/灵感/工作流 全局状态(单例,多组件复用同一 reactive 包装) */
export function useProjectStore(): ProjectStore {
if (_storeInstance) return _storeInstance
_storeInstance = createStore()

View File

@@ -30,7 +30,7 @@
<!-- 两栏布局 -->
<div class="ideas-layout">
<!-- 左侧想法列表 -->
<!-- 左侧灵感列表 -->
<section class="idea-list-panel">
<div class="idea-list">
<div
@@ -53,7 +53,7 @@
</div>
</section>
<!-- 右侧想法详情 -->
<!-- 右侧灵感详情 -->
<section class="idea-detail-panel" v-if="currentIdea">
<div class="detail-header">
<h2 class="detail-title">{{ currentIdea.title }}</h2>
@@ -179,7 +179,7 @@
</section>
</div>
<!-- 捕捉想法模态框 -->
<!-- 捕捉灵感模态框 -->
<div class="modal-overlay" v-if="showCaptureModal" @click.self="showCaptureModal = false">
<div class="modal-box">
<h3>{{ $t('ideas.captureTitle') }}</h3>
@@ -194,7 +194,7 @@
</div>
</div>
<!-- 确认弹层删除想法替代原生 window.confirm -->
<!-- 确认弹层删除灵感替代原生 window.confirm -->
<ConfirmDialog :visible="confirmState.visible" :msg="confirmState.msg" @result="answerConfirm" />
</div>
</template>
@@ -234,7 +234,7 @@ const activeFilter = ref<FilterKey>('all')
const selectedId = ref<string | null>(null)
const searchQuery = ref('')
// ── 新建想法模态框 ──
// ── 新建灵感模态框 ──
const showCaptureModal = ref(false)
const newIdeaTitle = ref('')
const newIdeaDesc = ref('')