component: Fix text descender clipping - #3023
Open
huacnlee wants to merge 2 commits into
Open
Conversation
Co-authored-by: Codex <codex@openai.com>
Remove the temporary text clipping example after visual verification. Co-authored-by: Codex <codex@openai.com>
huacnlee
enabled auto-merge (squash)
September 9, 2026 12:12
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.
Summary
Text descendants that inherit a line height of
1can lose the bottoms ofg,y,p,q, andjwhentruncate()or an ancestor clips their line box, even when the outer control has enough space.Use a default line height of
1.25for Button, Toggle, Tab, Tag, GroupBox titles, DialogTitle, and DialogFooter. Let Checkbox and Radio labels inherit their text container's1.25line height instead of overriding it with1.Explicit Button, Toggle, and Tab frame sizes stay the same. Content-sized labels, titles, and tags may become slightly taller. This default addresses the reproduced font metrics; it does not guarantee that every custom font or explicitly constrained height will fit.
Align Checkbox and Radio indicators with the first text line by accounting for half of the additional line spacing. Wrapped labels keep first-line alignment, and indicators without content keep their original position.
Test Plan
git diff --check.Implementation was generated with Codex and reviewed in this session.
Suggested .rules additions
For
crates/component: Avoid forcing text-bearing containers to a line height of1for alignment when they or their descendants can clip text. Check descenders with a bundled font, including customtruncate()children; an adequate outer control height does not make a tight inner line box safe.Release Notes: