Repository navigation
fix(ui): Unique Values shows its Expression box as soon as it is chosen (#2784) - #2792
Conversation
…en (opengeos#2784) Choosing Unique Values showed only the Field selector and Apply (opengeos#738); the Expression box appeared once a field was applied, so classing by an expression took a field first and an extra undo step. The same box now sits under the field choice, and an expression that reads classes by it in one step and ends the choice.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewBugsNone found. I checked the new pending-choice expression box against the existing Unique arm: they share the id, and SecurityNone found. The change is UI-only and adds no new command, parameter, or input path. Confidence: high. PerformanceNone found. The box runs as before, and the parse only runs when the text changes. Confidence: high. Quality
AGENTS.mdNo violations found. The panel uses I left no earlier concerns alone because there were no prior review threads. Change sizeCompared with the base branch: the whole PR against
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Already raised, left alone
Change sizeCompared: the whole PR against main (merge base dd3d011 to PR head 0cb0765).
|
Summary
Choosing Unique Values in the Symbology pane showed the Field selector and Apply (#738), but not the Expression box: that box was drawn only once the renderer was Unique Values (
crates/ui-egui/src/panes.rs, theRenderer::Uniquearm). To class by an expression, you first applied a field you didn't want, then typed the expression, which also left an extra undo step.The same
expression_box, with the same id, is now drawn under the field choice as soon as Unique Values is chosen. An expression that reads applies Unique Values by that expression when the box loses focus (layer.symbologywithexpression), in one undo step, and ends the field choice (symbology_pending). The pane then looks as it does today after applying: Field shows "(expression)" and the box keeps the text. A blank box applies nothing, and one that doesn't read shows why, both as the box already does, and the field choice stays open. Field + Apply, and the choice following its context (#738's tests intests/smoke.rs), are unchanged.Surfaces: the Symbology pane lives in
rustgis-ui-egui, which the desktop app and the browser build share. The phone layout (ui-touch) has no Symbology pane. Nothing here is a new command: it runslayer.symbologyas the box under the applied field does, so the CLI, Python, scripts and the Assistant/MCP are unaffected. No new user-visible strings: "Expression" is the existing label.Not in this PR (noted for a follow-up): while the field choice is open, the controls of the layer's current renderer (for example Graduated Colors' field, method and classes) are still drawn under it, as before this change.
Testing
panes::tests::unique_values_offer_their_expression_before_a_field_is_applied, written first; before the change it failed because no Expression box was found while the field choice was open. It checks a blank box, an expression that doesn't read ("Invalid:", nothing applied, the choice still open), one that reads (classes by it, one undo step, the choice ended, Field shows "(expression)"), and undo (the earlier renderer back, no choice reopened).unique_symbology_lets_the_user_choose_a_text_field_before_applyingandunique_symbology_pending_choice_follows_its_context, andunique_values_are_classed_by_the_expression_typed: pass.cargo nextest run --workspace: 9115 passed.cargo clippy -p rustgis-ui-egui --all-targets -- -D warnings,cargo fmt --all --check, doctests,cargo xtask layers,cargo xtask schema --check: pass.ui_shotreplay, before and after: Countries (Graduated Colors) in the Symbology pane, Unique Values clicked; after,pop_est > 100000000typed in the Expression box and Enter.UI evidence
Unique Values just chosen. Before (left): Field and Apply only. After (right): the Expression box under them.
After typing
pop_est > 100000000and pressing Enter: classed by the expression, the field choice gone.Related issue
Closes #2784
Summary by CodeRabbit