Repository navigation
LR-BEHAV-LOCALIZE: the Color section's rows no longer widen the Edit panel (stacked on #2804) - #2883
EduardoAndradeMachado wants to merge 2 commits into
Conversation
Reset was laid out right-to-left in whatever width Auto, B&W and HDR left, so a long label drew over HDR: German Zurücksetzen in the default panel, and 16 of the 18 languages at some panel width. A button that doesn't fit now starts the next row; Reset stays right-aligned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…panel In longer languages the Color Mixer's Hue / Saturation / Luminance row, the White Balance row and the colour swatches were wider than the panel. egui grows the content to its widest row, so the sliders and buttons below them ran past the panel's right edge, under the tool strip. - Targeted-adjustment row: the gaps narrow (6 down to 2 pt) before a button wraps, and a wrapped row starts after the target icon like the first. English keeps its single row in the default panel. - White Balance row: label and mode are cut short with an ellipsis before the eyedropper, the label first (down to 40 pt) so the mode stays whole where it can. The row never wraps, so its layout doesn't change with the mode. - Swatches: the gaps narrow only when the eight don't fit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Header button sizing and wrapping crates/ui-egui/src/widgets.rs, crates/ui-egui/src/panels/edit.rs |
A shared helper measures text button widths. Header buttons wrap when they do not fit, while Reset remains right-aligned. Tests check button bounds, overlap, and alignment across locales and widths. |
White Balance and mixer layout crates/ui-egui/src/panels/edit.rs, crates/ui-egui/src/tests_edit_layout.rs |
The White Balance label and dropdown fit the available row width. Mixer spacing adapts to panel width, and targeted-adjustment buttons wrap. Tests check layout and text elision across locales, widths, and white-balance modes. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers: marcoarnulfo
Merge Risk: 
Minimal · up to d87ee
-
The elided label remains readable on hover, and no unresolved issue identified here prevents merging after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 Clippy (1.99.0)
-
Clippy execution timed out
Comment @coderabbitai help to get the list of available commands.
|
This conflicts with main ( |
Stacked on #2804: it uses that PR's
widgets::text_button_size. Only the last commit (d87ee41c) is this one's own.Problem
In longer languages the Edit panel's content runs past its right edge. Sliders, their values, buttons and the Color Mixer's chevron end under the tool strip, and the White Balance mode is cut off by the panel (Portuguese "Como capturado ›" in the screenshot below).
The cause is the one #1762 fixed for long profile names. egui grows the content to its widest row, so one row wider than the panel widens everything below it. Three rows in the Color section do that:
Measured on #2804's head with the new test: some widget ends past the panel's right edge in 15 of the 18 languages at 270 pt, and in all 18 at 250 pt.
Change
All three changes are in
crates/ui-egui/src/panels/edit.rs.text_button_size, asheader_buttonsdoes. English keeps its single row in the default panel.dropdown_within/one_line, as the profile row has done since LR-PROF-DROPDOWN: a long profile name no longer widens the Edit panel #1762).Not in this PR:
If you'd rather the White Balance label took a row of its own instead of being cut short, I'm happy to switch. I tried that first, but the layout then changed with the selected mode: in English at 270 pt, "Fluorescent" moved the label up and "As Shot" moved it back.
How it was checked
A test that fails without this change:
tests_edit_layout::the_color_section_leaves_the_edit_panel_its_width_in_every_language.right::show, so its border and scroll area take their share as in the app. It covers all 18 languages, at 250 and 270 pt, for every white balance mode (Custom included: the menu doesn't offer it, but dragging Temp or Tint sets it).Planted bugs, one at a time in the production code; each turned the test red:
A first version of the test rendered
edit::showdirectly, withoutright.rs's border and scroll area. It passed while the app wrapped English. Measured in the app at 270 pt, the content is 222 pt, which is why the test now goes throughright::show.User-visible change: looked at the final code in headless snapshots, before and after (below). The desktop app was also run and checked by hand on an earlier revision of this branch.
Local checks, Windows 11:
cargo fmtclean.cargo clippy -p lightcraft-ui-egui --all-targets -- -D warningsclean.cargo xtask layersandcargo xtask assetsOK.cargo test -p lightcraft-ui-egui: 1387 passed, 7 failed. The same 7 fail on fix(ui): wrap the Edit header buttons instead of letting Reset cover HDR #2804's head without this change: sixtests_model_setuptests (no denoise model in this build, as fix(ui): wrap the Edit header buttons instead of letting Reset cover HDR #2804 also reports) andtests_launch_library::listing_the_libraries_leaves_every_folder_byte_identical.cargo xtask ci --quickstops at clippy on Windows on a warning outside this PR:unused variable: gvfsincrates/engine/src/doc_path.rs:66, a Linux path in a test. That's why the steps above were run by hand.Screenshots
Headless snapshots (
lightcraft-cli snapshot --demo, 1400 × 900, right panel at its default 270 pt). Before is #2804's head; After is this branch.Portuguese:
English: one mixer row as before, with slightly narrower gaps.
Merging
fn mixer's signature but not these rows. I searched the open PRs that touchedit.rsfor these rows and found none.Summary by CodeRabbit