Repository navigation
fix(ui-egui): scale list markers with effective body font size - #243
Merged
DWAA1660 merged 2 commits intoNov 14, 2026
Merged
Conversation
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
This PR fixes #241 where unordered list bullets (
•) and ordered list numbers ({number}.) did not scale with the body text font size.Root Cause
In
crates/ui-egui/src/preview.rs, body text inBlock::Itemusesdraw_spans(..., 14.5 * zoom, ...), where individual spans scale viaformat_ofusing14.5 * zoom * points / 11.0. In contrast, list markers were rendered usingui.label(RichText::new(...).color(tokens.muted))without.size(...), causing egui to fall back to default body text size (14.0 pt) and ignore both custom font sizes and zoom level.Fix
item_marker_size(spans: &[Span], zoom: f32) -> f32to resolve the effective font size from item spans (matchingdraw_spansscale calculation:14.5 * zoom * points / 11.0, or14.5 * zoomif unspecified)..size(marker_size)to the markerRichTextinBlock::Itemwhile preserving existing color (tokens.muted), nested indentation, RTL layout, and task checkbox behavior.Verification
crates/ui-egui/src/preview.rs:list_marker_size_follows_effective_body_font_size_and_zoom: verifies default size (14.5), larger font sizes (18pt, 24pt), zoom factors (1.5x, 2.0x), and image span handling.list_items_render_with_marker_scaled_for_ordered_and_unordered: tests rendering layout heights under egui for ordered/unordered lists with default vs larger font sizes, zoom scaling, and nested RTL items.cargo test -p notecraft-ui-egui --lib preview: passed (20 passed)cargo test -p notecraft-ui-egui --lib: passed (347 passed)cargo fmt --check -p notecraft-ui-egui: cleancargo clippy -p notecraft-ui-egui --all-targets: clean (0 warnings)cargo xtask text: 0 problemscargo xtask i18n-audit: 0 source findingsgit diff --check: cleanFixes #241