Fix overlapping and clipped text in LLStatBar layout#287
Conversation
The vertical layout reserved fixed pixel heights (14/15/20px) tuned for a shorter monospace face. With the current taller default font this caused long labels to overprint the right-aligned value, text descenders to spill into the bar/next row, and tick-mark labels to be clipped at the bottom when partially expanded. Derive the top text reserve and the vertical bottom tick-label reserve from the live monospace line height, reserve the value's width so a long label is ellipsized instead of overlapping, and make the partial-expand required height orientation-aware so vertical bars fit their bottom tick labels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR refactors ChangesLLStatBar Layout and Rendering Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
indra/llui/llstatbar.cpp (1)
400-400: 💤 Low valueConsider naming the horizontal right-side reserve.
This
40is the right-side space reserved for horizontal tick labels — the same kind of layout magic number the PR centralized intoSTAT_BAR_*constants. Promoting it (e.g.STAT_BAR_HVALUE_RESERVE) keeps the layout vocabulary consistent. Note the40ingetRequiredRect()(Line 625) is a minimum total height with different semantics, so keep them separate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@indra/llui/llstatbar.cpp` at line 400, Replace the magic constant 40 used to compute bar_rect.mRight in llstatbar.cpp with a clearly named constant (e.g. STAT_BAR_HVALUE_RESERVE) to match the existing STAT_BAR_* vocabulary; add the new constant where other STAT_BAR_* constants are defined, then use STAT_BAR_HVALUE_RESERVE in the calculation for bar_rect.mRight (keeping the separate 40 in getRequiredRect() unchanged since it has different semantics) and update any comments to indicate this value is the horizontal right-side reserve for tick labels referenced by bar_rect.mRight.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@indra/llui/llstatbar.cpp`:
- Line 400: Replace the magic constant 40 used to compute bar_rect.mRight in
llstatbar.cpp with a clearly named constant (e.g. STAT_BAR_HVALUE_RESERVE) to
match the existing STAT_BAR_* vocabulary; add the new constant where other
STAT_BAR_* constants are defined, then use STAT_BAR_HVALUE_RESERVE in the
calculation for bar_rect.mRight (keeping the separate 40 in getRequiredRect()
unchanged since it has different semantics) and update any comments to indicate
this value is the horizontal right-side reserve for tick labels referenced by
bar_rect.mRight.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: efdff3f2-233e-4d68-960c-8e7f40184360
📒 Files selected for processing (1)
indra/llui/llstatbar.cpp
Description
The vertical layout reserved fixed pixel heights (14/15/20px) tuned for a shorter monospace face. With the current taller default font this caused long labels to overprint the right-aligned value, text descenders to spill into the bar/next row, and tick-mark labels to be clipped at the bottom when partially expanded.
Derive the top text reserve and the vertical bottom tick-label reserve from the live monospace line height, reserve the value's width so a long label is ellipsized instead of overlapping, and make the partial-expand required height orientation-aware so vertical bars fit their bottom tick labels.
Related Issues
Issue Link:
Checklist
Please ensure the following before requesting review:
Additional Notes