Skip to content

fix(desktop): keep plan revision editor visible - #5537

Merged
liruifengv merged 3 commits into
mainfrom
fix/plan-revision-editor-collapse
Nov 26, 2026
Merged

liruifengv merged 3 commits into
mainfrom
fix/plan-revision-editor-collapse

Conversation

@liruifengv

@liruifengv liruifengv commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

Desktop 与 Web 用户在审批较长 plan 时,点击“修改”后,反馈编辑框可能被压缩到只剩约一行高度,输入内容仍然成功,但编辑区域难以查看和操作。本 PR 让反馈编辑区始终保持完整的三行初始高度,空间不足时由上方 plan 区域滚动让位。

此改动来自内部缺陷报告,没有关联的外部 issue。原始录屏包含真实会话内容,因此未作为公开 PR 素材上传。

Bug Reproduction Steps

  1. 在 Desktop 或 Web 中进入 plan 模式,让模型提交一份足以填满审批卡高度上限的长 plan。
  2. 将窗口高度缩小到接近 350px,点击 Revise。
  3. 修复前,textarea 自身仍有约 84px 高度,但可见区域被祖先容器裁到约一行;输入和提交仍然可用。
  4. 修复后,反馈编辑区完整显示,plan 区域缩小并滚动;空间进一步不足时,编辑态正文区域提供滚动兜底。

Root Cause

审批卡使用受限高度的纵向 flex 布局。正文的所有直接子项都设置为 flex: 0 1 auto; min-height: 0,plan 区域再使用 flex: 1 填充空间,反馈区因此也会在卡片达到高度上限后参与收缩。

textarea 的 min-height 无法阻止祖先 flex item 变小;反馈区内层又使用 overflow: hidden,所以 textarea 并未真正变小,而是被祖先裁掉。这是布局分配错误,不是自动增高逻辑或动画时序问题。

本 PR 直接修正 flex 与滚动职责,是根本修复,不通过延迟、重试或隐藏 plan 来绕过问题。

Code Changes

 <ApprovalCard body>
   plan region
-  feedback editor: shrinkable and clipped by its ancestor
+  feedback editor: keeps its natural height
+  edit-state body: scrolls only if fixed content still exceeds the budget
  • 编辑态给审批正文增加 has-feedback 状态,只在此期间启用正文滚动兜底。
  • 将反馈区与单行 plan 路径一样设为 flex: none,使长 plan 优先让出空间并内部滚动。
  • 保持非编辑态审批卡的现有布局和滚动行为不变。
  • 添加 kimi-code-app patch changeset。

根据 PR 讨论,本 PR 不保留只能检查 CSS 文本的 jsdom 布局断言,也不新增 UI E2E。现有 Desktop plan 审批旅程继续验证完整交互流程,但不把它表述为真实可见高度的布局回归测试。

Behavior Changes and Affected Users

行为 修改前 修改后 受影响人群 逃生口
长 plan 的修改反馈 卡片达到高度上限后,反馈区可能被祖先裁到约一行 反馈区保留完整高度,plan 区域滚动让位 Desktop 与 Web 中修改长 plan 的用户 N/A;不保留裁切行为
其他审批类型的反馈输入 在极端高度预算下也可能参与正文 flex 收缩 同样保留反馈区高度,正文提供滚动兜底 Desktop 与 Web 中对命令、文件等审批填写反馈的用户 N/A;不保留裁切行为
未打开反馈区的审批卡 plan、选项、路径和按钮按现有布局展示 不变;新增状态仅在 feedbackOpen 时生效 所有 Desktop 与 Web 审批用户 不需要

受影响模块与覆盖:

  • ApprovalCard.vue:编辑态 class、flex 优先级和滚动兜底。
  • 现有 Desktop plan 审批旅程:覆盖进入 plan、修改并提交反馈、批准执行,以及再次拒绝退出;未新增或修改 E2E 文件。
  • 未修改协议、会话数据、配置、默认值、快捷键或提示词,因此旧客户端和既有会话不受影响。
验证记录
  • pnpm exec vitest run --reporter=agent apps/desktop/tests/renderer/chat-dock-approval.test.ts:保留的原有测试 1 passed。
  • pnpm --filter kimi-code-app run typecheck:renderer:通过。
  • pnpm lint:通过,0 warnings / 0 errors。
  • pnpm --filter kimi-code-app run e2e --project=approvals-state --no-deps approval-plan-review.spec.ts:构建通过,1 passed。
  • pnpm run check:duplication 0235ca0c06d0f80ea8324c3cb557c4fe99ce1403:通过,无新增重复。
  • 平台:以上检查均在 macOS 本机完成;Windows 未单独运行。

Checklist

  • I have read the CONTRIBUTING document.
  • Related issue: N/A(内部缺陷报告,无外部 issue)。
  • UI layout test intentionally omitted per PR discussion; no jsdom/CSS text assertion is retained.
  • The behavior-change table above is complete; no supported behavior, default, or compatibility path is removed.
  • Ran the gen-changesets workflow and added a Desktop patch changeset.
  • No documentation update is needed because this restores the intended approval-editor layout without changing usage or configuration.

@changeset-bot

changeset-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 61f4aa5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kimi-code-app Patch

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T12:29:16.819300Z 61f4aa5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@61f4aa5
npx https://pkg.pr.new/@moonshot-ai/kimi-code@61f4aa5

commit: 61f4aa5

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5aa10b3d97

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 61f4aa553f

ℹ️ 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".

@liruifengv
liruifengv merged commit 7e728f1 into main Nov 26, 2026
23 checks passed
@liruifengv
liruifengv deleted the fix/plan-revision-editor-collapse branch November 26, 2026 12:32
@7Sageer 7Sageer mentioned this pull request Nov 27, 2026
6 tasks done
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