Repository navigation
Blends, meshes and envelopes: a number given as text is refused - #2851
Merged
bflatastic merged 1 commit intoOct 18, 2026
Merged
Conversation
The blend, envelope and gradient mesh commands read their optional
numbers with f64_or or as_f64, which fall back to a default for a value
that is not a JSON number. object.blend.make {"steps": "8"} made a
Smooth Color blend and reported success. Blend Options did the same
with steps, distance and value. Make with Warp, Reset with Warp and
Envelope Options did the same with bend, h and v (and their long
names). Make with Mesh, Reset with Mesh and Create Gradient Mesh did
the same with rows, cols and columns. Envelope Options did the same
with fidelity, Create Gradient Mesh did the same with highlight, and
Set Mesh Point Color did the same with opacity.
These commands now fail with "`<key>` must be a number, not <value>"
for a value that is not a number or null, as the transform commands
do, and change nothing. Envelope Options refuses the warp keys whether
or not a warp envelope is selected. Create Gradient Mesh refuses an
`at` that is not exactly two numbers with "`at` must be [x, y]".
Before, it took the first two entries of a longer array, and for any
other value it made a mesh with no lines through the point.
Docs: docs/mcp.md, docs/target-app-parity.md.
bflatastic
force-pushed
the
fix/live-commands-refuse-text-numbers
branch
from
October 18, 2026 06:25
e0cff05 to
d8b0ce1
Compare
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 4
✨ Finishing Touches
Comment |
Member
|
Thanks @dotCooCoo, merged. It went through the full gate (fmt, clippy, tests, layers, wasm) in a batch with the other PRs landed today. |
This was referenced Oct 18, 2026
Transform Each, Rasterize, Mosaic, Trim Marks and Rearrange: a number given as text is refused
#2917
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
On
main, the blend, envelope and gradient mesh commands read their optional numbers withf64_ororas_f64, which fall back to a default for a value that is not a JSON number.object.blend.make {"steps": "8"}makes a Smooth Color blend and reports success, andobject.mesh.create {"rows": "3"}makes a mesh of 4 rows.object.blend.makeandobject.blend.options(steps,distance,value),object.envelope.makeWithWarp,resetWithWarpandoptions(bend,h,v,horizontalDistortion,verticalDistortion),object.envelope.makeWithMesh,resetWithMeshandobject.mesh.create(rows,cols,columns),object.envelope.options(fidelity),object.mesh.create(highlight) andobject.mesh.setPointColor(opacity) fail with "<key>must be a number, not " for a value that is not a number or null, as the transform commands do since Transform commands: a string for an optional number is an error (#1952) #1967 (check_numbers,crates/engine/src/cmd/mod.rs:317). The document, the undo history and the options new blends and envelopes start with stay as they were.object.envelope.optionsrefuses the warp keys whether or not a warp envelope is selected.object.mesh.createrefuses anatthat is not exactly two numbers with "atmust be [x, y]", the messagetext.thread.adduses. Before, it took the first two entries of a longer array, and for any other value it made a mesh with no lines through the point.docs/mcp.mdlists the keys, anddocs/target-app-parity.mdhas one line for the change. The 17 catalogs that translate every status and error message, and bg, already have a row for "atmust be [x, y]"; the change adds no catalog rows.How it was tested
New tests in
tests_live(vectorcraft-engine), each failing onmain, where the first call succeeds:blend_make_refuses_a_number_given_as_textgivessteps,distanceandvalueas strings, an array ortrue; no blend is made, andsteps: 8still makes 8 steps.blend_options_refuse_a_number_given_as_text: the selected blend and the options new blends start with keep their spacing.envelope_make_with_warp_refuses_a_number_given_as_textandenvelope_reset_with_warp_refuses_a_number_given_as_textgive each warp key as text, by its short and long name.envelope_make_with_mesh_refuses_a_number_given_as_textandenvelope_reset_with_mesh_refuses_a_number_given_as_textgiverows,colsandcolumnsas text.envelope_options_refuse_a_number_given_as_textgivesfidelityand the warp keys as text, with an envelope selected and with none.mesh_create_refuses_a_number_given_as_textgivesrows,cols,columnsandhighlightas text, and fouratvalues that are not[x, y].mesh_set_point_color_refuses_an_opacity_given_as_textgivesopacityas text with and withoutcolor; the point keeps its color and opacity.Targeted checks while building:
cargo clippy -p vectorcraft-engine --all-targets -- -D warnings;cargo test -p vectorcraft-engine --liband--test command_sweep;cargo fmt --all -- --check;cargo xtask brands,layersandassets.On Windows 11 (x86-64) with rustc 1.99.1, on top of
mainat 299a4b3:mainat 299a4b3 fails two vectorcraft-svg tests on Windows without this branch:a_missing_link_warns_and_keeps_a_placeholder_in_its_box(crates/svg/tests/import_details.rs:106) andimport_never_reads_or_runs_scripts(crates/svg/tests/interactivity.rs:158). SVG import: hrefs that need no folder stay as written, and images in a non-absolute folder are read #2837 fixes both.CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask cipasses its 10 steps: 8,086 tests passed, 0 failed, 12 ignored.cargo test --workspace --no-fail-fastreports 8,081 tests passed, 2 failed (the two tests above) and 12 ignored, and the other nine steps pass.git merge-treereports no conflicts withmainat 299a4b3 or at5e68106, or with #2812 and #2829, which also changecrates/engine/src/cmd/live.rs. #2539 also changeslive.rsand merges with this branch there; its conflicts withmainin five other files are the same with or without this branch.cargo check -p vectorcraft-engine --testspasses on the branch merged with each of the three.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.