Skip to content

feat: 恢复「开启Agent自定义气泡主题」全局开关 - #185

Closed
Lutra23 wants to merge 1 commit into
lioensky:mainfrom
Lutra23:feat/restore-agent-bubble-theme-toggle
Closed

feat: 恢复「开启Agent自定义气泡主题」全局开关#185
Lutra23 wants to merge 1 commit into
lioensky:mainfrom
Lutra23:feat/restore-agent-bubble-theme-toggle

Conversation

@Lutra23

@Lutra23 Lutra23 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

背景

0137f925 移除了全局设置中的「开启Agent自定义气泡主题」开关,同时删掉了渲染与注入侧的条件判断,该功能变为强制开启且用户没有任何关闭入口。实际上社区用户对此有真实的关闭需求(例如不需要 Agent 输出 DIV 气泡、不希望 system prompt 被注入 {{VarDivRender}} 规范、或希望停用气泡内脚本/动画执行)。

本 PR 将该开关连同其完整控制链路按 0137f925 之前的原样恢复,用户可在 设置 → 聊天字体与气泡 小节自行开关。

改动内容

环节 文件 说明
UI main.html 恢复开关(位置在原处:「聊天字体与气泡」小节顶部)
默认值 modules/utils/appSettingsManager.js enableAgentBubbleTheme: false
保存 modules/global-settings-manager.js 保存时收集 checkbox 状态
回填 modules/renderer/mainChatSettingsPresentationOwner.js 打开设置面板时回显当前值
渲染 modules/messageRenderer.js modules/renderer/streamManager.js 关闭时不再执行气泡内动画/脚本/3D(processAnimationsInContent
注入(单聊) modules/ipc/chatHandlers.js 关闭时不再向 system prompt 注入 {{VarDivRender}} 输出规范
注入(群聊) Groupmodules/groupchat.js 同上,恢复设置字段读取与两处注入点

默认值与删除前一致(false);已有 settings.json 中存留 enableAgentBubbleTheme 键的老用户升级后直接按原值生效。

验证

  • 全部改动文件 node --check 通过;
  • 实机验证:开 → Agent 气泡动画/注入生效;关 → 渲染与注入全链路停止,settings.json 正确落盘。

备注

保存全局设置时还有一个与本 PR 无关的 applyUserMessageLayoutState is not defined 报错,见 #184,两个 PR 相互独立、可分别合并。

@Lutra23

Lutra23 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

本 PR 报的 Invalid workflow file: chat_kernel_ui.yml#L70 与本改动无关:main 分支的该 workflow 文件自身存在 YAML 语法错误(裸标量中的 : 被解析为 mapping),自 ddbd3c2c 起所有基于 main 的 PR 均会触发。修复见 #186

@Lutra23

Lutra23 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

撤回本 PR:经排查,气泡注入链路已由 Tavern(高级回复)规则系统的官方预置规则 builtin_agent_div_render 承担,本 PR 恢复的注入部分与之冗余,上游当初移除是合理的。保存设置时的 ReferenceError 修复见 #184,CI workflow 语法修复见 #186

@Lutra23 Lutra23 closed this Aug 26, 2026
@Lutra23
Lutra23 deleted the feat/restore-agent-bubble-theme-toggle branch August 26, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant