优化: 代码质量收尾(搜索索引补全+编译警告清理+i18n核验+String替newtype)

This commit is contained in:
lxy
2026-07-01 12:11:35 +08:00
parent 0338210ba2
commit 6771d396f0
15 changed files with 242 additions and 36 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ import { persistUiState } from './useAiPanel'
import { setStreaming } from './streamingGuard'
import { nextMsgId, getConvState, clearConvStreamState, startApprovalTimer } from './aiShared'
import { t } from '@/i18n/i18n-helpers'
import type { AiConversationDetail, AiMessage, AiToolCallInfo } from '@/api/types'
import type { AiConversationDetail, AiMessage, AiToolCallInfo, ConvId } from '@/api/types'
const appSettings = useAppSettingsStore()
@@ -28,7 +28,7 @@ async function loadConversations() {
&& !state.conversations.some(c => c.id === state.activeConversationId)) {
const now = String(Date.now())
state.conversations.unshift({
id: state.activeConversationId,
id: state.activeConversationId as ConvId,
title: null,
provider_id: null,
model: null,
@@ -102,7 +102,7 @@ export async function switchConversation(id: string) {
if (mySwitchId !== _latestSwitchId) return
void appSettings.set('df-ai-active-conv', created.id)
// 用新对话 id 重走后续逻辑
detail = { id: created.id, title: null, messages: '[]' }
detail = { id: created.id as ConvId, title: null, messages: '[]' }
state.messages = []
notifyConversationChanged()
void loadConversations()