Repository navigation
fix(layout): refuse a grid, scale bar or north arrow value of the wrong type - #3161
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewReviewed the 6-file diff against Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared with the base branch: the whole PR against main (merge base a50612c to PR head 30dadf2).
|
📖 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 |
|
On the review's two follow-ups: |
Summary
A grid, scale bar or north arrow option given with a value of the wrong type was ignored: the command succeeded and kept the value the element already had, or its default. It is now refused, naming the key and what it takes, with nothing changed.
psandfanswer "not given" for a type they don't read. They are left as they are (many commands rely on that);grid_params,restyleandorientation_ofread these keys strictly instead.step,tickLength,width) go through the existinggiven_num. Names (type,style,format,labelOrientation,units) go through a smallgiven_namebesidegiven_choice, so the messages for an unknown name stay as they were.layout.addElement,layout.updateandlayout.publication, so every surface that runs them (desktop, browser, CLI, Python, the Assistant, tasks). The ribbon and the Format pane already send the right types; undo is unchanged, as a refusal leaves no step.orientation_ofis shared, so a colorbar's or chart'sorientationof the wrong type is refused too.nullmeans not given (a scale bar'sdivisions, which refused it, included), and a number written as text ("5") is still read.Not in this PR: the true/false options (the command already says which it couldn't read) and the options of other elements.
Testing
crates/engine/src/tests/layout_typed_values.rs; the five that expect a refusal and thenullone fordivisionsfailed before their fix.cargo xtask schema --check) passed on the first commit.cargo nextest run -p rustgis-engine -E 'test(layout_typed_values) | test(layout) | test(hostile_params_never_panic)': 194 passed.cargo clippy -p rustgis-engine --all-targets -- -D warningsandcargo fmt --all --check: clean.UI evidence
No visible UI change.
Related issue
Closes #3110
Summary by CodeRabbit