Repository navigation
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Define the text-size scale crates/ui-egui/src/theme.rs, docs/whats-new.md |
Adds seven named text sizes, named regular and semibold font helpers, and nearest-size mapping for numeric requests. Updates egui text styles and documents the scale. |
Apply typography tokens crates/ui-egui/src/panels/*, crates/ui-egui/src/panels/detail/*, crates/ui-egui/src/panels/edit/*, crates/ui-egui/src/panels/left/*, crates/ui-egui/src/panels/right/*, crates/ui-egui/src/widgets.rs, crates/ui-egui/src/dialogs.rs, crates/ui-egui/src/dialogs/*, crates/ui-egui/src/dialogs/import/*, crates/ui-egui/src/dialogs/settings/* |
Replaces fixed font sizes and weights with named theme styles across panel, widget, and dialog text. |
Check text fitting and scale use crates/ui-egui/src/panels/grid.rs, crates/ui-egui/src/panels/masking.rs, crates/ui-egui/src/tests.rs, crates/ui-egui/src/tests/type_roles.rs, crates/ui-egui/src/tests/type_scale.rs, crates/ui-egui/src/tests/dialog_fit.rs |
Uses caption and micro sizes when fitting masking tile labels and constrains square-grid filenames to the area before the format badge. Adds rendering and layout checks; updates the Export dialog width expectation. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Possibly related issues
- Right-to-left languages: what the interface needs before Arabic, Hebrew or Persian can ship #1395: The named text-size scale affects the small text sizes cited in this issue, but this change does not implement bidirectional layout or mirroring.
- pt-BR UI: HDR button covered by Reset, filter bar overflows, untranslated strings #1949: The change adds text-fit checks and adjusts some text bounds, but does not provide a locale-specific fix for the reported overlap and overflow.
Suggested reviewers: aiongg
Merge Risk: 
Minimal · previous review cbc04
-
The typography changes preserve the named-size contract and inspected UI layouts, with no actionable merge-blocking risk established.
Security architecture risk: 
Minimal · up to cbc04
-
The reviewed changes centralize text sizing without adding access to sensitive operations or expanding application privileges. The flagged dialog helper remains internal and only calculates layout width. No introduced or worsened security issue was identified.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The inspected API changes affect font selection and UI geometry, not authorization or access to sensitive resources. Repository source searches found no consumers of the new typography APIs outside ui-egui; external downstream consumers remain unverified.
Trust Boundaries and Controls
- observed — The flagged tag_field_width entrypoint remains crate-visible rather than externally public. Its base and head caller sets are unchanged, and it does not accept template content or perform template insertion, filesystem operations, or permission checks.
-
Pre-merge checks: 
4
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- 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.
790fbf2 to
cc17af1
Compare
|
Marked ready for review. It is stacked on #1374: this PR's own commit is |
cc17af1 to
a7494f4
Compare
a7494f4 to
cbc04f8
Compare
… theme theme::TextSize names seven sizes a point or more apart (10 micro, 11 caption, 12 label, 13 body, 14 title, 15 panel title, 18 display), and Tokens gives each in both faces: t.caption(), t.body_strong() and the like. The call sites that already asked for one of those sizes by number (.size(11.0), t.font(13.0), the Body, Button and Small text styles) name the role instead. Nothing on screen changes: the sizes that are off the scale (12.5, 11.5, 13.5 and the rest), t.font(n) and t.semibold(n) are as they were. Tests: tests_type_roles.rs (the seven sizes and their steps, both faces of each role, the text styles). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are half a point apart The interface drew 17 sizes from 8.5 to 20 pt, 102 of 237 uses on half points: a slider's name at 12.5 beside a checkbox's 13, a caption at 11 in Settings and 11.5 in Info, panel titles at 13.5, 14, 15 and 17. - The 115 call sites that were off the scale name the size their job has (t.caption(), t.body_strong(), ...). The smallest text is 10 pt (was 8.5). - t.font(n) and t.semibold(n) keep their signatures and give the size of the scale nearest n (of two equally near, the one nearer body), so code that asks by number is on the scale too. A window's title (the Heading text style) is 15 pt, a panel's size. - Chips and choices are caption size, so the Export dialog is 602 pt wide where it was 615. Tests: tests_type_scale.rs (every text shape drawn by the library, a photo being edited, each tab of Settings and three dialogs is on the scale; any number asked for lands on it; the line over a square cell ends before the format). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cbc04f8 to
8c1905c
Compare
|
This is stacked on #1374, which is still open and conflicts with main, so this can't be merged or fully reviewed until that lands. Main has since moved most panels onto the Craft framework (#4750), so many of the 20+ conflicting files now draw their text through framework widgets; please rebase after #1374 and re-check, per surface, that the seven-size claim and |
Stacked on #1374 (merge order to
main: #1374 → this). This PR's own commit is8c1905c032;b341826e11under it is #1374's, so the diff againstmainalso shows #1374's lines until it lands. It is cut from the old #1374, which held all eight parts.Problem
The interface draws 17 text sizes from 8.5 to 20 pt, 102 of 237 uses on half points: a slider's name at 12.5 pt beside a checkbox's 13, a caption at 11 pt in Settings and 11.5 in Info, panel titles at 13.5, 14, 15 and 17. The parent PR gives the seven sizes names and moves the call sites that already asked for one of them; this one moves the rest.
Change
t.caption(),t.body_strong()…). The smallest text is 10 pt (it was 8.5).t.font(n)andt.semibold(n)keep their signatures and give the size of the scale nearestn(of two equally near, the one nearer body), so code that still asks by number lands on the scale too (TextSize::nearest).Headingtext style) is 15 pt, a panel's size; it was 16.tests_type_scale.rs(every text shape drawn by the library, a photo being edited, each tab of Settings and three dialogs is on the scale; any number asked for lands on it; the line over a square cell ends before the format), theHeadingassertion intests_type_roles.rsand the new Export width intests_dialog_fit.rs. A What's New entry.Not in this PR:
t.font(11.5),t.semibold(12.5)…) are drawn at the nearest size by the rule above, not moved to a role; a few of them land one step from their neighbor with the same job (a menu group heading in Edit's profile menu is 11 pt, the one in the mask-effects menu is 12). The last PR of the chain adds a check that lists them.cargo xtask typeand its rule inCLAUDE.md.How it was checked
cbc04f85c9):cargo check --workspace --all-targetsandcargo fmtwithcargo clippy --workspace --all-targets -- -D warnings(Enforce Rust coding standards via Clippy #3111's lints; with MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973's one-file clippy fix applied uncommitted) pass at the top of this chain;cargo xtask typepasses (143 files, 17 sizes asked by number);cargo test -p lightcraft-ui-egui --libfiltered ontype_,dialog_fitandcrop_rotate: 72 passed; each commit's changed lines equal the ones before the port except where Enforce Rust coding standards via Clippy #3111 moved the code (compared line by line), and the docs and locale checks are clean. The fullcargo xtask ciwas not run locally at this head: the hostedCIgate runs it. The bullets below are from before the port, at the heads they name.cargo xtask ciat this head (cc17af1d7d), here:cargo fmtclean; clippy clean exceptapps/lightcraft/src/native_menu.rs:492("thisifhas identical blocks", onmaintoo, MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973); then the rest of the run past that one:cargo test --workspace --lib --bins --tests: 5,012 tests passed, 1 failed,accessibility::every_interactive_node_has_a_name_in_every_view_and_toolon the missing glyph "▸" (U+25B8), which fails onmaintoo (LR-BEHAV-LOCALIZE: menu paths with →, not the ▸ no UI font has (#1950) #2016); the parity, layers, assets and wasm steps passed. The hostedCIgate runs the same on the pushed headcargo test -p lightcraft-ui-egui --lib tests_type(9 passed) andtests_dialog_fit(6 passed)import.rscall sites put back to the parent's, the new theme API kept): 4 of the 9tests_typetests fail:the_library_draws_its_text_on_the_scale,a_photo_being_edited_draws_its_text_on_the_scale,settings_and_the_dialogs_draw_their_text_on_the_scaleandthe_line_over_a_square_cell_ends_before_the_format. The others, and the new Export width intests_dialog_fit, were not run on the old code: they exercise the theme API this PR adds790fbf2842), the rest are under Not in this PR. The branch was rebased onto a newermainafter that review; a second reviewer read this commit's diff atcc17af1d7dand the rebase against790fbf2842and found no problems (the only new text on screen frommain, the Info panel's "Show Metadata For" row and its several-photo rows, is on the scale)Review: a fresh read-only reviewer subagent at cbc04f8 (it read all seven commits of this chain against their originals); later: rebased onto #1374 b341826 from 3e6e473
Screenshots
Before and after, each taken from a release build of the parent's head (before: #1374 at
0f3f760766) and of this PR's head before the rebase (after:790fbf2842; the rebase moved no size), in a 1600 × 1000 window at 2× scale, in a throwaway in-memory session with the procedural demo photos, driven only through the control channel. Each pair is the same scene on both builds. A pair marked "crop" is a cut-out of the full-size shot, so the small text is readable. Sizes move by up to a point, so the differences are small by design; each caption names what to look at.Library grid, Charcoal (dark): look at the sidebar rows ("All Photos", "Recently Added"…) and the Auto / B&W / HDR / Reset chips in the Edit panel, which are slightly smaller (the chips are caption size).
A photo being edited, Charcoal (dark): same rows and chips, plus the filmstrip under the photo.
Library grid, Silver (light): the same rows and chips in a light theme.
A photo being edited, Silver (light).
Export dialog, Charcoal: 13 pt narrower (602 pt instead of 615), because its chips and choices are caption size.
Settings, General tab, Charcoal: the tab chips and the language choices are caption size.
Not captured: a Midnight and a Paper pair (the change is the same size in every theme; the next draft in the chain takes all four themes).
Merging
git merge-tree), in the files this PR changes; whichever lands second rebases, and the usual resolution is to take the other side and name the size or color its line has:unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit