Skip to content

feat(labels): a class header in the Labeling pane, with Remove set apart - #892

Merged
giswqs merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/label-class-header
Oct 25, 2026
Merged

giswqs merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/label-class-header

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Step 2 of #858: the Labeling pane gets a header for the chosen class, so the class actions sit with the chooser and Remove is no longer next to Rename.

  • Header: the layer, labels on/off, then Class [chooser], a row with New, Rename, Move Up / Move Down (arrow icons) and, at the far end and in red, Remove, then Visible. The Class section below keeps only Field and SQL.
  • No "⋯" menu, unlike the issue's sketch: while trying it, the menu was one more click for every action and didn't fit beside the chooser in a narrow pane. Distance and colour keep Remove apart instead.
  • The arrows are icon buttons named for screen readers ("Move Up", "Move Down"), as the Bookmarks pane's are, and show as off when the class can't move.
  • While a class is renamed, the row and Visible are off. A click on Remove, an arrow or Visible used to end the rename (the box lost focus) and then run the action by the class's old name, which failed with "no label class named …". This also happened before this PR.
  • The labels.class.* commands name "View › Windows › Labeling" as their location, instead of "Style › Label Class": those actions are only in the pane. Command Search, the Script help and the Assistant show the new location.
  • The enabling rules are as before: Default can be renamed or hidden, not moved or removed, and New is off at the class limit.

The header scrolls with the pane for now. Step 3's tabs (Class, Symbol, Position, Range) will keep each part short.

Testing

  • cargo xtask ci passes.
  • The pane's class tests click the new row (classes_are_made_renamed_ordered_and_removed_from_the_pane, new_is_off_at_the_class_limit and the rename tests). a_refused_class_name_keeps_the_box_open now also checks that New, Rename, Move Up, Move Down, Remove and Visible are off while the box is open.
  • Manual, on the desktop app:
    • New, Rename, the arrows and Remove on Default and on added classes.
    • The class limit.
    • Enter, Escape and a refused name while renaming, and clicking the actions while the box is open.
    • Visible on a class.
    • The pane at its minimum width.
    • "Add Label Class" in Command Search.
    • The ribbon's Style › Label Class still following the chosen class.

Related issue

Part of #858

Summary by CodeRabbit

  • New Features
    • The Labeling pane groups class selection and management controls in the header, with the field and SQL tabs in the Class section.
    • Class controls include New, Rename, Move Up, Move Down, Remove, and Visible. Default cannot be moved or removed, and class movement is limited by its order.
    • Label-class commands are now listed under View › Windows › Labeling.
  • Documentation
    • Updated the cartography guide to describe the class controls and the distinction between selecting a class and changing its visibility.

The chosen class's chooser sits at the top of the pane, with New, Rename and the move arrows under it and Remove at the far end of that row, in red. Visible stays under them. The labels.class.* commands name the pane as their location. Refs opengeos#858.
A click on Remove, a move arrow or Visible while the rename box was open renamed the class and then ran the action by its old name, which failed. They are now off until the rename ends. The class actions go back into the header's one function.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6df35497-6b51-4548-a172-5fc254713518
Commits

Reviewing files that changed from the base of the PR and between 8b7bf36 and 69b73c5.

Files selected for processing: 3
  • crates/engine/src/cmd/labels.rs
  • crates/ui-egui/src/labelpane.rs
  • docs/user-guide/cartography.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The Labeling pane now groups class selection, management, and visibility controls in the class header. Rename mode disables those controls. Label-class commands use the “View › Windows › Labeling” category, and the user guide describes the revised layout.

Changes: Labeling pane class header

Layer / File(s) Summary
Class header and controls
crates/ui-egui/src/labelpane.rs, crates/engine/src/cmd/labels.rs, docs/user-guide/cartography.md
The class chooser, management actions, and visibility control are grouped in the header. These controls are disabled during rename. Command categories and user-guide descriptions reflect the updated organization.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related issues

  • opengeos/RustGIS#858 — Proposes a class header in the Labeling pane; this change places the chooser and controls in that header.
  • opengeos/RustGIS#722 — Requests class selection and management controls in the pane; this change groups those controls in the header.
  • opengeos/RustGIS#618 — Defines multi-class labeling; this change adds pane controls for managing classes but does not change engine query behavior.
  • opengeos/RustGIS#732 — Describes class-order priority; this change exposes Move Up and Move Down controls.
  • opengeos/RustGIS#790 — Requests accessible names for input widgets; the move controls now have accessible labels.

Possibly related PRs

  • opengeos/RustGIS#789 — Adds the class-management controls that this change rearranges and disables during rename.

Suggested reviewers: giswqs

Merge Risk: Minimal · up to 69b73

No merge-blocking issue is identified in the supplied changes; merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding a class header to the Labeling pane and separating Remove. It is concise and specific.
Description check Passed The description follows the required Summary, Testing, and Related issue sections. It explains the UI changes, behavior, validation steps, and issue relationship in sufficient detail.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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.

❤️ Share

A rabbit checks the class list glow
New and Rename line up in a row
Move Up and Down keep order clear
While rename waits, the buttons pause here
The Labeling header greets the show

Comment @coderabbitai help to get the list of available commands.

Comment thread crates/engine/src/cmd/labels.rs
Comment thread crates/ui-egui/src/labelpane.rs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Code review

This PR moves the label-class controls into a header at the top of the Labeling pane. It disables them while a class is being renamed, and it changes the Move Up and Move Down buttons to icons. I found no crash, security or wasm problems. I read the diff and checked icon_button and the "up" and "down" icons; I did not build or run the tests.

Bugs

  • None found. The add_enabled_ui(!editing, …) wrapper covers New, Rename, Move Up, Move Down, Remove and Visible, and the new test asserts that all six are disabled during a rename. The rename box sits outside the wrapper, so it stays usable.

Quality

  • Possible duplicate tooltip on Move Up and Move Down (labelpane.rs:257, confidence: medium). icon_button is already given the label as hover text, and .on_hover_text(...) adds a second tooltip on top of it. Keep one.
  • Category change on all six labels.class.* commands (labels.rs:68, confidence: low to medium). They now read "View › Windows › Labeling", but the ribbon still has a "Style › Label Class" group and the docs still mention "Style › Label Class › Class". Confirm this is intended and that no test or doc depends on the old string.

AGENTS.md

  • User-facing strings use tl!, there is no unwrap or panic, and the icons are drawn in code, so there are no asset concerns. The docs were updated to match the new layout. The doc paragraph in cartography.md has an overly long line, which is cosmetic.

Change size

Compared: the whole PR against main (merge base 8b7bf36 to PR head 6cb27f6)

Metric Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 105.1 KB
Size after 106.4 KB
Total size change +1.4 KB
File Before After Change
crates/ui-egui/src/labelpane.rs 63.4 KB 64.6 KB +1.2 KB
docs/user-guide/cartography.md 24.6 KB 24.7 KB +117 B
crates/engine/src/cmd/labels.rs 17.0 KB 17.1 KB +48 B

icon_button already shows its hover text, so the extra on_hover_text stacked a second tooltip under it. Each arrow now has one, naming the move and why the order matters.
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-892/
Web app https://preview.rustgis.app/pr-892/app/
Commit 69b73c5

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 preview label (once per commit).

@jgregoriorincon
jgregoriorincon marked this pull request as ready for review October 25, 2026 13:48
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the full diff and checked the surrounding code. I did not build or run anything. The change is small and clean, and I found no bugs. I have no inline comments to post.

Bugs

  • None found.
    • The disabling of the action row during a rename is sound. It is wrapped in add_enabled_ui(!editing, …), and editing is computed from the same filtered renaming that drives the text box, so a stale rename doesn't lock the row.
    • The up and down icons exist in icons.rs.
    • icon_button returns a click-sensing response. Wrapping it in add_enabled_ui correctly blocks clicks while it is off.

Quality

  • Low confidence (about 30%): the row changed from horizontal_wrapped to horizontal plus a right-to-left layout for Remove. At a very narrow pane width the five controls can no longer wrap and may clip or overflow. The PR says the minimum width was checked by hand, so this is probably fine. There is no automated test for it.
  • Low confidence: the disabled-state check covers the controls inside the add_enabled_ui scope. The chooser and the rename box sit outside it, which is intended.
  • Nit: the two arrow tooltips now differ only in "up" and "down", so the translators get two near-duplicate strings. One shared tooltip would be simpler. This is minor, since the PR notes that translations are handled before each release.
  • Nit: docs/user-guide/cartography.md has one line that is noticeably longer than its neighbours ("end, Remove (Default can be renamed or hidden, …"). Re-wrap it to match.
  • Nit: labels.field in crates/engine/src/cmd/layer.rs:275 still says "Style › Label Class". That is correct, because the ribbon group still exists. Moving only the labels.class.* commands to "View › Windows › Labeling" is consistent, since those actions are now reachable only from the pane.

Security

  • None. The change is UI layout, command location strings and docs.

AGENTS.md

  • Compliant.
    • There is no unwrap or panic, and the new strings use tl!.
    • There are no new assets, since the icons are drawn in code.
    • The layering is unchanged.
    • Updated tests cover the rename-disables-actions behaviour.
    • The hostile_params_never_panic test is unaffected, because only the location strings changed.

Change size

Compared: the whole PR against main (merge base 8b7bf36 to PR head 69b73c5).

Metric Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 105.1 KB
Size after 106.6 KB
Total size change +1.5 KB
File Before After Change
crates/ui-egui/src/labelpane.rs 63.4 KB 64.8 KB +1.4 KB
docs/user-guide/cartography.md 24.6 KB 24.7 KB +117 B
crates/engine/src/cmd/labels.rs 17.0 KB 17.1 KB +48 B

@giswqs
giswqs merged commit fe76ca5 into opengeos:main Oct 25, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants