Fix code block copy button positioning / 修复代码块复制按钮定位#5398
Merged
SivanCola merged 1 commit intoJun 26, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<pre>and keep it as a sibling inside.code-block__wrap.Fixes #5096.
Consolidation notes
Kept/adapted:
.code-block__wrapsibling approach for [Bug]: 代码块横向滚动时复制按钮会跟随内容移动 #5096. The unrelated [Feature]: 设置的弹窗建议加一个外边框或者阴影,区分与主窗口的边界 #5095 settings modal, Bug: 小窗口下界面元素错位 #5100 small-window layout, and bridge typing changes are intentionally left out of this narrow PR.Reviewed but not adopted:
overflow: hiddenfix because it does not update the stale descendant selector contract and can mask the DOM ownership problem.Repository Contributor Credits
Cache impact
Cache-impact: none — desktop frontend DOM/CSS/test changes only; no provider request, system prompt, tool schema, memory prefix, compaction, or reasoning upload behavior changes.
Cache-guard: N/A for cache; frontend regression and CSS checks cover this UI contract.
System-prompt-review: N/A.
Verification
pnpm --dir desktop/frontend exec tsx src/__tests__/code-block-copy-position.test.tsxpnpm --dir desktop/frontend check:csspnpm --dir desktop/frontend typecheckgit diff --check<pre>, the<pre>still scrolls, the creation-mode sibling selector matches, and the old descendant selector does not match.