Skip to content

fix(web): 任务详情面板头部——长标题防挤出 + 复制按钮合并为下拉菜单(源码同步构建) - #2966

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:fix/panel-header-title-overflow
Open

fix(web): 任务详情面板头部——长标题防挤出 + 复制按钮合并为下拉菜单(源码同步构建)#2966
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:fix/panel-header-title-overflow

Conversation

@bj456736

@bj456736 bj456736 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Related Issue

No linked issue — the problem is explained below(源自 Kimi Code 用户群反馈:后台 Bash 任务详情面板的关闭按钮消失)。

Problem

  1. 点开后台 Bash 任务的详情时,右侧详情侧边栏头部只剩「复制」,「关闭 X」消失,面板关不掉。根因:后台 Bash 无显式 description 时任务名自动生成为 Bash: ${command.slice(0,60)}…(约 67 字符 ≈500px),而 PanelHeader 标题样式是 flex: none——不收缩、无省略号;详情栏 .global-preview 默认宽 460px 且 overflow: hidden,长标题把排最后的 X 顶出可视区。
  2. 头部两个复制图标一模一样(复制命令 / 复制输出),只能靠悬停 tooltip 区分,还多吃一份头部空间。

What changed

源码改动在 MoonshotAI/kimi-code-app#243;本 PR 是通过 pnpm sync:web 从该改动重新构建并同步的 dist-web 产物(所有内容 hash 已刷新,老客户端的 immutable 缓存不会挡住修复;asset 总数不变 531,77 个文件仅因引用关系刷新 hash)。构建基于 code-app af7ed8fa(本仓当前 dist-web 的 sync 来源,见 #2922)。

  • PanelHeaderpackages/app-ui/.../PanelHeader.vue):title 改为与 __sub 一致的 flex: 0 1 auto + min-width: 0 + overflow: hidden + text-overflow: ellipsis + white-space: nowrap。短标题行为不变;长标题省略号截断,尾部按钮永远可见。
  • AgentDetailPanelapps/web/.../AgentDetailPanel.vue):两个复制 IconButton 合并为单个 IconButton + Menu 下拉(复制命令 / 复制输出 / 复制全部);菜单 teleport 到 body、按 trigger 定位(与 dock/FilterControl 同一套做法);复制输出在无输出时置灰;复制全部 = 命令 + 输出;完整键盘可达(打开聚焦首个可用项、↑/↓ 循环、Escape/选中还焦、Tab 移走关闭);i18n 新增 tasks.copyAll(中/英)。
  • .changeset/:按 gen-changesets 规则补两条 patch 记录(一个逻辑变更一条)。

选择该方案的理由:dist-web 是本仓提交的构建产物,按 AGENTS.md 的约定「web UI 要变就 sync 并同提交 commit 产物」——因此源码侧修复 + 重新 sync,而不是手改产物(手改还会让 immutable 缓存的老客户端拿不到修复)。

验证

  • code-app 侧 vue-tsc --noEmit ✅、oxlint --type-aware 0 errors ✅;产物已核实包含新样式与菜单代码;
  • 建议人工冒烟:460px 侧栏打开长标题后台 Bash 任务详情 → 标题省略、状态/复制/X 全部可见;点复制按钮 → 「复制命令 / 复制输出 / 复制全部」菜单,运行中无输出时「复制输出」置灰;键盘 Tab 到复制按钮 → Enter 开菜单 → ↑/↓ 选择 → Enter 复制。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.(dist-web 为预构建产物,本仓无对应测试设施;验证方式见上)
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.(无用户可配置的文档面变更)

@changeset-bot

changeset-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ca8620b

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

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code 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

@pkg-pr-new

pkg-pr-new Bot commented Aug 16, 2026

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

commit: ca8620b

@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: af3647af3c

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

Comment thread apps/kimi-code/dist-web/assets/index-BkulrdXm.css Outdated
@bj456736 bj456736 changed the title fix(web): keep panel header actions visible with long task titles fix(web): 任务详情面板头部——长标题防挤出 + 两个复制按钮合并为下拉菜单 Aug 16, 2026
@bj456736
bj456736 force-pushed the fix/panel-header-title-overflow branch from d9be92c to 3183cb0 Compare August 16, 2026 06:34
@bj456736 bj456736 changed the title fix(web): 任务详情面板头部——长标题防挤出 + 两个复制按钮合并为下拉菜单 fix(web): 任务详情面板头部——长标题防挤出 + 复制按钮合并为下拉菜单(源码同步构建) Aug 16, 2026
@bj456736

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

https://github.com/MoonshotAI/kimi-code/blob/3183cb048a5f4b00c0a7787ca526b64ab7d07340/apps/kimi-code/dist-web/assets/index-CP0gj1ku.js#L651
P2 Badge Keep copy-menu options keyboard reachable

When a keyboard-only user activates the new copy trigger, this handler opens and positions the teleported menu but never transfers focus to a menu item or handles arrow-key navigation; focus remains on the trigger, and pressing Tab proceeds through the remaining controls inside #app before reaching the menu appended under body. The previous copy buttons were directly focusable, so consolidating them this way makes Copy command/output effectively unavailable from the keyboard; focus the first enabled item on open and support normal menu keyboard navigation/focus dismissal.

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

@bj456736
bj456736 force-pushed the fix/panel-header-title-overflow branch from 3183cb0 to 99f6e3d Compare August 16, 2026 06:49
@bj456736

Copy link
Copy Markdown
Contributor Author

Fixed in the rebuilt bundle (99f6e3d): the copy menu now follows the repo's existing dropdown keyboard pattern (dock/FilterControl) — on open it focuses the first ENABLED item (the output item stays disabled until output exists), ArrowUp/ArrowDown cycle through enabled items, Escape and item selection close the menu and return focus to the trigger, and tabbing away dismisses it. Source: MoonshotAI/kimi-code-app#243 (amended).

@bj456736

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 99f6e3d0dd

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

Comment thread apps/kimi-code/dist-web/index.html
…into a dropdown

Synced bundle regenerated from code-app via pnpm sync:web (hashes refreshed,
so immutable-cached clients pick the fix up).

- PanelHeader title now shrinks + ellipsizes: a long auto-generated Bash
  task title (Bash: <command...>) no longer pushes the status badge, copy
  control and close button out of the 460px preview column.
- AgentDetailPanel header's two identical copy icons merge into one button
  opening a labelled menu (copy command / copy output / copy all). The menu
  is keyboard reachable: it focuses the first enabled item on open, supports
  ArrowUp/ArrowDown navigation, Escape / selection restores trigger focus,
  and tabbing away dismisses it.

code-app: 8356c3f0a73aac259a048c75c8dd078229c7ee2b
@bj456736
bj456736 force-pushed the fix/panel-header-title-overflow branch from 99f6e3d to ca8620b Compare August 16, 2026 06:57
@bj456736

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ca8620bcc4

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

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.

1 participant