Repository navigation
fix(layout): refuse a table or chart layer, field or rows value of the wrong type - #3196
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI read the four changed files, the helpers they call ( Bugs: None found.
Security: None found. Performance: None found. Quality:
AGENTS.md: No breaks found.
Twins checked: Prior reviews: There are no earlier threads on this PR, so no concerns were skipped. Change sizeCompared: the whole PR against main (merge base d9ae54e to PR head b41351c).
|
📖 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
layout.addElementandlayout.updatenow refuse a table's or chart'slayer, a chart'sfieldor a table'srowsgiven with a value of the wrong type, naming the key, with nothing changed. Before, a new table or chart took the first feature layer, the first numeric field or 12 rows, and an update kept what the element had.layerandfieldtake text, read with thegiven_namehelper the other layout names use.frame_layer_nameandchecked_updatecover both commands and their input binding.rowstakes a whole number of 0 or more, read as other layout numbers are, so"5"and5.0now mean 5 (they were ignored). 0 is still held to 1 and a number over 500 to 500; one with a fraction or below 0 is refused.nullstill means not given, and a table still ignoresfield.Surfaces: the two commands are shared, so the refusal reaches scripts, the command line, Python, the Assistant and MCP, plugins, and the desktop, browser and touch builds. The ribbon and the element pane send valid values, so nothing changes there. No option is added, so no tool description changes, and a refused call leaves no undo step.
Testing
New tests in
crates/engine/src/tests/layout_typed_values.rs: wrong values are refused on add and update with the project and undo unchanged;nullis not given, whole numbers (as text too) are taken, 0 and 900 rows are held to the range, and a chart keeps its own messages for an unknown field. Both failed before the fix.cargo fmt, clippy,nextest, doctests, the layer check and the schema check passed.UI evidence
No visible UI change.
Related issue
Closes #3180.
Summary by CodeRabbit