Repository navigation
feat(desktop): add configurable macOS HUD mode - #7336
Allen-ux-dev wants to merge 6 commits into
Conversation
Signed-off-by: Allen-ux-dev <13522567881@163.com>
Signed-off-by: Allen-ux-dev <13522567881@163.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[High impact] 此前的截图撤销问题已修复,本轮未发现阻止合并的新问题。
|
Signed-off-by: Allen-ux-dev <13522567881@163.com>
|
@greptileai Please re-review the latest commit, 87016b8. It addresses both findings from the initial review: cancelled HUD capture recovery after task creation and stale fullscreen restoration after a timeout. Please verify the fixes and check for regressions. |
Signed-off-by: Allen-ux-dev <13522567881@163.com>
|
@greptileai Please re-review the latest commit 1f5e8e6. This small follow-up allows explicitly selected HUD screenshots to be sent with empty message text, preserves the existing consent/cancellation checks, and prevents suggested text from being implicitly included. Related regression tests (176), desktop typecheck and 18 UI scenarios passed; validation details and limitations are in the PR description. |
|
本 PR 命中维护者确认门(product:feat + 生产 UI 路径;security:apps/desktop/src/main/hud/ipc.ts:421 navigation-escape 危险写法 1 处;rules:改到 docs/design-rules/design-inventory.md;arch:核心路径 1526 行 + 全量 4920 行大 diff),需要维护者确认后才能进入代码审查与合并。 确认方式:请维护者直接在本 PR 上 Approve;需要作者修改则 Request Changes 并写明要求,作者改完后维护者再 Approve。普通留言不构成放行。 讨论 issue 见本评论关联的链接。 另如实记录本轮其他前置状态(不在本门处置范围):2 条 review conversation 均已 Resolve(greptile 撤销截图重试 P1、全屏恢复标记 P2);2 个 workflow(pr-design-basis / client-ci)待批准后才能跑 CI。 讨论 issue:#7360 |
Signed-off-by: Allen-ux-dev <13522567881@163.com>
|
@greptileai Please re-review the current head 7b7807d after syncing upstream/main (0694ed7). Conflict resolution preserves upstream device labels and collapsed-sidebar behavior and adapts the HUD bar to the extracted ContextCapacityRing without removing the normal ring's new controls. Local validation: 548 targeted tests, desktop typecheck, and 16 light/dark UI scenarios passed; details and limitations are in the PR description. Please check the integration for regressions. |
|
@codex review Please review the latest head 7b7807d. The initial review did not complete; the branch now includes upstream/main and the HUD integration fixes. Validation evidence is recorded in the PR description. The maintainer confirmation gate and approval of the pending GitHub Actions workflows remain separate requirements. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: Allen-ux-dev <13522567881@163.com>
|
@greptileai Please re-review the latest head 6ce27f6, addressing the P1 in #7336 (comment). HUD capture consent is now frozen at the original send action, before reference hydration, folder transfers, or voice refinement; it is revalidated before native capture. Uncheck/recheck cannot revive the old send. The existing rejection path preserves the original draft and any newer text typed during remote hydration. The new production-entry regression matrix reproduced five unwanted capture calls on the previous implementation and passes with this fix, with unchanged-consent controls still sending normally. Validation: 264 targeted tests, desktop typecheck, test-hygiene and DCO passed; the composer file was rerun after correcting a test-only readonly-array return type (43 passed). Full evidence, isolated test timings, and limitations are in the PR description. Please verify both the reported race and adjacent cancellation/acceptance paths. |
这次改了什么
摘要
为 macOS 增加可配置的 HUD 悬浮模式。在新建准备页或已有任务点击右上角 HUD 按钮,即可将当前输入框和消息放进小窗口,在操作其他软件时继续提问;无需创建另一条任务或切换聊天状态。
变更类型
feat新功能fix缺陷修复范围
7b7807d532合入upstream/main@0694ed7e001e027a031ffed21a088bd1975132de;首轮验证基线为82d44ec3ee。UI 变化
docs/design-rules/DESIGN.md§2 Color Palette & Roles、§4 Buttons / Desktop settings rows、§5 Layout Principles、§10 Light / Dark Dual-Mode Delivery Gate、§14.2 Focus Management、§14.3 Keyboard & IME。沿用官方 titlebar hover token、28px 图标按钮/6px 圆角、设置行与快捷键录制组件;保留原输入焦点和 IME 行为。功能性透明度过渡采用用户指定的线性变化。b3aad8513c的合成组件截图,无真实聊天、个人路径或账户信息。截图记录的66aff08d96d7加未提交改动,已完整纳入首轮提交b3aad8513c。这些截图不证明系统透明合成或完整发送流程。查看五种语言、深浅主题和两种尺寸的界面验证截图
pnpm ui:check --page hud --case all --theme all --locale all --viewport 420x900,685x1100,macOS · Electron 42.11.12(Chromium 148.0.7778.280,与 Cindy 同一渲染内核);真实组件与主题,场景数据,不是登录账号下的完整 Cindy66aff08d96d7(含未提交改动)hud:light / dark · zh-CN / zh-TW / en / ja / ko · 420×900 / 685×1100default:HUD settingsentry:Normal titlebar HUD entry and hoversettings:HUD settingschrome:Localized screen controls, settings overlay and custom shortcutchrome-no-quota:Localized unavailable weekly quota beside screen control and truncated pathnested-panes:Retain docked pane DOM while giving all space to chat怎么验证的
自动验证
首轮提交
b3aad8513c的工作树运行以下检查;后续审查修复的验证记录见下节:pnpm --filter desktop typecheck:通过。pnpm ui:check --page hud --case all --theme all --locale all --viewport 420x900,685x1100:120/120 场景通过,75.9 秒。检查入口 hover、五语设置、长自定义快捷键、元信息行基线/不重叠和嵌套面板呈现。node --test scripts/__tests__/glossary-rules.test.mjs scripts/__tests__/design-inventory.test.mjs:123 项通过,99.94 秒。pnpm check:test-hygiene、pnpm check:i18n、pnpm check:i18n-glossary、pnpm check:design-inventory:通过;国际化保留仓库已有非阻断提示。pnpm check:design-colors --worktree --base-ref 82d44ec3ee:通过,unexpected=0;几何值提示仍列在报告中。git diff --check与pnpm check:dco --base 82d44ec3ee:通过,两条代码提交均带匹配作者的 DCO 签名。可复现的定向测试命令
pnpm --filter desktop exec vitest run \ src/main/hud/__tests__ \ src/shared/__tests__/hud.test.ts \ src/main/app-shortcuts/__tests__/AppShortcutStore.test.ts \ src/renderer/features/hud/__tests__ \ src/renderer/components/settings/__tests__/HudShortcutSync.test.tsx \ src/renderer/components/settings/__tests__/settingsSearchCatalog.test.ts \ src/renderer/components/settings/__tests__/KeyboardShortcutsSection.accessories.test.tsx \ src/renderer/components/settings/__tests__/KeyboardShortcutsSection.mutationRace.test.tsx \ src/renderer/components/status/__tests__/TodaySpendChip.popover.test.tsx \ src/renderer/layout/__tests__/LayoutRoot.test.tsx \ src/renderer/components/new-chat/__tests__/chatInputAnnotationAbort.test.tsx \ src/renderer/__tests__/chatInputSessionFocus.test.ts \ src/renderer/__tests__/newMakerLocalFirstMessageSend.test.ts \ src/renderer/__tests__/newMakerRemoteFirstMessageSend.test.ts \ src/renderer/__tests__/newMakerOrcaCreateOrder.test.ts \ src/renderer/__tests__/reviewCommandDispatch.test.ts \ src/renderer/__tests__/issueCommandAttachments.test.ts \ src/renderer/features/cc-agent/__tests__/newMakerDraftSubmission.test.ts \ src/renderer/features/right-sidebar/lib/__tests__/openSideChatTab.test.ts \ --maxWorkers=2测试价值及逐文件耗时(engineering-conventions.md §3.2)
下列路径均相对
apps/desktop/src。tier 为 unit;每个文件另以pnpm --filter desktop exec vitest run <文件> --maxWorkers=1单独运行,耗时为本机墙钟。原生 API 使用 Electron fake;UI 使用 jsdom。原生新增取消用例在修复前 3 项失败,修复后通过。main/app-shortcuts/__tests__/AppShortcutStore.test.tsmain/hud/__tests__/controller.test.tsmain/hud/__tests__/ipc.test.tsrenderer/__tests__/newMakerLocalFirstMessageSend.test.tsrenderer/components/new-chat/__tests__/chatInputAnnotationAbort.test.tsxrenderer/components/settings/__tests__/HudShortcutSync.test.tsxrenderer/components/settings/__tests__/settingsSearchCatalog.test.tsrenderer/components/status/__tests__/TodaySpendChip.popover.test.tsxrenderer/features/cc-agent/__tests__/newMakerDraftSubmission.test.tsrenderer/features/hud/__tests__/HudPathChip.test.tsxrenderer/features/hud/__tests__/pointerRouting.test.tsrenderer/features/hud/__tests__/screenAttachment.test.tsxrenderer/features/right-sidebar/lib/__tests__/openSideChatTab.test.tsrenderer/layout/__tests__/LayoutRoot.test.tsxshared/__tests__/hud.test.ts审查反馈修复(
87016b8a6b)pnpm --filter desktop typecheck、4 个修改文件的 ESLint、pnpm check:test-hygiene、git diff --check均通过。DCO 检查通过,3 条代码提交均已签名。纯截图发送补充(
1f5e8e680e)view未使用错误仍保留,已与父提交核对。pnpm ui:check --changed=87016b8a6b --theme all等效检查 18/18 场景通过(29.9 秒),查看了全部 3 张 overview。保留 4 条 companion composer 文字裁切警告,未将警告写为零。87016b8a6b加本次未提交改动时生成,源码已完整纳入1f5e8e680e;不含个人桌面或真实聊天。截图覆盖深浅主题与组件回归,纯截图的派发语义由上述交互单测验证。本次深浅主题回归截图
同步官方 main(
7b7807d532)upstream/main@0694ed7e001e027a031ffed21a088bd1975132de,保留原提交历史。解决设备名称 import、侧栏折叠与 HUD 布局参数、上下文控件抽取及生成清单冲突。ContextCapacityRing,将 HUD 长条变体迁入该组件,保留普通模式新加入的上下文详情与档位设置;HUD 继续显示长条及悬停提示。保留模型切换时的 provider、只读状态及官方侧栏折叠逻辑。upstream/main同文件执行相同检查确认。本次无新增 lint 错误;i18n 保留现有 1387 条非阻断警告。1f5e8e680eaf加正在合入的官方代码与适配改动,内容已完整纳入7b7807d532。本轮未重新启动完整应用或发送真实截图,未运行整仓测试;远端 CI 仍以 GitHub 结果为准。同步后的上下文圆环与 HUD 长条验证截图
pnpm ui:check --page context-capacity --case all --theme all,macOS · Electron 42.11.12(Chromium 148.0.7778.280,与 Cindy 同一渲染内核);真实组件与主题,场景数据,不是登录账号下的完整 Cindy1f5e8e680eaf(含未提交改动)context-capacity:light / dark · zh-CN · 560×650 / 320×650hud:HUD compactable context barhud-codex:HUD read-only native context bardefault:One ring opens usage, manual compaction and window choiceshigh:Context nearly fullcodex:Native Codex details above window choicesnarrow:Read-only task at 320pxnarrow-editable:Window controls and model settings at 320pxunknown:Missing route data keeps the ring and usage detailssrc/renderer/lib/modelDefinitions手工验证
macOS 隔离开发配置
cindy-dev。开发过程中验证准备页和已有任务进入/退出 HUD、未发送草稿与模型选择保留、最大化恢复、上下输入位置、路径复制。使用者确认真实桌面背景可透出、AI 回复区域可穿透、切换至其他软件后默认快捷键能恢复点击、Esc 能退出 HUD,并实际发送过“查看屏幕测试”获得截图内容解释。最终元信息栏的左右留白由使用者目检确认。未执行的验证
风险
风险分类
影响与回滚
提交前检查
撤销截图授权时序修复(
6ce27f66c9)