Repository navigation
fix(labels): the class rule note only with more than one visible class - #994
Conversation
The note under SQL Query showed with any extra class, even a hidden one, when only one class labels the layer. It now counts the visible classes the map draws, Default included. Closes opengeos#993.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update and test the SQL note condition crates/ui-egui/src/labelpane.rs |
The note condition now checks for multiple visible classes. Comments clarify the visible-class wording and note order. The test verifies that hiding the extra class suppresses the note. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- opengeos/RustGIS#967: This PR updates the condition for the SQL note introduced in
#967. - opengeos/RustGIS#789: This PR uses class visibility state added by
#789. - opengeos/RustGIS#737: This PR changes when the multi-class note introduced in
#737appears.
Suggested reviewers: giswqs
Merge Risk: 
Minimal · up to ea449
-
No actionable merge-blocking risk remains for this focused visibility-note change.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the change: the class rule note in the Labeling pane's SQL Query section now appears only when more than one class is visible. It uses the conventional fix(scope): prefix and states the main behavior change. It is specific enough for a teammate scanning history to understand the primary change.
Full details: Description check
-
Explanation
The description follows the template. The Summary section explains what changed and why, including the prior behavior and the new visibility rule. The Testing section lists the CI command, the updated test step, and the manual checks. The Related issue section links issue
#993with a closing keyword. Each required section is filled in with specific detail.
Full details: Linked Issues check
-
Explanation
The change satisfies
#993. Incrates/ui-egui/src/labelpane.rs, the SQL note now appears only whenlabels.in_order()contains more than one visible class. This includes Default and matches the map-drawn class set. The existing note order remains unchanged. The testthe_sql_tab_says_what_else_decides_the_labelshides the extraBigclass and verifies that the note is absent when only Default remains visible.
Full details: Out of Scope Changes check
-
Explanation
The pull request changes only the SQL note condition, related comments, and the focused automated test in
crates/ui-egui/src/labelpane.rs. These changes directly support#993and do not show unrelated behavior changes.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each class in view,
The hidden one no note is due.
When two are shown, the words appear,
When one remains, the pane is clear.
The rabbit hops, its review complete.
Comment @coderabbitai help to get the list of available commands.
Code reviewNo blocking findings. I checked the change against Bugs
Security
Performance
Quality
AGENTS.md
No inline comments: nothing here warrants one. Change sizeCompared: the whole PR against main (merge base 249c61a to PR head ea44918).
|
📖 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 reviewReviewed the one-file change to Bugs: None found. Checked the hidden-class and labels-off branches (unchanged, and they take precedence), the case of Default hidden with one extra visible class (no note, covered by the existing test), and the case of Default plus one visible extra class (note shown). Security: None found. The change only alters a UI condition and a note's visibility; no input handling is touched. Performance: None found. The count runs once per UI frame over at most 65 classes. Quality:
AGENTS.md: Compliant. No new user-visible literals (the string is unchanged, so no catalog work is needed), no No inline comments were posted, because there is nothing that needs a line-level fix. Change sizeCompared: the whole PR against main (merge base 249c61a to PR head ea44918).
|
Summary
Follow-up to #967, from CodeRabbit's review there. The note under SQL Query in the Labeling pane's Content tab, "Each class labels the features its own clause matches, so a feature can get a label from more than one.", showed whenever the layer had any class besides Default, even a hidden one. In that case only one class labels the layer, so overlaps cannot happen.
The note now shows only when more than one class is visible. It counts them with
labels.in_order(), the classes the map draws (the extra ones up toMAX_LABEL_CLASSES, then Default). The order of the notes is unchanged: labels off first, then a hidden class, then this rule.It counts visibility only, not the scale range, so the note doesn't come and go with the zoom. A class on a missing field already has its own notes in the Field box and the SQL box.
Testing
cargo xtask ci.the_sql_tab_says_what_else_decides_the_labelsadds a step: with Default chosen and visible, hiding the extra class "Big" removes the rule. That step fails with the old condition.Related issue
Closes #993.
Summary by CodeRabbit