Skip to content

fix: 补全 applyUserMessageLayoutState 缺失的 import,修复保存全局设置报错 - #184

Merged
lioensky merged 1 commit into
lioensky:mainfrom
Lutra23:fix/settings-apply-layout-import
Aug 26, 2026
Merged

fix: 补全 applyUserMessageLayoutState 缺失的 import,修复保存全局设置报错#184
lioensky merged 1 commit into
lioensky:mainfrom
Lutra23:fix/settings-apply-layout-import

Conversation

@Lutra23

@Lutra23 Lutra23 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

问题

在全局设置中点击「保存」时,必现如下报错(设置本身已写入,但保存后的界面即时应用被中断):

设置已保存,但界面应用失败:
applyUserMessageLayoutState is not defined

根因

2a259e39fmodules/renderer/mainChatSettingsPresentationOwner.jsapplyUserChatBubbleUiState() 中新增了对 applyUserMessageLayoutState() 的调用,但该文件没有任何 import 语句,模块作用域内不存在此标识符,保存设置后刷新用户气泡布局时抛出 ReferenceError

修复

补全缺失的 import:

import { applyUserMessageLayoutState } from './domBuilder.js';

domBuilder.js 为零依赖的叶子模块,不存在循环引用风险。

验证

  • node --check 通过;
  • 保存全局设置不再弹出该警告,用户气泡布局/字体/气泡宽度等即时应用恢复正常。

@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

@lioensky
lioensky merged commit c793a3c into lioensky:main Aug 26, 2026
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.

2 participants