Skip to content

fix(markdown): keep table actions inside clipped containers - #5098

Merged
wbxl2000 merged 2 commits into
MoonshotAI:release/2026-11-19from
kimi-agent-bot:fix/table-actions-sidechat-clipping
Nov 19, 2026
Merged

wbxl2000 merged 2 commits into
MoonshotAI:release/2026-11-19from
kimi-agent-bot:fix/table-actions-sidechat-clipping

Conversation

@kimi-agent-bot

@kimi-agent-bot kimi-agent-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

Desktop 开启侧边聊天后,主会话可用宽度变窄。表格的「复制表格」和「加宽表格」按钮可能被右侧面板边界裁切,导致难以点击。

反馈ID:56d3a175-ab4c-4007-a4d0-71cbc82fa318。

本 PR 让按钮在窄容器中完整可见且可点击,同时保持正常宽度下的既有位置。

Bug Reproduction Steps

  1. 在 Desktop 主会话中渲染一个 Markdown 表格。
  2. 开启侧边聊天,使主会话变窄。
  3. 悬停表格,观察右侧的「复制表格」和「加宽表格」按钮。
  4. 在全宽消息的 760px 容器中,按钮右半部会被滚动容器裁切。

Root Cause

positionTableActions() 始终把操作层放在表格右缘外侧。会话滚动容器的 overflow-y: auto 会让横向计算值也成为 auto,因此超出可见右缘的按钮会被裁剪。仅提高 z-index 无法越过这个裁剪边界。

本次从定位逻辑解决:先计算实际裁剪祖先的可见右缘;只有外侧位置会越界时,才把操作层收进表格内的上层浮层。正常宽度下仍使用原来的外侧位置。

Code Changes

 positionTableActions(wrapper)
   outsideLeft = wrapper.right + gap
+  clipRight = nearest visible right edge of clipping ancestors
+  if outsideLeft + actionsWidth + gap > clipRight
+    place actions inside the table / visible right edge
   otherwise
     keep outsideLeft
  • packages/app-markdown/src/lib/tableWide.ts:增加裁剪边界检测、越界回退定位和裁剪祖先 resize 监听。
  • packages/app-markdown/src/lib/tableWide.test.ts:覆盖窄容器裁切、继续加宽、恢复外侧位置,以及祖先变窄/变宽时重新定位。
  • .changeset/fix-sidechat-table-actions.md:记录 Desktop 用户可见的修复。

Screenshots / Recordings

同一真实 Markdown 组件、760px 全宽消息容器中,修复前按钮右半部被裁切;修复后两个按钮完整显示在表格内的上层浮层。

修复前后对比

加宽表格的修复后布局:

加宽表格修复后

表格横向滚动 80px 后,按钮仍停留在可见右缘,裁切为 0。

横向滚动后的按钮位置

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
窄容器中会越界的表格操作按钮 始终放在表格右缘外侧,可能被裁剪 仅在会越界时收进表格内的上层浮层 开启侧边聊天或使用窄窗口的 Desktop / Web 用户 无
不会越界的普通、加宽及横向滚动表格 按钮放在表格右缘外侧 保持原位置 使用常规宽度的 Desktop / Web 用户 无

仅影响 app-markdown 表格操作层的横向定位,不改复制、加宽逻辑或全局层级。

验证结果:

  • 760px 全宽消息场景:修复前裁切 18px,修复后裁切 0。
  • 普通和加宽表格在 760 / 800 / 900 / 1000 / 1200px 下,按钮位置前后差值均为 0。
  • 普通和加宽表格横向滚动 80px 后,按钮位置不变,裁切为 0。
  • 裁剪祖先变窄时按钮内收,变宽后恢复外侧位置。
  • app-markdown 28 个测试文件、490 个测试通过。
  • 全仓 pnpm lint 通过。
  • pnpm --filter kimi-code-app run typecheck 通过。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • 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 Nov 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4cb7a38

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 19, 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-19T10:19:45.560086Z 4cb7a38 New commits
ℹ️ 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 19, 2026 •

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

commit: 4cb7a38

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

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

@kimi-agent-bot
kimi-agent-bot changed the base branch from main to release/2026-11-19 November 19, 2026 10:14
@kimi-agent-bot
kimi-agent-bot force-pushed the fix/table-actions-sidechat-clipping branch from 475829f to 4cb7a38 Compare November 19, 2026 10:15
@wbxl2000
wbxl2000 merged commit 63b94bc into MoonshotAI:release/2026-11-19 Nov 19, 2026
17 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026
Grapedge added a commit that referenced this pull request Nov 23, 2026
* fix(core): add Claude 5 output token ceilings (#5096)

* fix(core): add Claude 5 output token ceilings

* chore: add Claude 5 output ceiling changeset

* fix(markdown): keep table actions inside clipped containers (#5098)

* fix(markdown): keep table actions inside clipped containers

* fix(markdown): observe table action clipping ancestors

---------

Co-authored-by: kimi-agent-bot <[email protected]>

* fix(hosts): keep project lists usable with SSH hosts (#5102)

* ci: release packages (#5094)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: preserve first prompt through project creation (#5161)

Co-authored-by: kimi-agent-bot <[email protected]>

* fix(agent-core-v2): align fork slicing with restored turn ids (#5165)

* fix(agent-core-v2): align fork slicing with restored turn ids

* chore: add restored fork fix changeset

* fix(core): prevent AJV diagnostics from polluting TUI input (#5168)

* refactor(core): route AJV logs through utils logger

* chore(core): add AJV logger changeset

* chore(core): clarify AJV logger changeset

* fix: support UUID generation in insecure browser contexts (#5173)

* fix: support UUID generation in insecure browser contexts

* chore: update pnpm deps hash

* fix: resolve crypto bindings in UUID lint rule

---------

Co-authored-by: kimi-agent-bot <[email protected]>

* fix(client): keep draft thinking effort after sending (#5170)

* fix(client): keep draft thinking effort after sending

* chore: add cli changeset for draft thinking fix

* test(client): use function stub for websocket in thinking test

* fix(client): preserve thinking effort during model normalization

* fix(client): reconcile profile updates and model fallbacks

* fix(client): scope draft thinking preservation

* fix(tui): defer queued prompts until the loop drains (#5166)

* fix(tui): defer queued prompts until the loop drains

- add core and v2 drained/idle lifecycle events
- consume reminder-only queues without starting a model turn
- gate TUI queue dispatch and completion notifications on lifecycle state
- document notification-handoff queue behavior and add a CLI patch changeset

* fix(tui): close loop lifecycle races

- emit idle only after the current macro is revalidated
- keep queued input pending through compaction and delayed dispatch
- reject stale idle after new work starts

* fix(loop): correlate lifecycle events by generation

- track macro generations in the core and v2 loop state
- replace TUI macro inference with event-generation correlation
- preserve compaction guards for queued dispatch

* fix(desktop): simplify multi-select folder picker actions (#5174)

* fix(kap-server): report :wait settled only after the session is on disk (#5176)

:wait settled as soon as the turn left the in-memory activity view, but
the engine writes wire records through a batched log that flushes in a
later task. A server killed right after :wait reported idle could lose
the end of the finished turn.

Before it replies with a settled session, :wait now flushes the wire of
every agent in the session and drains pending metadata writes. A failed
write surfaces as an error instead of a settled reply. The KAP guide
states the guarantee. A new test in sessions.test.ts slows down the disk
write of the turn end and checks that the record is on disk when :wait
returns.

(cherry picked from commit fc33c6d)

Co-authored-by: kai <[email protected]>

* ci: release packages (#5163)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(client): keep config-derived draft thinking effort after sending (#5191)

Co-authored-by: liruifengv <[email protected]>

* ci: release packages (#5192)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(kap-server): resume sessions with unavailable models (#5212)

* fix(kap-server): resume sessions with unavailable models

* fix: let users replace unavailable session models

* fix: scope unavailable model recovery state

---------

Co-authored-by: kimi-agent-bot <[email protected]>

* fix(plugins): detect MCP OAuth with targeted probes (#5197)

* fix(plugins): detect MCP OAuth with targeted probes

* fix(plugins): use the MCP inspect route

* fix(plugins): preserve OAuth requirements across inspection and disconnect

* fix(chat): show pending MCP browser authorization (#5246)

* fix(chat): show pending MCP browser authorization

* fix(chat): resolve MCP authorization lint findings

* fix(chat): preserve MCP authorization failure details

* fix(mcp): preserve cancellation during OAuth reconnect

* fix(desktop): cache feedback form per host and let reply reasons wrap (#5303)

* ci: release packages (#5232)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* test: port removed-model recovery coverage to testkit

* test: dedupe anthropic output ceiling cases

---------

Co-authored-by: Haozhe <[email protected]>
Co-authored-by: kimi-agent-bot <[email protected]>
Co-authored-by: 7Sageer <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: kimi-agent-bot <[email protected]>
Co-authored-by: liruifengv <[email protected]>
Co-authored-by: qer <[email protected]>
Co-authored-by: kai <[email protected]>
Co-authored-by: Luyu Cheng <[email protected]>
Co-authored-by: grapedge <[email protected]>
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