Repository navigation
feat(layout): the Dynamic Text menus offer a layer's count, sum, mean, least and greatest (#3036) - #3040
Conversation
…least and greatest (opengeos#2853)
…he submenu the Format pane uses (opengeos#3036)
…e ribbon lists layers only with its menu open (opengeos#3036)
…a token reads the first (opengeos#3036)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI found no bugs, security problems or crash paths in the changed code, so I posted no inline comments. I did not compile or run the tests (no shell here). Prior review threads: none, so there were no earlier concerns to leave alone. Bugs: none.
Security: none. The new code only builds menu labels and token strings from project data. Performance (low, not raised): Quality: nothing worth an inline comment. The AGENTS.md (low confidence, about 50%): the PR body says the change reaches the desktop and browser, and that the CLI, Python and Assistant are unchanged. It does not say whether the phone interface ( Twins checked:
Change sizeCompared with the base branch (merge base e185e02 to PR head 22890a5), not the latest push.
|
📖 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 |
Summary
A layout text can show a layer's figure (#2853, #2980), but its token had to be typed by hand. Both Dynamic Text menus of a layout now have a Layer statistic submenu:
It lists each layer of the first map frame's map, with Count and, under each numeric field, Sum, Mean, Least and Greatest. Raster layers, graphics layers and names a token can't hold (
{,}, or a:in a field's name) are not listed. With no map frame or no such layer there is no section, and a map's text graphics don't get it.Both menus draw one function (
textform::stat_menu) over one list (textform::StatLayer::of), so they offer the same entries. A layer under another of the same name, and a field after another of the same name (case aside), are not listed, since a token reads the first one.The change is in the egui interface (desktop and browser) only: no command, project format, CLI, Python or Assistant change. The command line, Python, the Assistant, MCP and plugins already write these tokens with
layout.addElementandlayout.update, so they need nothing new. The phone interface (ui-touch) has no layout text menu, and shortcuts and command search are unaffected, since no command is added. Each pick is onelayout.addElementorlayout.update, so one undo step. The new strings wait for the release translation pass.Testing
a_layer_statistic_is_added_from_its_layers_submenu: the Format pane's submenu adds each token; no layers, no section.the_layers_offered_are_the_first_frames_with_their_numeric_fields: the list, including what is left out (the repeated layer and field names seen failing before their fixes).publish_dynamic_text_adds_a_layer_statistic: the ribbon adds and selects a text with the token; no frame, no section (seen failing before the ribbon change).cargo fmt --all --check,cargo clippy -p rustgis-ui-egui, doctests,cargo xtask layersandschema --check: pass.cargo nextest run(workspace, the local DuckDB tests left out): 9763 of 9764 pass. The one failure,tests::layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines, also fails in the CI ofmain; this PR does not touch the engine.layouts.md).UI evidence
Headless
ui_shot, before (left) and after (right).Publish › Text › Dynamic Text:
Format pane › Insert Dynamic Text:
Related issue
Closes #3036
Summary by CodeRabbit