Conversation
- 适配新版将额度耗尽提示移至 [data-codex-composer-root] aside 的 DOM 结构 - 增加 composerUsageAlertBanners,支持常见中英、繁体额度文案精准匹配 - 优化 officialUsageAlertContainer 提取单一子元素父容器,避免留白 - 在 installStyle 中增加局部 :has 预隐藏规则,解决切换会话瞬间闪烁 - 更新与补充 renderer-inject.test.ts 单元测试,确保回归测试通过
- 精确限制 CSS 防闪烁选择器至 billing/upgrade 特征,避免误伤 composer 其他普通通知 - 增强正则对多行排版、空白符规范化与常见限额提示的覆盖能力,并补充升级操作兜底 - 加固 officialUsageAlertContainer 容器判定,防止意外隐藏根级或表单容器 - 将 refreshOfficialUsageAlertVisibility 改为增量更新,减少高频 scan 下的 DOM 扰动 - 扩展 renderer-inject.test.ts,增加防误伤负向断言与多语言用例
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.
变更背景
最新版 OpenAI Codex 桌面应用将额度耗尽提示卡片从侧边栏迁移到了输入框上方(
[data-codex-composer-root] aside)。原有的
officialUsageAlertCards()仅定位侧边栏元素,导致“关闭官方低额度提示”在新版中失效。同时,在切换会话时,由于组件挂载与 DOM 扫描的时序差,容易出现横幅瞬时闪烁。修复内容
renderer-inject.js):composerUsageAlertBanners(),定位[data-codex-composer-root] aside;officialUsageAlertContainer(),严格限定父容器提取条件(排除 composer 根容器与核心表单结构),消除隐藏后的外层内边距留白。renderer-inject.js):body.codex-plus-hide-usage-alert [data-codex-composer-root] aside:has(a[href*="billing" i], a[href*="upgrade" i], [data-testid*="upgrade" i], [data-testid*="billing" i]) { display: none !important; }确保网络错误、文件上传报错等普通 composer 通知绝不会被误伤;
refreshOfficialUsageAlertVisibility()重构为增量更新模式,避免每轮高频扫描重复增删 dataset 导致的无谓 DOM 属性扰动。renderer-inject.test.ts):测试验证
apps/codex-plus-manager:npm test通过(235 passed, 0 failed);crates/codex-plus-core:cargo test --test cdp_bridge通过(159 passed, 0 failed)。