fix(desktop): restore complete account quota display - #3318
Open
fico-hub wants to merge 1 commit into
Open
Conversation
Signed-off-by: fico-hub <fico@xd.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/usageBroadcaster.ts | 将快照 owner 切换到当前 DbClient,并在同一 Codex app-server bucket 内逐字段保留稀疏更新未携带的额度窗口;未发现本次改动引入的可发布缺陷。 |
| apps/desktop/src/main/usage/codexWebUsage.ts | 默认网络实现由 Node fetch 改为 Electron net.fetch,当前调用路径和 Electron 版本与该 API 契约一致。 |
| apps/desktop/src/renderer/hooks/useAccountUsage.ts | Renderer 采用与主进程一致的 Codex 稀疏窗口合并语义,并保留 WHAM 完整快照及 reached marker 的清窗行为。 |
| apps/desktop/src/main/tests/usageBroadcasterCodexAccount.test.ts | 新增 DbClient owner 恢复及单窗口稀疏更新保留 sibling 窗口的回归覆盖。 |
| apps/desktop/src/renderer/components/status/tests/TodaySpendChip.popover.test.tsx | 新增 Claude 与 Codex 多窗口额度完整渲染的组件级回归覆盖。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Codex app-server 稀疏事件] --> B[主进程按 bucket 合并窗口]
C[Codex Web 用量请求] -->|Electron net.fetch| D[WHAM 完整快照]
B --> E[持久化到当前 DbClient owner]
D --> E
E --> F[广播账户额度快照]
F --> G[Renderer 合并与选择额度桶]
G --> H[TodaySpendChip 完整展示]
Reviews (1): Last reviewed commit: "fix(desktop): restore complete account q..." | Re-trigger Greptile
Contributor
|
命中 UI 路径(apps/desktop/src/renderer/hooks/useAccountUsage.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。本条不阻断合并。 |
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.
这次改了什么
摘要
修复桌面端 Claude、Codex 等订阅额度在冷启动或稀疏更新后显示不完整的问题。
net.fetch,遵循系统代理和 PAC 配置。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
不涉及:本 PR 只修复额度数据的恢复、合并和请求链路,不改现有 TodaySpendChip 的样式、交互或文案;UI 仍使用原有结构与设计 token。
怎么验证的
自动验证
手工验证
未执行的验证
pnpm test:unit;仓库要求的相关测试门禁已通过,完整矩阵交由 CI。风险
风险分类
影响与回滚
account_usage_snapshots行,不改变 schema;DbClient owner 继续沿用当前已验证账号边界,不会回退到已关闭的 legacy owner。net.fetch使用 Electron/Chromium 网络栈,在 macOS、Windows 和 Linux 上统一遵循 Electron 代理配置;自定义fetchFn注入行为不变。提交前检查
git commit -s,见 DCO)