app.executeMenuCommand('Fit Artboard to artwork bounds') threw the
command's error when the active artboard was locked or had no art on
it. The canvas's right-click menu dims Fit to Artwork Bounds then
(DocState::any_art_to_fit), so the script now does nothing and adds
no undo step, as for the other menu items that are not available. The docs state
that an available menu item runs its command and that an error that
command returns throws.
The host-versus-checker name table lists
Application.prototype.executeMenuCommand.
app.executeMenuCommand(name) runs the command of a menu item on the
active document. It takes the names selectall, deselectall, group,
ungroup, makeMask, releaseMask, compoundPath, noCompoundPath and
"Fit Artboard to artwork bounds", which fits the active artboard.
Names are matched exactly. Any other name throws an error that names
it, and a name that is not a string throws a TypeError. A menu item
that is not available, with no document open or nothing selected,
does nothing and adds no undo step.
Docs: docs/mcp.md, docs/target-app-parity.md.
The two Direct Selection preference tests in
crates/ui-egui/src/tests/removeanchors.rs now use
crate::testing::ui_context() and app.canvas_view() to place the click,
as the other canvas tests on main do.
The Import PDF dialog now lives in the craft dialog host, so
an_empty_password_still_asks_for_the_password closes each dialog with
cancel_by_id and checks it with the file's dialog_id helper instead of
app.ui.dialog.
Since the port the manager drew the list, its buttons, the preset's name
and its settings in one column, with the name in body type. The list and
its buttons are now one column and the name and settings a second, as in
production and as Perspective Grid Presets lays out the same sheet. The
name is set in BodyStrong, and "Presets:" and the built-in note are muted
captions.
New test: the settings start right of the list's buttons and level with
the list, and the name's font differs from its list row's.
A framework container may run its body more than once in a pass. The HP-GL pen rows now draw
from the dialog's values on every run and report a typed color, Remove, Add and a swatch press,
which apply once after the rows; the picker opens after them. A picked pen color is no longer
left unread when the table is longer than a plot takes. The classic 3D surface navigator and
Map Art buttons, Bevel Shape, the light's Add and Delete buttons and its color row, Stylistic
Sets, the Adjust Colors channels and the Color Guide Options sliders use Row and Stack the same
way. A Stack's measuring run no longer writes the values the Adjust Colors and Color Guide
Options rows edit.
- New test: with area type selected, the vertical alignment buttons leave
the bar before Opacity, Recolor Artwork and the Style picker, and the
Align buttons after them leave first. It runs with the Character and
Paragraph groups shown and with both turned off, so it covers the
vertical alignment group's rank and the Align strip's rank when only
vertical alignment shows.
- The `rank::TYPE` doc comment now says where the rank sits: type groups
leave after Select Similar, Snapping and the X/Y/W/H fields, and before
every other member.