diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 7323f4b..290a225 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -1,7 +1,7 @@ { "identifier": "default", "description": "DevFlow default permissions", - "windows": ["main", "ai-detached"], + "windows": ["main", "ai-detached", "ai-detached-*", "fe-detached-*"], "permissions": [ "core:default", "core:event:default", diff --git a/src/components/settings/AdvancedSection.vue b/src/components/settings/AdvancedSection.vue index a749966..7ceb18d 100644 --- a/src/components/settings/AdvancedSection.vue +++ b/src/components/settings/AdvancedSection.vue @@ -86,8 +86,14 @@ onMounted(async () => { // 字段。此处用 msg 拼标题+内容,dangerLabel 作确认按钮文案,自渲染独立弹层(上方模板)。 const { confirmState, confirmDialog, answerConfirm } = useConfirm() -// 三档合法值 + 脏值白名单兜底:KV 被外部改库为非法值(空串/非三档)时回退 low, -// 防 option);脏值回退默认 15min。 +// 必须在 settings reactive 之前定义,防打包后初始化顺序导致 TDZ。 +const VALID_APPROVAL_TIMEOUTS = [0, 300_000, 900_000, 1_800_000, 3_600_000] +function clampApprovalTimeout(raw: number): number { + return VALID_APPROVAL_TIMEOUTS.includes(raw) ? raw : 900_000 +} + +// 三档合法值 + 脏值白名单兜底 const VALID_MODES = ['low', 'medium', 'all'] as const type AutoMode = (typeof VALID_MODES)[number] function clampMode(raw: string): AutoMode { @@ -145,14 +151,6 @@ function markSaved() { rowLogLevel.value?.markSaved() } -// 审批超时合法选项白名单(对齐 无匹配 option 致控件空白。允许的取值:0/5/15/30/60 分钟对应毫秒数。 -const VALID_APPROVAL_TIMEOUTS = [0, 300_000, 900_000, 1_800_000, 3_600_000] -function clampApprovalTimeout(raw: number): number { - return VALID_APPROVAL_TIMEOUTS.includes(raw) ? raw : 900_000 -} - -// 审批超时下拉变更:落 KV(df-approval-timeout,ms)+ 显「已保存」反馈。 // 下一笔发起的审批即生效(aiShared.startApprovalTimer 每次实时读),已在跑的计时器沿用旧值。 function onApprovalTimeoutChange() { appSettings.set('df-approval-timeout', settings.approvalTimeout) diff --git a/src/components/settings/AppearanceSection.vue b/src/components/settings/AppearanceSection.vue index 235a796..0da24dd 100644 --- a/src/components/settings/AppearanceSection.vue +++ b/src/components/settings/AppearanceSection.vue @@ -43,8 +43,8 @@