Skip to content

fix: update Codex compatibility and renderer performance - #2050

Closed
szguicheng wants to merge 7 commits into
BigPizzaV3:mainfrom
szguicheng:codex/modern-codex-skin-compat
Closed

fix: update Codex compatibility and renderer performance#2050
szguicheng wants to merge 7 commits into
BigPizzaV3:mainfrom
szguicheng:codex/modern-codex-skin-compat

Conversation

@szguicheng

@szguicheng szguicheng commented Aug 29, 2026

Copy link
Copy Markdown

Summary

This PR focuses on two areas:

1. Update compatibility with the latest Codex UI

Codex has changed its main UI structure, native field names, and theme/runtime surface contracts. This PR updates Codex++ to recognize and work with the latest Codex UI, including:

  • Modern main-surface, thread, header, message, composer, and scrolling structures.
  • The current Codex theme variables and Dream Skin API mapping.
  • Modern composer and thread lifecycle behavior.
  • Correct native field matching and state mapping, so existing theme behavior follows the right Codex UI state.
  • Safe cleanup and idempotent marker reconciliation when Codex changes or remounts UI sections.

2. Significantly improve Codex renderer performance

Previously, enabling the Codex++ renderer could make the entire Codex page feel noticeably sluggish. This PR substantially reduces renderer overhead by:

  • Coalescing repeated DOM scans and deferred work.
  • Avoiding redundant inline-style, attribute, text, and dataset writes.
  • Reducing unnecessary layout reads and repeated alignment work.
  • Throttling retry paths and preventing duplicate event-listener installation.
  • Making conversation alignment incremental and stable instead of repeatedly resetting layout.
  • Narrowing mutation observation to changes that can actually affect layout or behavior.

The result is a much lower renderer workload and a substantially smoother Codex UI when Codex++ is enabled.

No visual style is hard-coded into the application by this PR; theme appearance remains controlled by the theme layer.

Validation

  • npm test: 121 passed
  • cargo test -p codex-plus-core --test dream_skin_package --test dream_skin_runtime --test cdp_bridge: 131 passed, 1 ignored
  • node --check assets/inject/renderer-inject.js
  • npm run vite:build
  • cargo build --release --target aarch64-apple-darwin
  • Local validation against Codex 26.825.32147

Related historical context: #1755 and #1881.

@szguicheng szguicheng changed the title fix: adapt Dream Skin to modern Codex surfaces fix: update Codex compatibility and renderer performance Aug 29, 2026
@BigPizzaV3

Copy link
Copy Markdown
Owner

当前未看到 GitHub CI 结果(状态为 UNSTABLE)。该 PR 涉及 renderer/Dream Skin 的 14 个文件和约 973 行改动,请补跑并关联 CI,至少验证前端测试、核心 Rust 测试、Vite 构建和新版 Codex 实机兼容后再合并。

@szguicheng

Copy link
Copy Markdown
Author

按要求已在最新提交 2eec08a 上完成补跑与兼容性验证。

本地验证

  • npm test: 123 passed, 0 failed
  • npm run check: passed
  • npm run vite:build: passed
  • cargo test --workspace: 1120 passed, 0 failed, 2 ignored
  • cargo build --release --target aarch64-apple-darwin: passed
  • node --check assets/inject/renderer-inject.jsgit diff --check: passed

新版 Codex 实机验证

在 macOS 当前新版 Codex renderer(CDP,Codex 26.825.32147)中验证了右侧面板开关两种状态:

  • Dream Skin runtime revision: 28-codex-plus-side-panel-layout
  • 右侧面板关闭:thread viewport width 1662.5px,composer width 968px
  • 右侧面板打开:thread viewport width 818.6px,composer width 786.6px
  • 面板打开时 composer right 1060.1px,面板 left 1077.1px,无重叠
  • footer 始终挂在新版 thread viewport(data-app-shell-main-content-layout="thread-edge-scroll")内
  • 右侧面板主题背景计算为 rgba(252, 252, 252, 0.72),不再回退到默认白色

GitHub Actions

推送最新提交后,上游已生成新的 PR workflow run:

https://github.com/BigPizzaV3/CodexPlusPlus/actions/runs/33355484082

当前仍为 action_required,没有 job 结果。当前贡献者账号对上游仓库只有 read 权限,无法代替 Owner 批准 fork PR workflow;请点击 GitHub 的 “Approve and run workflows”,批准后该 run 才会执行并把 checks 结果关联到本 PR。

此前 workspace 测试暴露的 upstream_theme_assets hash 失败也已处理:四个 macOS Dream Skin vendor 资产是本 PR 有意修改的文件,已同步新的固定 hash;其余上游资产保护测试保持通过。

@BigPizzaV3

Copy link
Copy Markdown
Owner

请先在 GitHub Actions 中批准并运行当前 action_required 的 workflow。该 PR 涉及新版 renderer 和 Dream Skin 资产,待前端测试、Rust workspace、Vite 构建及 Windows/macOS 三平台 artifact checks 完成且全绿后再合并。

@BigPizzaV3 BigPizzaV3 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改动覆盖新版 Dream Skin 兼容和 renderer 性能,方向与 #2082/#2064 的皮肤问题相关。当前 PR 没有可见的本仓三平台 CI 结果;请基于最新 main 重跑 Windows、macOS arm64/x64 artifact CI,并补充“开启皮肤后首页输入框可见、可创建新会话”的回归验证,之后再决定合并。

@BigPizzaV3

Copy link
Copy Markdown
Owner

感谢 PR。此分支(基于较旧 base、无 CI)与 #1712 是同一主题的对立实现——两边都改了 renderer-inject.jsdream_skin_runtime.rsassets.rs 及对应测试,逐一合入会冲突(asset 字节基线 + runtime 逻辑重写)。\n\n#1712 保留是因为:base 更新、已 rebase(9/05)、含 Windows 适配且 fork 三平台 CI 通过,语义上就是主线在等的 Dream Skin→Codex 26.825 对齐。你的 #2050 里「renderer 性能优化」(合并 DOM 扫描/去抖、减少重复内联写、减负布局读取)是主线仍然想要的能力,但与 #2093 正在做的 renderer 性能工作目标重合。建议:拆出纯性能优化部分,基于合并了 #1712 的最新 main + 与 #2093 协调后重新提一个针对性的 PR;Dream Skin 本体对齐请走 #1712。\n\n本分支暂时关闭,可随时重开或参照上面方向另提新分支。

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