Repository navigation
fix(gpui): readable long inline code in dark mode - #94
thebrandonlucas wants to merge 1 commit into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| 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:
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: 
5
-
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.
tee8z
left a comment
There was a problem hiding this comment.
Approving, with two gates still open.
- The cause checks out.
TextViewStyle::default()buildsinline_codewithbackground_color: Some(colors.accent)from the light palette, andinline_code_highlight()falls back tocode_backgroundonly when that background isNone. Sowith_code_backgroundnever reached spans longer thanCODE_CHIP_MAX. - These are the only three
TextViewStyle::default()builders incrates/app(grep forTextViewStyle::/with_code_background), so none are missed. - Inverted surfaces still work:
on_text_colorreplacesinline_code's background withcolor.opacity(0.12), so long code on aprimaryfill doesn't take the newaffordance_subtle. - It should compile:
HighlightStylecomes into scope throughuse gpui_kit::*;in all three files (markdown.rsalready 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
left a comment
There was a problem hiding this comment.
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.
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>
c413c15 to
392b39a
Compare
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, andwith_code_backgroundonly sets the fenced-block background. Code spans overCODE_CHIP_MAXstay in the text flow and use the style'sinline_codehighlight, which defaulted to the lightaccentfill. Short spans render through a separate chip element that already usesaffordance_subtle.Fix
Set
with_inline_codetoaffordance_subtlenext towith_code_backgroundin the three builders that do this: message markdown (ui/markdown.rs), agent memory (agents2/memory.rs), release notes (settings/updates.rs).Checks
cargo checkfails 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.🤖 Generated with Claude Code
Summary by CodeRabbit