Repository navigation
feat(theme): 开放 Windows 主题 CSS 布局配置,修复切换聊天卡顿 - #3008
Merged
BigPizzaV3 merged 6 commits intoNov 10, 2026
Merged
Conversation
added 2 commits
November 10, 2026 00:26
…tion Use semantic theme parts to reset Windows sidebar/header gutters across the workspace sidebar and detached page header layouts. Cache the two remaining Dream Skin composer predicates through the existing marker lifecycle, retaining specificity and observing all inputs. Install the manager popup parent rule only while its page is open. Add stylesheet/lifecycle regressions and real Chromium coverage for conditional paint, mutation updates, alignment and cleanup. Validation: 197 related Node tests and Chromium regression matrix pass.
Owner
|
感谢!代码看过了,方向没问题。CI 红有两个原因,我直接在分支上补了一个提交(34a5d10b6):一是 PR 改了 |
Owner
|
三平台 CI 通过,已合入 main,会随下个版本发布。感谢! |
FoxSuzuran
pushed a commit
to FoxSuzuran/CodexPlusPlus
that referenced
this pull request
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本 PR 包含两项主题相关改动:开放主题作者所需的侧栏、标题栏 CSS 布局配置,以及修复 Windows 启用主题后切换聊天的明显卡顿。两项改动均包含回归验证。
为什么加入主题 CSS 布局配置
新版 Codex 调整了侧栏与聊天标题栏的结构和原生样式。主题作者需要按主题设置这些部件的高度、边距,以适配实际界面;现有 Safe CSS 校验不接受相应属性,主题包无法声明这些设置。
本次为主题作者开放明确的 CSS 配置入口:主题写入相关声明后才生效,未设置时沿用原有布局。
功能范围
sidebarmargin-top0或0px~64pxheadermargin-inline-end0或0px~64pxheaderheight32px~128px这些声明通过现有主题包导入、校验、保存和激活流程。客户端在校验通过后添加覆盖优先级,确保能覆盖原生 utilities 的 important;主题文件中无需
!important。布局声明仅作用于启用主题的 Windows 界面,其他外观声明保留原有行为。使用方式及示例见 主题作者文档。示例数值不会自动写入主题。
聊天切换性能修复
问题表现与复现条件
在 Windows 上启用 Dream Skin 后,切换已有聊天时界面出现明显停顿,用户体感可超过 2 秒。关闭主题,或对相关样式规则进行临时优化后,切换明显改善。
现场环境为 Codex++ 2.4.0、Codex 26.1103.4239.0。复现方式:启用主题,在两个已有聊天之间反复切换;随后关闭主题,以相同目标和顺序进行对照。聊天内容、缓存和设备性能会影响具体耗时,不能保证所有环境出现相同延迟。
排查依据
现场记录显示,停顿期间主线程有大量样式重新计算。进一步对照发现,主题和通用增强样式中三条常驻的
:has()关系规则构成了一组可复现的性能触发源:这些规则在当前聊天页中可以没有匹配元素,但仍常驻样式表。结合样式重算记录和布局读取调用栈,推断其扩大了聊天 DOM 更新时的样式失效范围;后续同步读取布局会迫使重算执行。尚未取得逐选择器的独立耗时,因此不将某一条规则认定为唯一原因。
在同一设备、同一组聊天的交替对照中,各条件取 4 次样本,临时移除上述三条规则后的记录如下:
这组数据用于说明定位依据,来自临时规则对照,并非最终程序的统一性能承诺。最大帧间隔反映界面卡顿,不等于点击到内容完全就绪的总时间;累计样式计算时间也不等于切换延迟。移除后仍有停顿,说明还存在其他开销。
对照期间保留了同一张 4720×2626 背景图和其他主题外观,未通过降低图片清晰度获得改善,也没有发现每次切换都会重新分析背景图的证据。
实际修复
data-*状态替代常驻的原生:has()判断,保留原有视觉条件及选择器优先级。修复适用于相应的 Windows 主题运行时和通用增强样式,没有绑定某个主题 ID 或背景图。非 Windows 平台保留原有规则,macOS renderer 源文件保持原样。
回归验证与人工验收
自动化回归覆盖结构条件出现、变化、消失及节点移除时的标记更新与清理,以及管理页弹层规则的按需安装、移除。先前性能修复测试版已获得用户“切换正常、不卡”的反馈;本轮加入主题布局配置后的完整 Windows 构建已通过下述自动化验证。实机流畅度反馈仅代表现场环境。
人工验收重点为:同一主题下反复切换聊天,检查卡顿是否改善;同时检查首页输入框圆角、全图模式输入框背景,以及管理页菜单和提示框的层级是否正常。测试时应关闭此前的两个临时对照扩展。
验证状态
本地相关 Node 回归 197 项通过、0 失败;独立 Chromium 的默认布局和原有性能回归通过。
云端完整前端测试 1831 项通过、2 项跳过、0 失败,类型检查通过。主题包与布局相关 Rust 测试 14 项通过、0 失败,覆盖属性/值范围、主题包导入保存和 Windows 作用域。
浏览器回归读取了 Rust 实际编译出的 CSS,自定义数值、原生 important 层叠、换肤、关闭主题及平台隔离检查通过。
Windows 2.4.0 程序已成功构建:云构建记录。源码提交为
2e5b7ebddbb7aa0e3059b29eb4fb18a48aee07ed,版本号保持不变。构建工作流仅在 Fork 中使用,不纳入本 PR 的源码差异。目前没有 macOS 实机测试结果。本地此前用于对照的两个临时扩展,在程序实测时应关闭,避免掩盖结果。