feat(personalization): 新增隐藏工具审核面板选项

- 个人空间「工具」页新增开关,默认开启
- 自动审核模式下开启时,后台审核工具不再自动展开审核面板
  (实时审批事件与待审批轮询两处自动展开均拦截,含移动端 overlay)
- 手动批准模式不受影响,面板照常弹出等待人工操作
This commit is contained in:
JOJO 2026-07-21 17:13:19 +08:00
parent 9618148ed3
commit 1901aeb82f
5 changed files with 50 additions and 7 deletions

View File

@ -91,6 +91,7 @@ DEFAULT_PERSONALIZATION_CONFIG: Dict[str, Any] = {
"deep_compress_trigger_tokens": None,
"deep_compress_form": "file", # 深压缩形式file-生成文件 / inject-直接注入文件全文
"silent_tool_disable": True, # 禁用工具时不向模型插入提示(默认开启)
"hide_tool_approval_panel": True, # 自动审核模式下不自动打开工具审核面板(默认开启)
"enhanced_tool_display": True, # 增强工具显示
"compact_message_display": "full", # 简略消息显示full-完整原始内容 / brief-一行概要
"block_display_mode": "stacked", # 堆叠块显示模式traditional-传统列表 / stacked-堆叠动画 / minimal-极简模式
@ -440,6 +441,12 @@ def sanitize_personalization_payload(
else:
base["silent_tool_disable"] = bool(base.get("silent_tool_disable"))
# 隐藏工具审核面板(自动审核模式下不自动展开)
if "hide_tool_approval_panel" in data:
base["hide_tool_approval_panel"] = bool(data.get("hide_tool_approval_panel"))
else:
base["hide_tool_approval_panel"] = bool(base.get("hide_tool_approval_panel", True))
# 增强工具显示
if "enhanced_tool_display" in data:
base["enhanced_tool_display"] = bool(data.get("enhanced_tool_display"))

View File

@ -1,6 +1,7 @@
// @ts-nocheck
import { debugLog } from '../common';
import { useTaskStore } from '../../../stores/task';
import { usePersonalizationStore } from '../../../stores/personalization';
import { getMessageVisibility, messageStartsWork } from '../../../utils/messageVisibility';
import {
debugNotifyLog,
@ -347,12 +348,18 @@ export const toolMethods = {
if ((this.autoApprovalFeedLines || []).length === 0) {
this.autoApprovalFinalMessage = '';
}
this.rightCollapsed = false;
if (this.rightWidth < this.minPanelWidth) {
this.rightWidth = this.minPanelWidth;
}
if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') {
this.openMobileOverlay('approval');
// 自动审核模式 + 个人空间开启「隐藏工具审核面板」时,不自动展开审核面板
const hideApprovalPanel =
this.currentPermissionMode === 'auto_approval' &&
usePersonalizationStore().form.hide_tool_approval_panel !== false;
if (!hideApprovalPanel) {
this.rightCollapsed = false;
if (this.rightWidth < this.minPanelWidth) {
this.rightWidth = this.minPanelWidth;
}
if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') {
this.openMobileOverlay('approval');
}
}
this.$forceUpdate();
},

View File

@ -352,8 +352,12 @@ export const permissionMethods = {
}
const items = Array.isArray(payload.items) ? payload.items : [];
this.pendingToolApprovals = items;
// 自动审核模式 + 个人空间开启「隐藏工具审核面板」时,不自动展开审核面板
const hideApprovalPanel =
this.currentPermissionMode === 'auto_approval' &&
usePersonalizationStore().form.hide_tool_approval_panel !== false;
// 电脑端:有审批时自动展开面板
if (items.length > 0 && !this.isMobileViewport) {
if (items.length > 0 && !this.isMobileViewport && !hideApprovalPanel) {
this.rightCollapsed = false;
if (this.rightWidth < this.minPanelWidth) {
this.rightWidth = this.minPanelWidth;

View File

@ -1360,6 +1360,28 @@
class="fancy-path"
></path></svg></span
></label>
<label class="settings-toggle-row"
><span class="settings-row-copy"
><span class="settings-row-title">隐藏工具审核面板</span
><span class="settings-row-desc"
>自动审核模式下后台审核工具时不再自动展开审核面板</span
></span
><input
type="checkbox"
:checked="form.hide_tool_approval_panel"
@change="
personalization.updateField({
key: 'hide_tool_approval_panel',
value: $event.target.checked
})
" /><span class="fancy-check" aria-hidden="true"
><svg viewBox="0 0 64 64">
<path
d="M 0 16 V 56 A 8 8 90 0 0 8 64 H 56 A 8 8 90 0 0 64 56 V 8 A 8 8 90 0 0 56 0 H 8 A 8 8 90 0 0 0 8 V 16 L 32 48 L 64 16 V 8 A 8 8 90 0 0 56 0 H 8 A 8 8 90 0 0 0 8 V 56 A 8 8 90 0 0 8 64 H 56 A 8 8 90 0 0 64 56 V 16"
pathLength="575.0541381835938"
class="fancy-path"
></path></svg></span
></label>
<label class="settings-toggle-row"
><span class="settings-row-copy"
><span class="settings-row-title">工具意图提示</span

View File

@ -25,6 +25,7 @@ interface PersonalForm {
skill_strict_run_command_foreground_enabled: boolean;
skill_strict_run_command_background_enabled: boolean;
silent_tool_disable: boolean;
hide_tool_approval_panel: boolean;
enhanced_tool_display: boolean;
compact_message_display: CompactMessageDisplay;
block_display_mode: BlockDisplayMode;
@ -186,6 +187,7 @@ const defaultForm = (): PersonalForm => ({
skill_strict_run_command_foreground_enabled: false,
skill_strict_run_command_background_enabled: false,
silent_tool_disable: false,
hide_tool_approval_panel: true,
enhanced_tool_display: true,
compact_message_display: 'full',
block_display_mode: loadCachedBlockDisplayMode(),
@ -378,6 +380,7 @@ export const usePersonalizationStore = defineStore('personalization', {
skill_strict_run_command_background_enabled:
!!data.skill_strict_run_command_background_enabled,
silent_tool_disable: !!data.silent_tool_disable,
hide_tool_approval_panel: data.hide_tool_approval_panel !== false,
enhanced_tool_display: data.enhanced_tool_display !== false,
compact_message_display: data.compact_message_display === 'brief' ? 'brief' : 'full',
block_display_mode: