fix(chat): improve agent code block contrast - #307
Merged
XingYu-Zhong merged 1 commit intoJun 15, 2026
Merged
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.
中文
重提关闭的 PR #277。#277 的 maintainer 评论说明代码本身没有质量问题,关闭原因是当时与 #279 的 CSS 文件改动冲突。此分支已基于最新
upstream/develop重新 cherry-pick,当前只包含同一个代码块视觉修复提交。改动
ds-plain-code-block样式类,避免目录树、纯文本片段看起来像普通正文。pre、高亮代码块和纯文本代码块统一增强背景、边框和内阴影。--ds-code-block-bg,让明暗主题和 ikun 主题下代码块都有明确底色。StreamdownCode单测断言,确保纯文本 fenced block 保留代码块视觉类。处理 PR #277 评论
base-shell.css/markdown-code.css改动存在冲突。upstream/develop到a393b2d,并在新分支codex/fix-agent-code-block-contrast-rebased上重新应用修复。验证
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
Re-submission of closed PR #277. The maintainer comment on #277 stated that the change itself was fine, and the PR was closed because it conflicted with CSS changes from #279 at that time. This branch cherry-picks the same visual fix on top of the latest
upstream/develop.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.Addressing PR #277 feedback
base-shell.cssandmarkdown-code.cssconflicted with feat(workspace): add file tree preview panel #279.upstream/developata393b2dand reapplied the fix oncodex/fix-agent-code-block-contrast-rebased.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