Commands: app and control channel params of the wrong type are refused

view.setZoom, view.screenMode, window.panel, file.revert, file.close,
ui.newSwatch, ui.symbolOptions, ui.batchDialog and file.exportSelection
read a number or switch of the wrong type as its default and went on, so
`view.setZoom {"zoom": "200"}` set 100%. They now refuse it and change
nothing.

The control channel's ui.key, ui.move, ui.wheel, ui.click, ui.drag,
ui.pointer, ui.resize, ui.screenshot, ui.render and ui.set, and the
headless session's key, pointer and render calls, do the same for their
numbers, switches and mods, before any input is queued. Omitting a param
or giving null keeps its default.
This commit is contained in:
dotCooCoo
2026-11-11 18:22:01 -08:00
parent 7f3a046b18
commit a8989aff6d
7 changed files with 317 additions and 57 deletions
+13
View File
@@ -1265,6 +1265,19 @@ fails with no change. A description with a `…` entry takes more keys than it l
object can carry several formats' options). A command that takes its own reply back
(`document.setup`, `text.areaOptions`) says so the same way.
The app's own commands are not checked against their descriptions, but those listed here refuse a value of the wrong
type and change nothing: `view.setZoom` (`zoom`, `center`), `view.screenMode` (`mode`), `window.panel` (`toggle`,
`toggleGroup`), `file.revert` (`confirmed`), `file.close` (`index`), `ui.newSwatch` (`spot`, `global`),
`ui.symbolOptions` (`edit`), `ui.batchDialog` (`set`, `action`) and `file.exportSelection` (`multiple`). So do the
control channel's `ui.key`, `ui.move`, `ui.wheel`, `ui.click`, `ui.drag`, `ui.pointer`, `ui.resize`, `ui.screenshot`,
`ui.render` and `ui.set` for their numbers, switches and `mods`, and the headless session's key, pointer and screenshot
calls. Omitting a param or giving null keeps its default:
```json
{"id": "view.setZoom", "params": {"zoom": "200"}}
→ `zoom` must be a number
```
Saved actions aren't checked this way. When the Actions panel plays an action (Play at any speed, an action's function
key, the Batch dialog or `ui.action.play`), a key a command no longer reads, recorded by an older version, is ignored
and the action still plays. `Session::replay` plays a journal the same way. The command still refuses an effect