Repository navigation
fix: the raster mask form keeps a draft per map, and layer.mask finds its mask by name and kind - #3371
Conversation
…k by name and kind Follow-up to opengeos#3360 (opengeos#3147), from its review. Each test was written first and failed: - the_raster_mask_form_starts_again_when_the_layers_mask_changes (ui-egui) asserts the same layer id on two maps keeps two drafts: the draft was kept by layer id alone, and layer ids are a map's own. It is now kept by the map's instance_id and the layer id. - layer_mask_finds_the_raster_past_a_polygon_of_that_name (engine): a polygon renamed to a raster's name, above it, made layer.mask refuse with "no raster layer". mask_layer now takes the first layer of that name and kind, as the renderer does, and the planner binds it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewScope: 3 files, +37/−9 lines. Bugs
Security
Performance
Quality
AGENTS.md
Checked and not raised
Change sizeCompared with the base branch (merge base 6ab826a to PR head 30b4042), the whole PR.
|
📖 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 |
…aster of its name (opengeos#3371 review) mask_layer now passes over the target for a raster mask, as the renderer's raster lookup does, and still refuses a raster that is the only one of its name. Test first: layer_mask_takes_another_raster_of_the_layers_own_name (refused with "a layer can't mask itself" before). The form-id test compares two layers on one map instead of a call with itself, which cargo xtask test-hygiene refuses. Follow-up to opengeos#3360 (opengeos#3147). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewOverall: no bugs or security issues found. The core fix matches the renderer, and the earlier review threads are addressed. The findings below are quality points and one PR-description gap. Bugs
Security
Performance
Quality
AGENTS.md
Earlier concernsI left two earlier concerns alone. Both were already raised, answered and resolved: the Not checkedI had no shell, so I did not run the tests or Change sizeCompared with the base branch (
|
Summary
Two small corrections to masking by a raster's values, from the review of #3360.
instance_idand the layer id (raster_mask_form_id).layer.maskfinds its mask layer by name and kind together. It took the first layer of that name and then checked its kind. Names can collide after a rename, so with a polygon layervabove a rasterv,layer.maskwith{"raster": "v", …}was refused with "no raster layer 'v'", though the drawing finds that raster.mask_layernow takes the first layer of that name that is a raster (or, for a polygon mask, a polygon), as the renderer does. For a raster mask it also passes over the layer itself, as the renderer's raster lookup does, so a raster masked by another raster of its own name isn't refused; a raster alone with its name still is. The planner binds the layer found, rather than the first layer of the name.Testing
Each test was written first and failed:
layer_mask_finds_the_raster_past_a_polygon_of_that_name(engine): a polygon layer renamed to the DEM's name, above it; masking by the DEM was refused with "no raster layer 'dem'" and now sets the mask.the_raster_mask_form_starts_again_when_the_layers_mask_changes(ui-egui) now also asserts that the same layer id on two maps has two drafts; both gave the sameIdbefore.layer_mask_takes_another_raster_of_the_layers_own_name(engine, review round 1): the first of two rasters of one name, masked by that name, was refused with "a layer can't mask itself"; it now takes the other.cargo fmt --checkandcargo clippy --all-targets -- -D warningson engine and ui-egui.cargo test(Windows): engine 2918 passed, withlayout_report_text::a_report_measures_each_layout_page_with_its_own_page_numberfailing locally on other branches too (text measurement); ui-egui 1781 lib and 135 integration passed (run withRUSTGIS_LANGUAGE=en, as this machine's locale isn't English).Size: 71 changed lines (+57 −14), after review round 1.
UI evidence
No visible UI change: the form looks and works as before; only where its draft is kept changed.
Related issue
Follow-up to #3360 (#3147).
🤖 Generated with Claude Code
Summary by CodeRabbit