✨ feat(vscode): 设置面板可配头脑风暴/实施/测试会话的默认 profile
三类会话的 profile 此前只有工单级字段,留空就硬编码落到 official, 想整体换模型只能一个工单一个工单改。 设置面板新增三个下拉,与冲突解决/提交/改动说明的 profile 选择同区。 解析链路变成:工单级字段 > 对应的全局默认设置 > getDefaultProfilePath(), 三类之间仍互不回退。新建工单的头脑风暴会话也走同一条链路。 Claude-Session: https://claude.ai/code/session_01REdhpbaNyqWASF2HWsnTFv
This commit is contained in:
1 parent
518d471b7a
commit
958c59e090
11 files changed
+196
-18
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"publisher": "clurdra",
|
"publisher": "clurdra",
|
||||||
"name": "superpowers-vscode-clurdra",
|
"name": "superpowers-vscode-clurdra",
|
||||||
"displayName": "Superpowers-clurdra",
|
"displayName": "Superpowers-clurdra",
|
||||||
"version": "0.2.127",
|
"version": "0.2.128",
|
||||||
"packageManager": "pnpm@10.27.0",
|
"packageManager": "pnpm@10.27.0",
|
||||||
"description": "Superpowers specs and plans Kanban explorer",
|
"description": "Superpowers specs and plans Kanban explorer",
|
||||||
"author": "clurdra",
|
"author": "clurdra",
|
||||||
|
|||||||
@@ -970,6 +970,9 @@ export class KanbanWebviewPanel {
|
|||||||
implTabPreCreateScript: s.implTabPreCreateScript,
|
implTabPreCreateScript: s.implTabPreCreateScript,
|
||||||
implTabPostCloseScript: s.implTabPostCloseScript,
|
implTabPostCloseScript: s.implTabPostCloseScript,
|
||||||
splitNewTerminals: s.splitNewTerminals,
|
splitNewTerminals: s.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: s.defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath: s.defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath: s.defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
||||||
commitProfilePath: await getEffectiveCommitProfilePath(this.context),
|
commitProfilePath: await getEffectiveCommitProfilePath(this.context),
|
||||||
prDiffSummaryProfilePath: await getEffectivePrDiffSummaryProfilePath(this.context),
|
prDiffSummaryProfilePath: await getEffectivePrDiffSummaryProfilePath(this.context),
|
||||||
@@ -1055,6 +1058,9 @@ export class KanbanWebviewPanel {
|
|||||||
implTabPreCreateScript: s.implTabPreCreateScript,
|
implTabPreCreateScript: s.implTabPreCreateScript,
|
||||||
implTabPostCloseScript: s.implTabPostCloseScript,
|
implTabPostCloseScript: s.implTabPostCloseScript,
|
||||||
splitNewTerminals: s.splitNewTerminals,
|
splitNewTerminals: s.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: s.defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath: s.defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath: s.defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
||||||
commitProfilePath: await getEffectiveCommitProfilePath(this.context),
|
commitProfilePath: await getEffectiveCommitProfilePath(this.context),
|
||||||
prDiffSummaryProfilePath: await getEffectivePrDiffSummaryProfilePath(this.context),
|
prDiffSummaryProfilePath: await getEffectivePrDiffSummaryProfilePath(this.context),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { commands, env, ThemeColor, Uri, window, workspace } from 'vscode'
|
|||||||
import { getToken } from '../../auth/secrets'
|
import { getToken } from '../../auth/secrets'
|
||||||
import { buildCcCommand } from '../../cc/ccCommand'
|
import { buildCcCommand } from '../../cc/ccCommand'
|
||||||
import { resolveCommitProfileForRun } from '../../cc/commitProfile'
|
import { resolveCommitProfileForRun } from '../../cc/commitProfile'
|
||||||
import { getDefaultProfilePath, resolveProfilePath } from '../../cc/profiles'
|
import { resolveProfilePath } from '../../cc/profiles'
|
||||||
import { getBrainstormPrompt } from '../../cc/prompts'
|
import { getBrainstormPrompt } from '../../cc/prompts'
|
||||||
import { claudeProjectsRoot, installClaudeSession } from '../../cc/sessionBundle'
|
import { claudeProjectsRoot, installClaudeSession } from '../../cc/sessionBundle'
|
||||||
import { projectsDirFor, watchForNewSession } from '../../cc/sessionWatcher'
|
import { projectsDirFor, watchForNewSession } from '../../cc/sessionWatcher'
|
||||||
@@ -1429,8 +1429,8 @@ export async function handleIssueCreate(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const effectiveProfilePath
|
// 新建工单弹窗里选的 profile > 设置里的「头脑风暴默认配置文件」> DEFAULT。
|
||||||
= brainstormProfilePath && brainstormProfilePath.trim() !== '' ? brainstormProfilePath : getDefaultProfilePath()
|
const effectiveProfilePath = sessions.resolveBrainstormProfilePath(panel, brainstormProfilePath)
|
||||||
if (effectiveProfilePath.includes('\'')) {
|
if (effectiveProfilePath.includes('\'')) {
|
||||||
panel.postMessage({
|
panel.postMessage({
|
||||||
type: 'toast/show',
|
type: 'toast/show',
|
||||||
@@ -1888,7 +1888,7 @@ export async function handleUpdateAutoReview(panel: KanbanWebviewPanel, issueNum
|
|||||||
/**
|
/**
|
||||||
* Persist a per-issue `profilePath` override into the issue's state JSON
|
* Persist a per-issue `profilePath` override into the issue's state JSON
|
||||||
* comment. Implement / implement-resume sessions use this profile
|
* comment. Implement / implement-resume sessions use this profile
|
||||||
* (see resolveImplementProfilePath); empty = getDefaultProfilePath().
|
* (see resolveImplementProfilePath); empty = 设置里的「实施默认配置文件」,再空 = getDefaultProfilePath()。
|
||||||
* Mirrors handleUpdateAutoReview: optimistic update on the webview, rolled
|
* Mirrors handleUpdateAutoReview: optimistic update on the webview, rolled
|
||||||
* back via `issue/patch` if the persist fails.
|
* back via `issue/patch` if the persist fails.
|
||||||
*/
|
*/
|
||||||
@@ -1979,7 +1979,7 @@ export async function handleUpdateProfilePath(panel: KanbanWebviewPanel, issueNu
|
|||||||
/**
|
/**
|
||||||
* Persist a per-issue `brainstormProfilePath` override into the issue's state
|
* Persist a per-issue `brainstormProfilePath` override into the issue's state
|
||||||
* JSON. Brainstorm start/resume use this profile (see resolveBrainstormProfilePath);
|
* JSON. Brainstorm start/resume use this profile (see resolveBrainstormProfilePath);
|
||||||
* empty = getDefaultProfilePath(). 与实施/测试 profile 互不回退。
|
* empty = 设置里的「头脑风暴默认配置文件」,再空 = getDefaultProfilePath()。与实施/测试 profile 互不回退。
|
||||||
*/
|
*/
|
||||||
export async function handleUpdateBrainstormProfilePath(panel: KanbanWebviewPanel, issueNumber: number, brainstormProfilePath: string): Promise<void> {
|
export async function handleUpdateBrainstormProfilePath(panel: KanbanWebviewPanel, issueNumber: number, brainstormProfilePath: string): Promise<void> {
|
||||||
const workspaceRoot = workspace.workspaceFolders?.[0]?.uri.fsPath
|
const workspaceRoot = workspace.workspaceFolders?.[0]?.uri.fsPath
|
||||||
@@ -2063,7 +2063,7 @@ export async function handleUpdateBrainstormProfilePath(panel: KanbanWebviewPane
|
|||||||
/**
|
/**
|
||||||
* Persist a per-issue `testProfilePath` override into the issue's state JSON
|
* Persist a per-issue `testProfilePath` override into the issue's state JSON
|
||||||
* comment. Test start/resume use this profile (see resolveTestProfilePath);
|
* comment. Test start/resume use this profile (see resolveTestProfilePath);
|
||||||
* empty = getDefaultProfilePath(),不回退实施 profile。
|
* empty = 设置里的「测试默认配置文件」,再空 = getDefaultProfilePath(),不回退实施 profile。
|
||||||
*/
|
*/
|
||||||
export async function handleUpdateTestProfilePath(panel: KanbanWebviewPanel, issueNumber: number, testProfilePath: string): Promise<void> {
|
export async function handleUpdateTestProfilePath(panel: KanbanWebviewPanel, issueNumber: number, testProfilePath: string): Promise<void> {
|
||||||
const workspaceRoot = workspace.workspaceFolders?.[0]?.uri.fsPath
|
const workspaceRoot = workspace.workspaceFolders?.[0]?.uri.fsPath
|
||||||
|
|||||||
@@ -1599,30 +1599,43 @@ export async function startConflictResolution(panel: KanbanWebviewPanel, opts: {
|
|||||||
* (handleImplement / handleResumeSession when sessionKind === 'implement')
|
* (handleImplement / handleResumeSession when sessionKind === 'implement')
|
||||||
* should launch with. Priority:
|
* should launch with. Priority:
|
||||||
* 1. 工单级 `profilePath`(详情面板「实施配置文件」)
|
* 1. 工单级 `profilePath`(详情面板「实施配置文件」)
|
||||||
* 2. getDefaultProfilePath()
|
* 2. 设置里的「实施默认配置文件」
|
||||||
|
* 3. getDefaultProfilePath()
|
||||||
*
|
*
|
||||||
* 冲突解决用全局 `settings.conflictResolutionProfilePath`。
|
* 冲突解决用全局 `settings.conflictResolutionProfilePath`。
|
||||||
* 头脑风暴用 resolveBrainstormProfilePath;测试用 resolveTestProfilePath。
|
* 头脑风暴用 resolveBrainstormProfilePath;测试用 resolveTestProfilePath。
|
||||||
* 三者互不回退。
|
* 三者互不回退。
|
||||||
*/
|
*/
|
||||||
export function resolveImplementProfilePath(_panel: KanbanWebviewPanel, issueLevelProfilePath: string | undefined): string {
|
export function resolveImplementProfilePath(panel: KanbanWebviewPanel, issueLevelProfilePath: string | undefined): string {
|
||||||
return resolveProfilePath(issueLevelProfilePath?.trim() || undefined)
|
return resolveProfilePath(
|
||||||
|
issueLevelProfilePath?.trim()
|
||||||
|
|| getSettings(panel.context).defaultImplementProfilePath.trim()
|
||||||
|
|| undefined,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 头脑风暴会话 profile:工单级 `brainstormProfilePath` > DEFAULT。
|
* 头脑风暴会话 profile:工单级 `brainstormProfilePath` > 设置里的
|
||||||
* 不回退实施 profile。
|
* 「头脑风暴默认配置文件」> DEFAULT。不回退实施 profile。
|
||||||
*/
|
*/
|
||||||
export function resolveBrainstormProfilePath(_panel: KanbanWebviewPanel, brainstormProfilePath: string | undefined): string {
|
export function resolveBrainstormProfilePath(panel: KanbanWebviewPanel, brainstormProfilePath: string | undefined): string {
|
||||||
return resolveProfilePath(brainstormProfilePath?.trim() || undefined)
|
return resolveProfilePath(
|
||||||
|
brainstormProfilePath?.trim()
|
||||||
|
|| getSettings(panel.context).defaultBrainstormProfilePath.trim()
|
||||||
|
|| undefined,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试会话 profile:工单级 `testProfilePath` > DEFAULT。
|
* 测试会话 profile:工单级 `testProfilePath` > 设置里的「测试默认配置文件」
|
||||||
* 不回退实施 profile。
|
* > DEFAULT。不回退实施 profile。
|
||||||
*/
|
*/
|
||||||
export function resolveTestProfilePath(_panel: KanbanWebviewPanel, testProfilePath: string | undefined): string {
|
export function resolveTestProfilePath(panel: KanbanWebviewPanel, testProfilePath: string | undefined): string {
|
||||||
return resolveProfilePath(testProfilePath?.trim() || undefined)
|
return resolveProfilePath(
|
||||||
|
testProfilePath?.trim()
|
||||||
|
|| getSettings(panel.context).defaultTestProfilePath.trim()
|
||||||
|
|| undefined,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ export async function handleSettingsSave(panel: KanbanWebviewPanel, payload: {
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -74,6 +77,10 @@ export async function handleSettingsSave(panel: KanbanWebviewPanel, payload: {
|
|||||||
const trimmedPreRemove = payload.worktreePreRemoveScript.trim()
|
const trimmedPreRemove = payload.worktreePreRemoveScript.trim()
|
||||||
const trimmedImplPre = payload.implTabPreCreateScript.trim()
|
const trimmedImplPre = payload.implTabPreCreateScript.trim()
|
||||||
const trimmedImplPost = payload.implTabPostCloseScript.trim()
|
const trimmedImplPost = payload.implTabPostCloseScript.trim()
|
||||||
|
// 三个会话默认 profile:'' 有意义(= 落到 DEFAULT_PROFILE_PATH),只 trim。
|
||||||
|
const trimmedDefaultBrainstormProfile = payload.defaultBrainstormProfilePath.trim()
|
||||||
|
const trimmedDefaultImplementProfile = payload.defaultImplementProfilePath.trim()
|
||||||
|
const trimmedDefaultTestProfile = payload.defaultTestProfilePath.trim()
|
||||||
// conflict-resolution profile: '' is meaningful (= DEFAULT_PROFILE_PATH).
|
// conflict-resolution profile: '' is meaningful (= DEFAULT_PROFILE_PATH).
|
||||||
const trimmedConflictProfile = payload.conflictResolutionProfilePath.trim()
|
const trimmedConflictProfile = payload.conflictResolutionProfilePath.trim()
|
||||||
// 提交代码 profile:'' 有意义(= 未配置 → 提交严格失败),只 trim。
|
// 提交代码 profile:'' 有意义(= 未配置 → 提交严格失败),只 trim。
|
||||||
@@ -118,6 +125,9 @@ export async function handleSettingsSave(panel: KanbanWebviewPanel, payload: {
|
|||||||
implTabPreCreateScript: trimmedImplPre,
|
implTabPreCreateScript: trimmedImplPre,
|
||||||
implTabPostCloseScript: trimmedImplPost,
|
implTabPostCloseScript: trimmedImplPost,
|
||||||
splitNewTerminals: payload.splitNewTerminals,
|
splitNewTerminals: payload.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: trimmedDefaultBrainstormProfile,
|
||||||
|
defaultImplementProfilePath: trimmedDefaultImplementProfile,
|
||||||
|
defaultTestProfilePath: trimmedDefaultTestProfile,
|
||||||
conflictResolutionProfilePath: trimmedConflictProfile,
|
conflictResolutionProfilePath: trimmedConflictProfile,
|
||||||
commitProfilePath: trimmedCommitProfile,
|
commitProfilePath: trimmedCommitProfile,
|
||||||
prDiffSummaryProfilePath: trimmedPrDiffSummaryProfile,
|
prDiffSummaryProfilePath: trimmedPrDiffSummaryProfile,
|
||||||
@@ -147,6 +157,9 @@ export async function handleSettingsSave(panel: KanbanWebviewPanel, payload: {
|
|||||||
implTabPreCreateScript: trimmedImplPre,
|
implTabPreCreateScript: trimmedImplPre,
|
||||||
implTabPostCloseScript: trimmedImplPost,
|
implTabPostCloseScript: trimmedImplPost,
|
||||||
splitNewTerminals: payload.splitNewTerminals,
|
splitNewTerminals: payload.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: trimmedDefaultBrainstormProfile,
|
||||||
|
defaultImplementProfilePath: trimmedDefaultImplementProfile,
|
||||||
|
defaultTestProfilePath: trimmedDefaultTestProfile,
|
||||||
conflictResolutionProfilePath: trimmedConflictProfile,
|
conflictResolutionProfilePath: trimmedConflictProfile,
|
||||||
commitProfilePath: trimmedCommitProfile,
|
commitProfilePath: trimmedCommitProfile,
|
||||||
prDiffSummaryProfilePath: trimmedPrDiffSummaryProfile,
|
prDiffSummaryProfilePath: trimmedPrDiffSummaryProfile,
|
||||||
@@ -253,6 +266,9 @@ export async function handleEditSettingsRequest(panel: KanbanWebviewPanel): Prom
|
|||||||
implTabPreCreateScript: s.implTabPreCreateScript,
|
implTabPreCreateScript: s.implTabPreCreateScript,
|
||||||
implTabPostCloseScript: s.implTabPostCloseScript,
|
implTabPostCloseScript: s.implTabPostCloseScript,
|
||||||
splitNewTerminals: s.splitNewTerminals,
|
splitNewTerminals: s.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: s.defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath: s.defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath: s.defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
conflictResolutionProfilePath: s.conflictResolutionProfilePath,
|
||||||
commitProfilePath,
|
commitProfilePath,
|
||||||
prDiffSummaryProfilePath,
|
prDiffSummaryProfilePath,
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ export type ExtensionToWebview
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -165,6 +168,9 @@ export type WebviewToExtension
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
|
|||||||
@@ -180,6 +180,15 @@ export interface Settings {
|
|||||||
* extension finds the project's first `isResolved` state value and uses that.
|
* extension finds the project's first `isResolved` state value and uses that.
|
||||||
*/
|
*/
|
||||||
youtrackCloseCommand: string
|
youtrackCloseCommand: string
|
||||||
|
/**
|
||||||
|
* 头脑风暴会话的默认 Claude profile 绝对路径。工单详情面板里的
|
||||||
|
* 「头脑风暴配置文件」为空时用它;它也为空才落到 DEFAULT_PROFILE_PATH。
|
||||||
|
*/
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
/** 实施会话的默认 Claude profile;工单级「实施配置文件」为空时用它。 */
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
/** 测试会话的默认 Claude profile;工单级「测试配置文件」为空时用它。 */
|
||||||
|
defaultTestProfilePath: string
|
||||||
/**
|
/**
|
||||||
* Claude settings profile path for the conflict-resolution cc session
|
* Claude settings profile path for the conflict-resolution cc session
|
||||||
* (drag to 完成 when PR merge conflicts). Empty = DEFAULT_PROFILE_PATH.
|
* (drag to 完成 when PR merge conflicts). Empty = DEFAULT_PROFILE_PATH.
|
||||||
@@ -272,6 +281,9 @@ function defaults(ctx: ExtensionContext): Settings {
|
|||||||
youtrackBaseUrl: '',
|
youtrackBaseUrl: '',
|
||||||
youtrackProjectShortName: '',
|
youtrackProjectShortName: '',
|
||||||
youtrackCloseCommand: '',
|
youtrackCloseCommand: '',
|
||||||
|
defaultBrainstormProfilePath: '',
|
||||||
|
defaultImplementProfilePath: '',
|
||||||
|
defaultTestProfilePath: '',
|
||||||
conflictResolutionProfilePath: '',
|
conflictResolutionProfilePath: '',
|
||||||
commitProfilePath: '',
|
commitProfilePath: '',
|
||||||
prDiffSummaryProfilePath: '',
|
prDiffSummaryProfilePath: '',
|
||||||
@@ -369,6 +381,16 @@ export function getSettings(ctx: ExtensionContext): Settings {
|
|||||||
const youtrackCloseCommand = typeof stored.youtrackCloseCommand === 'string'
|
const youtrackCloseCommand = typeof stored.youtrackCloseCommand === 'string'
|
||||||
? stored.youtrackCloseCommand
|
? stored.youtrackCloseCommand
|
||||||
: base.youtrackCloseCommand
|
: base.youtrackCloseCommand
|
||||||
|
// 三个会话默认 profile:'' 有意义(= 落到 DEFAULT_PROFILE_PATH),不强制回退。
|
||||||
|
const defaultBrainstormProfilePath = typeof stored.defaultBrainstormProfilePath === 'string'
|
||||||
|
? stored.defaultBrainstormProfilePath
|
||||||
|
: base.defaultBrainstormProfilePath
|
||||||
|
const defaultImplementProfilePath = typeof stored.defaultImplementProfilePath === 'string'
|
||||||
|
? stored.defaultImplementProfilePath
|
||||||
|
: base.defaultImplementProfilePath
|
||||||
|
const defaultTestProfilePath = typeof stored.defaultTestProfilePath === 'string'
|
||||||
|
? stored.defaultTestProfilePath
|
||||||
|
: base.defaultTestProfilePath
|
||||||
// conflict-resolution profile: '' is meaningful (= DEFAULT_PROFILE_PATH at
|
// conflict-resolution profile: '' is meaningful (= DEFAULT_PROFILE_PATH at
|
||||||
// launch time), so don't coerce. Non-string legacy values collapse to ''.
|
// launch time), so don't coerce. Non-string legacy values collapse to ''.
|
||||||
const conflictResolutionProfilePath = typeof stored.conflictResolutionProfilePath === 'string'
|
const conflictResolutionProfilePath = typeof stored.conflictResolutionProfilePath === 'string'
|
||||||
@@ -417,6 +439,9 @@ export function getSettings(ctx: ExtensionContext): Settings {
|
|||||||
youtrackBaseUrl,
|
youtrackBaseUrl,
|
||||||
youtrackProjectShortName,
|
youtrackProjectShortName,
|
||||||
youtrackCloseCommand,
|
youtrackCloseCommand,
|
||||||
|
defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath,
|
conflictResolutionProfilePath,
|
||||||
commitProfilePath,
|
commitProfilePath,
|
||||||
prDiffSummaryProfilePath,
|
prDiffSummaryProfilePath,
|
||||||
|
|||||||
@@ -544,6 +544,9 @@ export function App() {
|
|||||||
initialImplTabPreCreateScript={settings?.implTabPreCreateScript ?? ''}
|
initialImplTabPreCreateScript={settings?.implTabPreCreateScript ?? ''}
|
||||||
initialImplTabPostCloseScript={settings?.implTabPostCloseScript ?? ''}
|
initialImplTabPostCloseScript={settings?.implTabPostCloseScript ?? ''}
|
||||||
initialSplitNewTerminals={settings?.splitNewTerminals ?? true}
|
initialSplitNewTerminals={settings?.splitNewTerminals ?? true}
|
||||||
|
initialDefaultBrainstormProfilePath={settings?.defaultBrainstormProfilePath ?? ''}
|
||||||
|
initialDefaultImplementProfilePath={settings?.defaultImplementProfilePath ?? ''}
|
||||||
|
initialDefaultTestProfilePath={settings?.defaultTestProfilePath ?? ''}
|
||||||
initialConflictResolutionProfilePath={settings?.conflictResolutionProfilePath ?? ''}
|
initialConflictResolutionProfilePath={settings?.conflictResolutionProfilePath ?? ''}
|
||||||
initialCommitProfilePath={settings?.commitProfilePath ?? ''}
|
initialCommitProfilePath={settings?.commitProfilePath ?? ''}
|
||||||
initialPrDiffSummaryProfilePath={settings?.prDiffSummaryProfilePath ?? ''}
|
initialPrDiffSummaryProfilePath={settings?.prDiffSummaryProfilePath ?? ''}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ interface SubmitValues {
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -87,6 +90,9 @@ export interface SettingsModalProps {
|
|||||||
initialImplTabPreCreateScript: string
|
initialImplTabPreCreateScript: string
|
||||||
initialImplTabPostCloseScript: string
|
initialImplTabPostCloseScript: string
|
||||||
initialSplitNewTerminals: boolean
|
initialSplitNewTerminals: boolean
|
||||||
|
initialDefaultBrainstormProfilePath: string
|
||||||
|
initialDefaultImplementProfilePath: string
|
||||||
|
initialDefaultTestProfilePath: string
|
||||||
initialConflictResolutionProfilePath: string
|
initialConflictResolutionProfilePath: string
|
||||||
initialCommitProfilePath: string
|
initialCommitProfilePath: string
|
||||||
initialPrDiffSummaryProfilePath: string
|
initialPrDiffSummaryProfilePath: string
|
||||||
@@ -173,6 +179,9 @@ export function SettingsModal({
|
|||||||
initialImplTabPreCreateScript,
|
initialImplTabPreCreateScript,
|
||||||
initialImplTabPostCloseScript,
|
initialImplTabPostCloseScript,
|
||||||
initialSplitNewTerminals,
|
initialSplitNewTerminals,
|
||||||
|
initialDefaultBrainstormProfilePath,
|
||||||
|
initialDefaultImplementProfilePath,
|
||||||
|
initialDefaultTestProfilePath,
|
||||||
initialConflictResolutionProfilePath,
|
initialConflictResolutionProfilePath,
|
||||||
initialCommitProfilePath,
|
initialCommitProfilePath,
|
||||||
initialPrDiffSummaryProfilePath,
|
initialPrDiffSummaryProfilePath,
|
||||||
@@ -211,6 +220,9 @@ export function SettingsModal({
|
|||||||
const [implTabPreCreateScript, setImplTabPreCreateScript] = useState(initialImplTabPreCreateScript)
|
const [implTabPreCreateScript, setImplTabPreCreateScript] = useState(initialImplTabPreCreateScript)
|
||||||
const [implTabPostCloseScript, setImplTabPostCloseScript] = useState(initialImplTabPostCloseScript)
|
const [implTabPostCloseScript, setImplTabPostCloseScript] = useState(initialImplTabPostCloseScript)
|
||||||
const [splitNewTerminals, setSplitNewTerminals] = useState(initialSplitNewTerminals)
|
const [splitNewTerminals, setSplitNewTerminals] = useState(initialSplitNewTerminals)
|
||||||
|
const [defaultBrainstormProfilePath, setDefaultBrainstormProfilePath] = useState(initialDefaultBrainstormProfilePath)
|
||||||
|
const [defaultImplementProfilePath, setDefaultImplementProfilePath] = useState(initialDefaultImplementProfilePath)
|
||||||
|
const [defaultTestProfilePath, setDefaultTestProfilePath] = useState(initialDefaultTestProfilePath)
|
||||||
const [conflictResolutionProfilePath, setConflictResolutionProfilePath] = useState(initialConflictResolutionProfilePath)
|
const [conflictResolutionProfilePath, setConflictResolutionProfilePath] = useState(initialConflictResolutionProfilePath)
|
||||||
const [commitProfilePath, setCommitProfilePath] = useState(initialCommitProfilePath)
|
const [commitProfilePath, setCommitProfilePath] = useState(initialCommitProfilePath)
|
||||||
const [prDiffSummaryProfilePath, setPrDiffSummaryProfilePath] = useState(initialPrDiffSummaryProfilePath)
|
const [prDiffSummaryProfilePath, setPrDiffSummaryProfilePath] = useState(initialPrDiffSummaryProfilePath)
|
||||||
@@ -251,6 +263,9 @@ export function SettingsModal({
|
|||||||
setImplTabPreCreateScript(initialImplTabPreCreateScript)
|
setImplTabPreCreateScript(initialImplTabPreCreateScript)
|
||||||
setImplTabPostCloseScript(initialImplTabPostCloseScript)
|
setImplTabPostCloseScript(initialImplTabPostCloseScript)
|
||||||
setSplitNewTerminals(initialSplitNewTerminals)
|
setSplitNewTerminals(initialSplitNewTerminals)
|
||||||
|
setDefaultBrainstormProfilePath(initialDefaultBrainstormProfilePath)
|
||||||
|
setDefaultImplementProfilePath(initialDefaultImplementProfilePath)
|
||||||
|
setDefaultTestProfilePath(initialDefaultTestProfilePath)
|
||||||
setConflictResolutionProfilePath(initialConflictResolutionProfilePath)
|
setConflictResolutionProfilePath(initialConflictResolutionProfilePath)
|
||||||
setCommitProfilePath(initialCommitProfilePath)
|
setCommitProfilePath(initialCommitProfilePath)
|
||||||
setPrDiffSummaryProfilePath(initialPrDiffSummaryProfilePath)
|
setPrDiffSummaryProfilePath(initialPrDiffSummaryProfilePath)
|
||||||
@@ -342,6 +357,10 @@ export function SettingsModal({
|
|||||||
implTabPreCreateScript: implTabPreCreateScript.trim(),
|
implTabPreCreateScript: implTabPreCreateScript.trim(),
|
||||||
implTabPostCloseScript: implTabPostCloseScript.trim(),
|
implTabPostCloseScript: implTabPostCloseScript.trim(),
|
||||||
splitNewTerminals,
|
splitNewTerminals,
|
||||||
|
// 三个会话默认 profile:空串 = 落到 DEFAULT_PROFILE_PATH
|
||||||
|
defaultBrainstormProfilePath: defaultBrainstormProfilePath.trim(),
|
||||||
|
defaultImplementProfilePath: defaultImplementProfilePath.trim(),
|
||||||
|
defaultTestProfilePath: defaultTestProfilePath.trim(),
|
||||||
// 冲突解决 profile:空串 = 用 DEFAULT_PROFILE_PATH
|
// 冲突解决 profile:空串 = 用 DEFAULT_PROFILE_PATH
|
||||||
conflictResolutionProfilePath: conflictResolutionProfilePath.trim(),
|
conflictResolutionProfilePath: conflictResolutionProfilePath.trim(),
|
||||||
// 提交代码 profile:空串 = 未配置 → 提交严格失败
|
// 提交代码 profile:空串 = 未配置 → 提交严格失败
|
||||||
@@ -528,6 +547,78 @@ export function SettingsModal({
|
|||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
label="头脑风暴默认配置文件"
|
||||||
|
hint={(
|
||||||
|
<>
|
||||||
|
新建工单 / 续聊的头脑风暴会话默认用此 profile;工单详情面板里的「头脑风暴配置文件」优先级更高。留空用 official。
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<SelectMenu
|
||||||
|
value={defaultBrainstormProfilePath}
|
||||||
|
onChange={setDefaultBrainstormProfilePath}
|
||||||
|
variant="input"
|
||||||
|
className={inputClass}
|
||||||
|
options={[
|
||||||
|
{ value: '', label: '(默认)' },
|
||||||
|
...profiles.map(p => ({ value: p.path, label: p.name })),
|
||||||
|
...(defaultBrainstormProfilePath
|
||||||
|
&& !profiles.some(p => p.path === defaultBrainstormProfilePath)
|
||||||
|
? [{ value: defaultBrainstormProfilePath, label: `自定义:${defaultBrainstormProfilePath}` }]
|
||||||
|
: []),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
label="实施默认配置文件"
|
||||||
|
hint={(
|
||||||
|
<>
|
||||||
|
实施会话默认用此 profile;工单详情面板里的「实施配置文件」优先级更高。留空用 official。
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<SelectMenu
|
||||||
|
value={defaultImplementProfilePath}
|
||||||
|
onChange={setDefaultImplementProfilePath}
|
||||||
|
variant="input"
|
||||||
|
className={inputClass}
|
||||||
|
options={[
|
||||||
|
{ value: '', label: '(默认)' },
|
||||||
|
...profiles.map(p => ({ value: p.path, label: p.name })),
|
||||||
|
...(defaultImplementProfilePath
|
||||||
|
&& !profiles.some(p => p.path === defaultImplementProfilePath)
|
||||||
|
? [{ value: defaultImplementProfilePath, label: `自定义:${defaultImplementProfilePath}` }]
|
||||||
|
: []),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
label="测试默认配置文件"
|
||||||
|
hint={(
|
||||||
|
<>
|
||||||
|
测试会话默认用此 profile;工单详情面板里的「测试配置文件」优先级更高。留空用 official。
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<SelectMenu
|
||||||
|
value={defaultTestProfilePath}
|
||||||
|
onChange={setDefaultTestProfilePath}
|
||||||
|
variant="input"
|
||||||
|
className={inputClass}
|
||||||
|
options={[
|
||||||
|
{ value: '', label: '(默认)' },
|
||||||
|
...profiles.map(p => ({ value: p.path, label: p.name })),
|
||||||
|
...(defaultTestProfilePath
|
||||||
|
&& !profiles.some(p => p.path === defaultTestProfilePath)
|
||||||
|
? [{ value: defaultTestProfilePath, label: `自定义:${defaultTestProfilePath}` }]
|
||||||
|
: []),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
label="冲突解决配置文件"
|
label="冲突解决配置文件"
|
||||||
hint={(
|
hint={(
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ export interface SettingsValues {
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -91,6 +94,9 @@ export interface SettingsOverlayState {
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -422,6 +428,9 @@ export function useIssues(): UseIssuesResult {
|
|||||||
implTabPreCreateScript: values.implTabPreCreateScript,
|
implTabPreCreateScript: values.implTabPreCreateScript,
|
||||||
implTabPostCloseScript: values.implTabPostCloseScript,
|
implTabPostCloseScript: values.implTabPostCloseScript,
|
||||||
splitNewTerminals: values.splitNewTerminals,
|
splitNewTerminals: values.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: values.defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath: values.defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath: values.defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath: values.conflictResolutionProfilePath,
|
conflictResolutionProfilePath: values.conflictResolutionProfilePath,
|
||||||
commitProfilePath: values.commitProfilePath,
|
commitProfilePath: values.commitProfilePath,
|
||||||
prDiffSummaryProfilePath: values.prDiffSummaryProfilePath,
|
prDiffSummaryProfilePath: values.prDiffSummaryProfilePath,
|
||||||
@@ -824,6 +833,9 @@ export function useIssues(): UseIssuesResult {
|
|||||||
implTabPreCreateScript: msg.implTabPreCreateScript,
|
implTabPreCreateScript: msg.implTabPreCreateScript,
|
||||||
implTabPostCloseScript: msg.implTabPostCloseScript,
|
implTabPostCloseScript: msg.implTabPostCloseScript,
|
||||||
splitNewTerminals: msg.splitNewTerminals,
|
splitNewTerminals: msg.splitNewTerminals,
|
||||||
|
defaultBrainstormProfilePath: msg.defaultBrainstormProfilePath,
|
||||||
|
defaultImplementProfilePath: msg.defaultImplementProfilePath,
|
||||||
|
defaultTestProfilePath: msg.defaultTestProfilePath,
|
||||||
conflictResolutionProfilePath: msg.conflictResolutionProfilePath,
|
conflictResolutionProfilePath: msg.conflictResolutionProfilePath,
|
||||||
commitProfilePath: msg.commitProfilePath,
|
commitProfilePath: msg.commitProfilePath,
|
||||||
prDiffSummaryProfilePath: msg.prDiffSummaryProfilePath,
|
prDiffSummaryProfilePath: msg.prDiffSummaryProfilePath,
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ export type ExtensionToWebview
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
@@ -196,6 +199,9 @@ export type WebviewToExtension
|
|||||||
implTabPreCreateScript: string
|
implTabPreCreateScript: string
|
||||||
implTabPostCloseScript: string
|
implTabPostCloseScript: string
|
||||||
splitNewTerminals: boolean
|
splitNewTerminals: boolean
|
||||||
|
defaultBrainstormProfilePath: string
|
||||||
|
defaultImplementProfilePath: string
|
||||||
|
defaultTestProfilePath: string
|
||||||
conflictResolutionProfilePath: string
|
conflictResolutionProfilePath: string
|
||||||
commitProfilePath: string
|
commitProfilePath: string
|
||||||
prDiffSummaryProfilePath: string
|
prDiffSummaryProfilePath: string
|
||||||
|
|||||||
Reference in new issue
Block a user