Skip to content

fix(gpui): readable long inline code in dark mode - #94

Open
thebrandonlucas wants to merge 1 commit into
mainfrom
fix/gpui-long-inline-code-dark-background
Open

thebrandonlucas wants to merge 1 commit into
mainfrom
fix/gpui-long-inline-code-dark-background

Conversation

@thebrandonlucas

@thebrandonlucas thebrandonlucas commented Oct 29, 2026 •

Copy link
Copy Markdown

Problem

In the GPUI app's dark theme, inline code longer than 40 characters (long file paths, test names) rendered as a near-white chip with light text, unreadable. Shorter inline code was fine.

Cause

TextViewStyle::default() is built from the light palette, and with_code_background only sets the fenced-block background. Code spans over CODE_CHIP_MAX stay in the text flow and use the style's inline_code highlight, which defaulted to the light accent fill. Short spans render through a separate chip element that already uses affordance_subtle.

Fix

Set with_inline_code to affordance_subtle next to with_code_background in the three builders that do this: message markdown (ui/markdown.rs), agent memory (agents2/memory.rs), release notes (settings/updates.rs).

Checks

  • Found by reading the code against the screenshot; wrapped chips were exactly the >40-char spans.
  • Not built or run: cargo check fails here (no glib dev package; repo toolchain 1.95 is too old for a locked dep). CI is the first compile. Needs a human look at a long inline code span in dark mode.
  • No new error paths. CRAP report not run for the same reason.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Inline code now has a subtle background in agent memory, Markdown content, and release notes.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between c413c15 and 392b39a.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 27ce92b and 845cfe6.

Files selected for processing: 3
  • apps/buzz-gpui/crates/app/src/ui/agents2/memory.rs
  • apps/buzz-gpui/crates/app/src/ui/markdown.rs
  • apps/buzz-gpui/crates/app/src/ui/settings/updates.rs

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

Markdown, memory, and release-notes text styles now apply the subtle affordance background color to inline code.

Changes: Inline-code styling

Layer / File(s) Summary
Apply inline-code backgrounds
apps/buzz-gpui/crates/app/src/ui/markdown.rs, apps/buzz-gpui/crates/app/src/ui/agents2/memory.rs, apps/buzz-gpui/crates/app/src/ui/settings/updates.rs
Each text style now assigns the subtle affordance background color to inline code.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested labels: human review wanted

Suggested reviewers: tee8z

Merge Risk: Minimal · previous review 845cf

The styling change is statically consistent across all three views and introduces no identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(gpui): readable long inline code in dark mode" matches the main change. The PR sets the inline code highlight to affordance_subtle in three TextViewStyle builders (markdown.rs, agents2/…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(gpui): readable long inline code in dark mode" matches the main change. The PR sets the inline code highlight to affordance_subtle in three TextViewStyle builders (markdown.rs, agents2/memory.rs, settings/updates.rs). This makes long inline code spans readable in the GPUI dark theme. The title is specific, concise, and uses a conventional commit prefix. The title does not mention the three files, but it does not need to.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@thebrandonlucas
thebrandonlucas changed the base branch from main to fix/gpui-macos-bundled-fonts October 29, 2026 14:53
@thebrandonlucas
thebrandonlucas added this pull request to stack #92 October 29, 2026 14:53
@thebrandonlucas
thebrandonlucas marked this pull request as ready for review October 29, 2026 14:54
tee8z
tee8z previously approved these changes Oct 29, 2026

@tee8z tee8z left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, with two gates still open.

  • The cause checks out. TextViewStyle::default() builds inline_code with background_color: Some(colors.accent) from the light palette, and inline_code_highlight() falls back to code_background only when that background is None. So with_code_background never reached spans longer than CODE_CHIP_MAX.
  • These are the only three TextViewStyle::default() builders in crates/app (grep for TextViewStyle:: / with_code_background), so none are missed.
  • Inverted surfaces still work: on_text_color replaces inline_code's background with color.opacity(0.12), so long code on a primary fill doesn't take the new affordance_subtle.
  • It should compile: HighlightStyle comes into scope through use gpui_kit::*; in all three files (markdown.rs already uses it unqualified).

Gates before merge: the Buzz GPUI CI run on 845cfe6 was still running when I approved. The red CI jobs on this PR come from a duplicate CI run (40896053239) that was cancelled; the live CI run passed. A human still needs to look at an inline code span over 40 characters in dark mode.

Optional: .with_inline_code(HighlightStyle::default()) would let the existing code_background fallback do the work without repeating the color. The explicit version is fine too.

Minimalism 9 · elegance 9 · correctness 9.

tee8z
tee8z previously approved these changes Oct 29, 2026

@tee8z tee8z left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving. The earlier approval was dismissed by the stale-review automation when the stack's merge commits propagated #90's fix (17:39:52Z); this PR's own diff is unchanged from what I reviewed. Findings and gates from the previous review stand.

Base automatically changed from fix/gpui-macos-bundled-fonts to main October 29, 2026 18:57
@thebrandonlucas
thebrandonlucas dismissed tee8z’s stale review October 29, 2026 18:57

The merge-base changed after approval.

TextViewStyle::default() is built from the light palette, and
with_code_background only sets the fenced-block background. Inline code
over 40 characters stays in the text flow and takes the style's
inline_code highlight, so in dark mode it kept the light accent fill
under light text. State the inline code background alongside the code
background in the three TextViewStyle builders.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thebrandonlucas
thebrandonlucas force-pushed the fix/gpui-long-inline-code-dark-background branch from c413c15 to 392b39a Compare October 29, 2026 18:57
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