Repository navigation
fix(desktop): align reply feedback buttons and add Help menu Feedback entry - #5391
Conversation
🦋 Changeset detectedLatest commit: 5d8c49c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd53db0830
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a7ff3f0e1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2a7ff3f to
5d8c49c
Compare
… entry (#5391) * fix(desktop): align reply feedback buttons and add Help menu Feedback entry * fix(desktop): add menu feedback source and queue Help menu feedback until initialized
… entry (#5391) * fix(desktop): align reply feedback buttons and add Help menu Feedback entry * fix(desktop): add menu feedback source and queue Help menu feedback until initialized
Screenshots / Recordings
观察消息底部的四个操作按钮(复制、分叉、点赞、点踩):悬停点赞按钮时,未悬停图标色、悬停图标色、背景色、圆角及无箭头 tooltip 已与左侧复制、分叉按钮一致。
Requirement or Bug
桌面端会话消息流中的点赞、点踩按钮在默认颜色、hover 态与 tooltip 样式上和左侧复制、分叉按钮不一致;同时,全局反馈入口此前只存在于左下角账户菜单。本次改动将消息流中的点赞、点踩按钮对齐复制、分叉按钮的样式和 tooltip,并在顶部 Help 菜单的
Documentation/使用文档下方新增Feedback/反馈菜单项,点击效果与账户菜单中的反馈一致,且保留menu来源归因并在渲染端尚未完成初始化时排队等待就绪后打开。Bug Reproduction Steps
Help/帮助菜单,查看菜单项中是否包含反馈入口。Root Cause
apps/desktop/src/renderer/components/feedback/TurnFeedbackActions.vue给<IconButton>传了size="sm"和tooltip-arrow,并用本地样式覆写了color: var(--color-send-bg)与border-radius: var(--radius-sm),未将 hover 图标色设为--color-accent,导致视觉与ChatPane.vue的.a-cpbtn偏离;同时已选中态在 hover 时被IconButton.vue的.ui-icon-button.is-pressed:hover:not(:disabled)覆盖为中性灰背景。apps/desktop/src/main/shell/menu.ts的helpMenu尚未包含反馈菜单项,apps/desktop/src/renderer/App.vue的onMenuAction也未处理对应菜单事件,且POST /api/v1/feedback的全局反馈source枚举此前只允许sidebar与command。Code Changes
改动落在回复反馈按钮组件、Electron 菜单到渲染端的派发链路,以及 KAP 反馈接口的
source枚举扩展三处。1. 回复反馈按钮对齐复制、分叉按钮
改为
size="xs"后,按钮直接复用IconButton的20px × 20px、--radius-xs与--color-text-muted默认值,本地样式只需去掉 hairline 边框并补齐 hover 与选中态 hover 规则;移除tooltip-arrow后,tooltip 走与.a-cpbtn相同的.ui-tip-surface标准气泡。2. Help 菜单新增 Feedback / 反馈入口与初始化排队
windowsMenuTemplate直接展开help.submenu,因此只需在helpMenu的help-docs之后插入open-feedback,macOS/Linux 原生菜单和 Windows/Linux 自定义标题栏菜单都会同步出现。渲染端复用openGlobalFeedback('menu')(未登录时弹出登录框、已登录时打开反馈弹窗并携带当前会话);当点击发生在应用刚启动或重载、initialized.value尚未为true时,通过runWhenInitialized延迟到初始化完成后再打开,同时对多次重复点击去重,并在组件卸载时停止监听。3. KAP
POST /api/v1/feedback契约扩展(packages/kap-server/schema/contract.txt)packages/kap-server/src/protocol/rest-feedback.ts、packages/app-core/src/api/types.ts和apps/desktop/src/renderer/composables/useDesktopFeedback.ts中将kind: "global"的source枚举扩展为"sidebar" | "command" | "menu",并同步刷新packages/kap-server/schema/openapi.json、packages/kap-server/schema/contract.txt与packages/kap-server/test/apiSurface.test.ts中的HOST_CONTRACT.digest。apps/desktop)、Web 端(通过@moonshot-ai/app-core调用)以及直接调用POST /api/v1/feedback的外部 KAP 客户端。"sidebar"或"command"的行为保持不变,服务端存储与既有数据不受影响。HOST_API_LEVEL保持为1:packages/app-core/src/api/hostRouting.ts中的route_createFeedback将kind: "global"固定路由到本地内嵌kap-server(this.local),不会把带source: "menu"的请求发往旧版本远程 SSH 宿主。Behavior Changes and Affected Users
--color-send-bg、圆角--radius-sm、hover 为--color-text,激活态 hover 会变成--color-selected-hover--color-text-muted、圆角--radius-xs、hover 为--color-accent+--color-hover,激活态 hover 保持--color-accent与 10% 主题色背景kimi web共用apps/desktop/src/renderer的用户.ui-tip__bubble--arrow气泡.ui-tip-surface气泡kimi web共用apps/desktop/src/renderer的用户Documentation后紧接ConsoleDocumentation/使用文档下方、Console/控制台上方新增Feedback/反馈,点击打开全局反馈弹窗(未登录先弹登录框);启动或重载未初始化完成时排队并在就绪后打开POST /api/v1/feedback全局反馈source"sidebar"、"command""sidebar"、"command"、"menu"apps/desktop(主进程菜单、共享 action-id 列表、渲染端App.vue、useDesktopFeedback.ts、useTrayAttention.ts与TurnFeedbackActions.vue)、packages/app-core(CreateFeedbackInput类型)、packages/kap-server(rest-feedback.ts与契约快照)。help-docs之后、help-console之前)、窗口唤起与 IPC 派发、不重复记主进程menu_action、自定义标题栏 Help 菜单覆盖:apps/desktop/tests/main/shell/menu.test.ts。xs尺寸与标准无箭头 tooltip 渲染:apps/desktop/tests/renderer/turnFeedbackPopover.test.ts。runWhenInitialized立即执行、延迟触发以及取消句柄停止回调:apps/desktop/tests/renderer/useTrayAttention.test.ts。POST /api/v1/feedback接受source: 'menu'与契约摘要:packages/kap-server/test/feedback.e2e.test.ts、packages/kap-server/test/apiSurface.test.ts。source: 'menu'全局反馈,以及深浅色主题下复制/分叉/点赞/点踩的 idle 颜色、圆角、hover 颜色/背景、tooltip 样式与激活态 hover:apps/desktop/e2e/desktop-feedback.spec.ts。windowsMenuTemplate单测覆盖。本地验证命令与结果
pnpm lint:通过(0 warnings, 0 errors)pnpm exec tsc -p packages/kap-server/tsconfig.json --noEmit:通过pnpm --filter kimi-code-app run typecheck:通过pnpm exec vitest run --reporter=agent packages/kap-server/test/apiSurface.test.ts packages/kap-server/test/feedback.e2e.test.ts apps/desktop/tests/main/shell/menu.test.ts apps/desktop/tests/renderer/turnFeedbackPopover.test.ts apps/desktop/tests/renderer/useDesktopFeedback.test.ts apps/desktop/tests/renderer/useTrayAttention.test.ts:6 files / 100 tests 通过pnpm exec vitest run --reporter=agent packages/app-core/test/daemon-client.test.ts:1 file / 96 tests 通过pnpm exec vitest run --reporter=agent packages/app-core/test/hostRouting.test.ts packages/kap-server/test/feedbackSessionArchive.test.ts:2 files / 38 tests 通过pnpm --filter kimi-code-app run e2e:headless desktop-feedback.spec.ts --retries=0 --grep "opens feedback from the Help menu":完整构建后 2 tests(含 smoke)通过pnpm run check:duplication $(git merge-base origin/release/2026-11-25 HEAD):通过(0 新增重复)Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.