You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thread Markdown renders fenced diff blocks with sugar-high, which emits semantic classes for added, removed, hunk, and metadata lines. bb defines token colors but no CSS for those line classes, so changed lines have the same background as context lines. Added and removed lines should be visually distinct.
Versions and environment
Tested against origin/main at f4bbc2fe81a9b7639ff9a7396e172bddd89109e4
bb 0.40.0 from source
macOS 26.3, Node v24.6.0
bb resolves sugar-high@2.0.1; I also checked the current sugar-high@2.1.0
Visual check used an isolated Playwriter headless Chromium page with a standalone Vite mini reproduction
Steps to reproduce
Check out f4bbc2fe81a9b7639ff9a7396e172bddd89109e4 and install dependencies.
bb output: diff line annotations present; embedded keyword tokens absent
Standalone browser probe:
default added-line background: rgba(0, 0, 0, 0)
added-line background after applying consumer CSS: rgb(23, 60, 43)
keyword tokens in diff output: 0
keyword tokens in the TypeScript control: 8
The addition, deletion, hunk, metadata, and context rows use the same background in bb.
Expected:
.sh__line--diff-add and .sh__line--diff-remove use theme-derived addition and deletion backgrounds.
Hunk and metadata rows remain distinguishable without overpowering the code.
Add a behavior-focused render test that proves the diff classes receive the intended styles.
The missing nested TypeScript highlighting is separate. sugar-high's diff preset annotates line roles but does not infer a file language or tokenize each line with that language. Fixing that part needs a different renderer or an explicit nested-language design; passing lang: "diff" differently will not provide it.
Evidence
bb correctly resolves the fence and calls highlight(code, { lang: resolved }): markdown-code-highlight.ts
The Markdown renderer inserts sugar-high's HTML under .bb-code-highlight: markdown-preview.tsx
sugar-high 2.0.1 adds the diff annotations in its preset: diff.js
The standalone mini ran the same fixture against sugar-high 2.0.1 and 2.1.0. Both versions emitted diff annotations and no embedded TypeScript keyword tokens.
Still present in the relevant files on origin/main at f4bbc2fe81a9b7639ff9a7396e172bddd89109e4.
React Markdown sanitization does not remove the annotations; they are present in the final DOM.
Upgrading sugar-high alone does not fix it; 2.1.0 has the same output contract.
Suggested priority and effort
Medium. It affects every fenced diff in thread Markdown and makes reviews slower, but loses no data. Styling the existing line classes should be low effort; nested source-language highlighting is separate work.
Summary
Thread Markdown renders fenced
diffblocks with sugar-high, which emits semantic classes for added, removed, hunk, and metadata lines. bb defines token colors but no CSS for those line classes, so changed lines have the same background as context lines. Added and removed lines should be visually distinct.Versions and environment
origin/mainatf4bbc2fe81a9b7639ff9a7396e172bddd89109e4sugar-high@2.0.1; I also checked the currentsugar-high@2.1.0Steps to reproduce
Check out
f4bbc2fe81a9b7639ff9a7396e172bddd89109e4and install dependencies.Render this Markdown in a thread message:
Inspect the rendered lines. The HTML contains
.sh__line--diff-add,.sh__line--diff-remove,.sh__line--diff-hunk, and.sh__line--diff-meta.Run
git grep -n 'sh__line--diff' f4bbc2fe81a9b7639ff9a7396e172bddd89109e4 -- apps/app. It returns no matches.Minimal code-path check:
Expected vs actual
Actual:
The addition, deletion, hunk, metadata, and context rows use the same background in bb.
Expected:
.sh__line--diff-addand.sh__line--diff-removeuse theme-derived addition and deletion backgrounds.The missing nested TypeScript highlighting is separate. sugar-high's
diffpreset annotates line roles but does not infer a file language or tokenize each line with that language. Fixing that part needs a different renderer or an explicit nested-language design; passinglang: "diff"differently will not provide it.Evidence
highlight(code, { lang: resolved }): markdown-code-highlight.ts.bb-code-highlight: markdown-preview.tsxWhat you ruled out
diffnow resolves correctly.origin/mainatf4bbc2fe81a9b7639ff9a7396e172bddd89109e4.Suggested priority and effort
Medium. It affects every fenced diff in thread Markdown and makes reviews slower, but loses no data. Styling the existing line classes should be low effort; nested source-language highlighting is separate work.