✨ feat(vscode): 问 AI 和重写注释各用各的 profile,设置里加重写注释默认模型

This commit is contained in:
cruldra committed 2026-10-12 16:30:41 +11:00
1 parent 925f1ed39a
commit b83c445dd0
25 files changed
+363 -111

No files matched your search

@@ -4,7 +4,7 @@ import type { DiffTree, FoldedRuns, PlacedRemoved } from './diffView'
import type { GridSlots } from './PropertyGrid'
import type { ChatState, QaState } from './qa'
import type { PendingImage } from './qaImages'
import type { BlockMarks, BlockView, ProfileChoice } from './types'
import type { BlockMarks, BlockView } from './types'
import { ChevronDown, ChevronRight, ChevronsUpDown, EyeOff } from 'lucide-react'
import { Fragment, useState } from 'react'
import { AskThread, REWRITE_THREAD } from './AskThread'
@@ -67,10 +67,9 @@ export interface BlockTreeState {
onOpenRun: (id: string) => void
}
/** 重写注释的状态和动作,块按自己的记号(anchor)取;profile 下拉和问 AI 共用 */
/** 重写注释的状态和动作,块按自己的记号(anchor)取;profile 下拉是自己的,和问 AI 的互不影响 */
export interface RewriteTree {
state: ChatState
profiles: ProfileChoice
/** 点了块右上角的按钮:按技能命令重写这块(开新会话),展开它的重写记录 */
onRewrite: (anchor: string) => void
/** 在输入框里说的修改意见,接着这块最近一次重写的会话说;images 是贴的图片 */
@@ -79,6 +78,7 @@ export interface RewriteTree {
onDelete: (anchor: string, entryId: string) => void
onOpen: (anchor: string) => void
onClose: (anchor: string) => void
/** 换重写注释用的 profile(所有块共用),`id` 同 [下拉项的 id](vscode/webview-ui/src/codeReader/types.ts#ProfileOption.id) */
onSelectProfile: (id: string) => void
}
@@ -222,7 +222,7 @@ function BlockRewrite({ anchor, rewrite }: { anchor: string, rewrite: RewriteTre
history={historyOf(rewrite.state, anchor)}
asks={asksOf(rewrite.state, anchor)}
open={rewrite.state.open.includes(anchor)}
profiles={rewrite.profiles}
profiles={rewrite.state.profiles}
onSelectProfile={rewrite.onSelectProfile}
onAsk={(request, images) => rewrite.onAsk(anchor, request, images)}
onStop={rewrite.onStop}