Skip to content

feat(ui): a fixed Labeling tab for every label control on the ribbon - #935

Merged
giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/labeling-tab
Oct 26, 2026
Merged

giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/labeling-tab

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #897, as agreed in #862. Label controls were split across Style and View, and Style scrolled on a laptop-sized window. A fixed Labeling tab now sits right after Style, always shown like Style and Data.

Purpose: how the map is labelled: what gets a label, with which text, where, and at which scales, plus the label settings for the whole map.

Groups, in the Labeling pane's tab order:

  1. Labels: Label (on/off) · Properties (opens the Labeling pane)
  2. Label Class: Class · Field
  3. Text Symbol: Size · Color · Bold · Halo
  4. Label Placement: Placement
  5. Label Range: Out Beyond / In Beyond · Closest / Farthest · Clear Limits
  6. Map Labeling: Lock · Pause · View Unplaced · Convert

Groups 1–5 are for the feature layer selected in Layers. With a raster or no layer, the tab shows a hint in their place. Map Labeling shows whatever is selected, as its settings apply to the whole map.

What moved, and where it remains reachable

  • Style loses its five label groups: they are on Labeling, in the same form.
  • View loses its Labeling group, and with it the duplicate Label button: Lock, Pause, View Unplaced and Convert are under Labeling › Map Labeling, and Label under Labeling › Labels. View › Windows › Labeling and the layer's right-click menu still open the pane, and Convert To Annotation stays in the layer's menu.
  • Command ids and parameters are unchanged, so the CLI, scripts and shortcuts keep working.
  • Command Search locations: the label commands move from Style › Label … / View › Labeling to Labeling › … (Labels, Label Class, Text Symbol, Label Placement, Label Range, Map Labeling). Command Search, the Script help and Show me read these. labels.fonts moves to View › Windows › Labeling, since the font is picked in the pane only.
  • current_tab now opens the new tab for the old name "Labeling" (it mapped to Style), so saved pane sets and scripts naming it land there.

Workflows checked (laptop width, a feature layer selected)

Task Before After
Turn labels on and change their size Style tab, Label, then scroll the ribbon to Text Symbol › Size Labeling tab, Label, Size (no scroll)
Turn labels on, then show the unplaced ones Style tab, Label; View tab, View Unplaced (2 tab switches) Labeling tab, Label, View Unplaced (1)
Pause labels while navigating View tab, Pause Labeling tab, Pause

Docs: the ribbon table in the user guide, the labelling page, the tab-purpose table in docs/contributing.md (Labeling is no longer "planned"), and the tab lists in the comparison pages.

Testing

  • cargo xtask ci: passed.
  • New the_labeling_tab_holds_the_label_groups:
    • a feature layer shows its groups and Map Labeling;
    • with no layer, the hint and Map Labeling show;
    • Style and View have no label groups left.
  • Updated:
    • the ribbon label-size drag test runs on the Labeling tab;
    • the distance-units test picks Closest there;
    • the all-tabs render test includes Labeling;
    • the old-tab-name test checks that "Labeling" opens Labeling;
    • the Script help location test.
  • Manual checks:
    • the tab with a feature layer, a raster and no layer;
    • Style and View without label groups;
    • Command Search locations;
    • Show me for a labels.placement step;
    • the tabs at 1366 px (screenshots below).
image image

Related issue

Closes #897.

Summary by CodeRabbit

  • New Features

    • Added a dedicated Labeling tab for map-wide label settings and selected feature-layer controls.
    • Style retains feature and raster styling, while label controls are available in the new tab.
  • Documentation

    • Updated the user guide and interface descriptions to reflect the Labeling tab and the locations of labeling controls.

After Style, the Labeling tab has the selected feature layer's label groups in the Labeling pane's tab order (Labels, Label Class, Text Symbol, Label Placement, Label Range), or a hint without one, then Map Labeling (Lock, Pause, View Unplaced, Convert), which needs no layer. Style and View lose their label groups, the label commands' locations move to Labeling, and current_tab opens the new tab for the old name. Closes opengeos#897.
@coderabbitai

coderabbitai Bot commented Oct 26, 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: 0ad98f78-5da7-4b36-bd08-caaef784b025
Commits

Reviewing files that changed from the base of the PR and between 259287c and 63dc37c.

Files selected for processing: 14
  • crates/engine/src/cmd/labels.rs
  • crates/engine/src/cmd/layer.rs
  • crates/engine/src/tests.rs
  • crates/map/src/symbology.rs
  • crates/ui-egui/src/lib.rs
  • crates/ui-egui/src/ribbon.rs
  • crates/ui-egui/src/scriptcomplete.rs
  • crates/ui-egui/tests/measurement_units.rs
  • crates/ui-egui/tests/smoke.rs
  • docs/comparison/geolibre.md
  • docs/comparison/qgis.md
  • docs/contributing.md
  • docs/user-guide/cartography.md
  • docs/user-guide/index.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 ribbon adds a fixed Labeling tab between Style and Edit. Label controls move from Style and View to Labeling, and command categories and documentation reflect the updated locations.

Changes: Labeling tab and controls

Layer / File(s) Summary
Add the Labeling tab and relocate controls
crates/ui-egui/src/ribbon.rs, crates/ui-egui/src/lib.rs, crates/ui-egui/tests/*, crates/ui-egui/src/tests.rs, docs/comparison/*, docs/contributing.md, docs/user-guide/index.md
The ribbon adds and dispatches the Labeling tab. Feature-layer label controls appear there when applicable, alongside map-wide controls. Style and View no longer show the relocated label controls. Tests and ribbon documentation reflect the tab and its behavior.

Command locations

Layer / File(s) Summary
Update command locations
crates/engine/src/cmd/labels.rs, crates/engine/src/cmd/layer.rs, crates/engine/src/tests.rs, crates/map/src/symbology.rs, crates/ui-egui/src/scriptcomplete.rs, docs/user-guide/cartography.md
Label command categories and documented paths now point to Labeling. The fonts command is categorized under View › Windows › Labeling. Command handlers and parameters remain unchanged.

Priority: Normal

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

Change: Feature

Possibly related issues

Suggested reviewers: giswqs, deniial00

Merge Risk: Minimal · up to 63dc3

The Labeling tab’s documented Convert route remains available. No issue identified here requires resolution before merging.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Warning Issue #897 requirements checked against the whole-PR diff (merge base to head):

- Fixed Labeling tab after Style, always shown: PASS. TABS adds "Labeling" at index 3, directly after "Style". The ta…
In label_groups (crates/ui-egui/src/ribbon.rs), place the Label Class group before the Text Symbol group. The Labeling tab must read: Labels, Label Class, Text Symbol, Label Placement, Label Range, Map Labeling, as #897 specifies. Confirm…
Docstring Coverage Inconclusive Docstring coverage is 65.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 8 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding a fixed Labeling tab for ribbon label controls. It is concise and specific.
Description check Passed The description includes complete Summary, Testing, and Related issue sections. It explains the changes, validation, manual checks, and linked issue.
Out of Scope Changes check Passed Every changed file serves the #897 objectives:

- ribbon.rs: adds the tab, moves the label groups, adds labeling_tab, layer_hint, map_labeling_group, the test helper tab_harness, and the new…
Full details: Out of Scope Changes check

Explanation

Every changed file serves the #897 objectives:

  • ribbon.rs: adds the tab, moves the label groups, adds labeling_tab, layer_hint, map_labeling_group, the test helper tab_harness, and the new test. The label-size drag test now targets the Labeling tab.
  • labels.rs, layer.rs: change command menu paths only. Handlers and parameters are unchanged.
  • symbology.rs, tests.rs, scriptcomplete.rs, measurement_units.rs, smoke.rs: update location text or tab names that the move changes.
  • ui-egui/src/lib.rs, docs/comparison/*.md, docs/contributing.md, docs/user-guide/*.md: update the tab lists and docs the issue names. The docs/contributing.md change removes the "planned" marker for Labeling.

The move of labels.fonts to View › Windows › Labeling matches #897. The font stays in the pane only, and that route opens the pane. No change was found that lacks a connection to the issue.

Full details: Linked Issues check

Explanation

Issue #897 requirements checked against the whole-PR diff (merge base to head):

  • Fixed Labeling tab after Style, always shown: PASS. TABS adds "Labeling" at index 3, directly after "Style". The tab is not contextual. labeling_tab is dispatched in show.
  • Feature-layer groups, hint otherwise: PASS. labeling_tab calls label_groups for a feature layer. For a raster or no layer it calls layer_hint.
  • Map-wide settings with no layer: PASS. map_labeling_group runs on every path, so Lock, Pause, View Unplaced and Convert show without a layer.
  • Style loses its five label groups: PASS. style_tab no longer calls label_groups.
  • View loses its Labeling group and duplicate Label button: PASS. labeling_group is removed from view_tab.
  • current_tab maps "Labeling" to the new tab: PASS. The mapping to "Style" is removed.
  • Command ids unchanged, locations moved to Labeling: PASS by the summaries of labels.rs and layer.rs. Only menu paths changed. The script help location in scriptcomplete.rs is updated.
  • Documentation of the ribbon and labelling pages: PASS. docs/user-guide/index.md and docs/user-guide/cartography.md are updated.
  • Automated test: PASS. the_labeling_tab_holds_the_label_groups covers a feature layer, no layer, and the absence of label groups from Style and View.
  • Group order: FAIL. #897 requires the groups in the order of the Labeling pane's topic tabs (Class, Symbol, Position, Range). The objectives state "in the specified order". In the diff, the Label Range and Label Placement blocks move after Label Class, so Label Class now precedes Label Placement and Label Range. Text Symbol is in the unchanged part of label_groups before the moved blocks, and no Text Symbol code follows Label Class in either revision. The head order is therefore Labels, Text Symbol, Label Class, Label Placement, Label Range. The PR description states the order Labels, Label Class, Text Symbol, Label Placement, Label Range. I did not read the unchanged body of label_groups in full, so this order result rests on the diff hunks and the base structure.

Label on/off and Properties in the Labels group are not changed by the diff. I did not confirm their content directly.

Resolution

In label_groups (crates/ui-egui/src/ribbon.rs), place the Label Class group before the Text Symbol group. The Labeling tab must read: Labels, Label Class, Text Symbol, Label Placement, Label Range, Map Labeling, as #897 specifies. Confirm the order in the rendered tab, and update the PR description if the final order differs.

Full details: Docstring Coverage

Explanation

Docstring coverage is 65.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 8 files. (6 skipped: 5 unsupported, 1 too large.)

Resolution

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

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 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 taps the Labeling tab,
Where map-wide settings sit.
Layer controls have found their place,
And paths now point to it.
The rabbit hops, the labels stay.

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

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the full diff and the surrounding source in ribbon.rs, the tab handling, labels.rs, the tl! macro and the i18n catalogs. I didn't build or run tests. I found no bugs or security issues, only two minor quality nits. I didn't post inline comments because neither nit has a suggestion worth committing.

Bugs

Nothing found (high confidence). What I checked:

  • Tab mapping: current_tab no longer maps "Labeling" to Style. TABS and the render match both gain the new tab.
  • Hidden tabs: current_hidden_tabs filters on TABS, so a saved hidden-tabs list still works. Labeling isn't in FIXED_TABS, so users can hide it. The PR text says it is "always shown like Style and Data", and Style and Data can be hidden the same way.
  • Removed ribbon group: labeling_group is removed and its call in view_tab is gone. The Label button now lives only in label_groups (the "Labels" group), so nothing is lost.
  • Command locations: all moved labels.* command locations are consistent. The updated test in scriptcomplete.rs and the doc references match.
  • Group order: label_groups now ends with Placement and Range, matching the order in the docs and PR description.

Security

Nothing found. The change is UI layout, location strings and docs. There is no new input handling, no unwrap or panic, and no new dependency.

Performance

Nothing found.

Quality

  • Low confidence, minor: layer_hint(ui, text: &str) calls tl!(text) with a variable. That works at runtime. If tooling or a reviewer greps for tl!("literal") to find translatable strings, the three hint strings (Select a layer in Layers to style it., Labels are drawn for feature layers, not rasters., Select a feature layer in Layers to label it.) won't be found. I found no scanner in xtask or the i18n tests, and de.tsv already has the first string, so this is a style point only. Passing impl Into<String> or translating at the call site would keep the literals inside tl!.
  • Nit: the hint text for a raster layer, "Labels are drawn for feature layers, not rasters.", duplicates a string already in labelpane.rs:38. Reusing the same string is good, since it keeps the translation shared.
  • Nit: the new test covers the Labeling, Style and View tabs. It doesn't cover a raster layer on the Labeling tab (the raster hint branch), which the PR description says was checked manually.

AGENTS.md

  • Command ids and parameters: unchanged, so the CLI and scripts keep working.
  • Ribbon guidelines and docs: docs/contributing.md is updated, the "planned" note is removed, and the user guide and comparison pages are updated.
  • Layering and wasm: no new dependencies and no layering impact. labels.fonts is only relocated as a location string.
  • Translations: new strings use tl! and the ribbon widgets translate their labels, so no catalog edits are required.
  • Screenshots: the PR body has a placeholder comment (<!-- screenshots … -->) instead of images. AGENTS.md asks for a look at the PNG for UI work, and ribbon changes should show it.

Change size

Compared: the whole PR against main (merge base c0826b1 to PR head 63dc37c).

Metric Value
Files changed 14 (added 0, modified 14, removed 0, renamed 0)
Size before 2.05 MB (2,145,627 B)
Size after 2.05 MB (2,147,974 B)
Total size change +2.3 KB (+2,347 B)
File Before After Change
crates/ui-egui/src/ribbon.rs 212.0 KB 214.0 KB +2.0 KB
docs/user-guide/index.md 16.0 KB 16.2 KB +198 B
crates/ui-egui/tests/smoke.rs 152.8 KB 152.9 KB +93 B
docs/contributing.md 10.8 KB 10.7 KB -86 B
crates/engine/src/cmd/labels.rs 17.1 KB 17.1 KB +57 B
crates/ui-egui/src/lib.rs 195.7 KB 195.7 KB +10 B
docs/comparison/geolibre.md 13.7 KB 13.7 KB +10 B
docs/comparison/qgis.md 15.3 KB 15.3 KB +10 B
docs/user-guide/cartography.md 27.9 KB 27.9 KB +10 B
crates/engine/src/cmd/layer.rs 140.1 KB 140.1 KB +9 B
crates/engine/src/tests.rs 1.0 MB 1.0 MB +3 B
crates/map/src/symbology.rs 114.2 KB 114.2 KB +3 B
crates/ui-egui/src/scriptcomplete.rs 155.3 KB 155.3 KB +3 B
crates/ui-egui/tests/measurement_units.rs 16.7 KB 16.7 KB +3 B

@jgregoriorincon
jgregoriorincon marked this pull request as ready for review October 26, 2026 11:00
@github-actions

Copy link
Copy Markdown
Contributor

I'm finishing the review. My one inline comment failed because the line isn't in the diff, so I'm putting the findings in the summary.

Code review

I read the whole diff and some surrounding source. The change adds a fixed Labeling ribbon tab. It moves the label groups out of Style and View, adds the "Map Labeling" group, and updates command locations, docs and tests. The logic looks correct and I found no blocking problems.

Bugs

  • None found. The old tab name "Labeling" is no longer remapped to Style in current_tab, so it now opens the new tab. The smoke test covers that. The Labeling tab shows the map-wide group even with no layer selected, and its tests cover that too. (high confidence)

Security

  • Nothing to raise. The change is UI layout and metadata, with no new input handling.

Performance

  • Nothing to raise.

Quality

  • Stale doc comment (crates/ui-egui/src/ribbon.rs:2285). The doc comment on style_tab still says "its symbology, labels and effects", but labels moved to the Labeling tab. Suggested wording: "its symbology and effects". (high confidence, nit)
  • tl! on a non-literal (layer_hint, ribbon.rs). tl!(text) is called on a variable, so the two new hints are never wrapped in tl!("…") where they are written. The hints are "Labels are drawn for feature layers, not rasters." and "Select a feature layer in Layers to label it." If the translation tooling finds strings by scanning for tl!("…") literals, these two, and the existing "Select a layer in Layers to style it.", would be missed. Check docs/i18n.md. (low confidence)
  • labels.fonts location. It is now filed under "View › Windows › Labeling", which points at the pane. It also keeps its .view() flag. That is consistent, but make sure Show Me and command search resolve that location string. (low confidence)

AGENTS.md

  • No violations. There is no unwrap/panic in non-test code, and the new group labels go through the ribbon widgets, which translate them. docs/contributing.md and the user guide are updated. The new tab has a test, the_labeling_tab_holds_the_label_groups.
  • I couldn't run cargo xtask ci, so formatting and clippy are unchecked.

Change size

Compared: the whole PR against main (merge base c0826b1 to PR head 63dc37c)

Metric Value
Files changed 14 (0 added, 14 modified, 0 removed, 0 renamed)
Size before 2.05 MB (2,145,627 B)
Size after 2.05 MB (2,147,974 B)
Total size change +2.3 KB
File Before After Change
crates/ui-egui/src/ribbon.rs 212.0 KB 214.0 KB +2.0 KB
docs/user-guide/index.md 16.0 KB 16.2 KB +198 B
crates/ui-egui/tests/smoke.rs 152.8 KB 152.9 KB +93 B
docs/contributing.md 10.8 KB 10.7 KB -86 B
crates/engine/src/cmd/labels.rs 17.1 KB 17.1 KB +57 B
crates/ui-egui/src/lib.rs 195.7 KB 195.7 KB +10 B
docs/comparison/geolibre.md 13.7 KB 13.7 KB +10 B
docs/comparison/qgis.md 15.3 KB 15.3 KB +10 B
docs/user-guide/cartography.md 27.9 KB 27.9 KB +10 B
crates/engine/src/cmd/layer.rs 140.1 KB 140.1 KB +9 B
crates/engine/src/tests.rs 1007.8 KB 1007.8 KB +3 B
crates/map/src/symbology.rs 114.2 KB 114.2 KB +3 B
crates/ui-egui/src/scriptcomplete.rs 155.3 KB 155.3 KB +3 B
crates/ui-egui/tests/measurement_units.rs 16.7 KB 16.7 KB +3 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-935/
Web app https://preview.rustgis.app/pr-935/app/
Commit 63dc37c

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).

@giswqs

giswqs commented Oct 26, 2026

Copy link
Copy Markdown
Member

@jgregoriorincon Looks great! Thank you.

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.

[Feature]: A fixed Labeling ribbon tab for every label control on the ribbon

2 participants