Repository navigation
Release v4.28.0
A toolbar button can reference a State Change slice, carry an emphasis and is validated against the application structure, all in the engine and without React. Builds on the application structure reference (see #97).
Added
ToolbarButton(id,title,slice,emphasis,icon,target),ToolbarandToolbarEmphasis(primary,secondary,quiet) inCratis.Scene.Model.Toolbarand@cratis/scene.model, mirrored inscene-model-shape.json. A spec button is acore:toolbarItemwithkind: Actionplussliceandemphasis.validateToolbarButtons/ToolbarButtonValidation.ValidatewithtoolbarButtonSliceNotFoundandtoolbarButtonSliceNotStateChange(errors) andtoolbarButtonSliceEmpty(warning for a button without a slice).sliceDialogFor/SliceDialogs.ForandresolveToolbarButton/ToolbarButtons.Resolve: a slice-backed button resolves to its command and task dialog - the slice's owndialogTemplate, else the defaultFormDialog- so the dialog is decided once, in Scene.toolbarButtonFromItem/ToolbarButtons.FromItemread a button from acore:toolbarItem's properties, andnormalizeToolbarButtonconverts a hand-authoredkind: Action+targetcommand to the one state change slice that accepts it. A command no single slice accepts stays a legacy button and still validates.SliceNode.commandandSliceNode.dialogTemplate, andApplicationStructureIndex.findSlicesByCommand.- The
core:toolbarItemdescriptor: title,slice(editorslice, kindsStateChange),emphasis(enum chips),iconand the legacytarget. toolbar-slice-fixtures.json(state change ok, state view and automation rejected, missing slice, empty slice warning, dialog template resolution, conversion from atargetcommand, reading buttons from items) asserted by bothEngine.Specs/for_ToolbarButtonValidationandengine/for_validateToolbarButtons.- The toolbar section of
blueprints/application-hierarchy.mddocuments the button, validation, resolution and compatibility.
Legacy kind: Action + target toolbars keep rendering as before.
Part of #102