fix(chat): improve agent code block contrast#277
Closed
musnows wants to merge 1 commit into
Closed
Conversation
This was referenced Jun 14, 2026
Collaborator
|
感谢提交此 PR! 该 PR 与 PR #279(文件树预览面板,+1422 行)存在 CSS 文件冲突,暂时无法直接合入: 冲突文件
本 PR 本身质量没有问题,属于 CSS 视觉优化 bugfix,建议: 方案 A(推荐):先合入本 PR
方案 B:等 PR #279 合入后 rebase
暂时关闭此 PR,如希望优先处理请告知,我们可以调整合入顺序。感谢你的贡献!🙏 |
Collaborator
|
关闭此 PR,待 rebase 解决冲突后欢迎重新提交。 |
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.
中文
改动
ds-plain-code-block样式类,避免目录树、纯文本片段看起来像普通正文。pre、高亮代码块和纯文本代码块统一增强背景、边框和内阴影。--ds-code-block-bg,让明暗主题和 ikun 主题下代码块都有明确底色。StreamdownCode单测断言,确保纯文本 fenced block 保留代码块视觉类。原因
Agent 输出无语言代码块或纯文本代码块时,之前会按普通文本块渲染,在深色聊天背景下缺少明确代码块边界。
验证
npm run test -- src/renderer/src/components/chat/StreamdownCode.test.tsnpm run typecheckgit diff --checknpm run dist:mac:arm64dist/Kun-0.1.0-mac-arm64.zip并从dist/Kun-0.1.0-mac-arm64-unzipped/Kun.app启动 packaged appcurl http://127.0.0.1:8899/health返回{"status":"ok","service":"kun","mode":"serve"}app.asar中确认包含ds-plain-code-block和--ds-code-block-bgEnglish
Changes
ds-plain-code-blockclass for plain-text fenced blocks rendered by Agent Markdown, so directory trees and plain text snippets no longer blend into prose.pre, highlighted code blocks, and plain-text code blocks.--ds-code-block-bgvalues so code blocks have a distinct surface across light, dark, and ikun themes.StreamdownCodetest coverage for plain-text fenced blocks.Why
Plain-text fenced blocks previously rendered like normal text, which made Agent code blocks hard to identify on dark chat backgrounds.
Validation
npm run test -- src/renderer/src/components/chat/StreamdownCode.test.tsnpm run typecheckgit diff --checknpm run dist:mac:arm64dist/Kun-0.1.0-mac-arm64.zipand launched packaged app fromdist/Kun-0.1.0-mac-arm64-unzipped/Kun.appcurl http://127.0.0.1:8899/healthreturned{"status":"ok","service":"kun","mode":"serve"}app.asarcontainsds-plain-code-blockand--ds-code-block-bg