Skip to content

Release v4.28.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 04:52
cd3a45e

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), Toolbar and ToolbarEmphasis (primary, secondary, quiet) in Cratis.Scene.Model.Toolbar and @cratis/scene.model, mirrored in scene-model-shape.json. A spec button is a core:toolbarItem with kind: Action plus slice and emphasis.
  • validateToolbarButtons / ToolbarButtonValidation.Validate with toolbarButtonSliceNotFound and toolbarButtonSliceNotStateChange (errors) and toolbarButtonSliceEmpty (warning for a button without a slice).
  • sliceDialogFor / SliceDialogs.For and resolveToolbarButton / ToolbarButtons.Resolve: a slice-backed button resolves to its command and task dialog - the slice's own dialogTemplate, else the default FormDialog - so the dialog is decided once, in Scene.
  • toolbarButtonFromItem / ToolbarButtons.FromItem read a button from a core:toolbarItem's properties, and normalizeToolbarButton converts a hand-authored kind: Action + target command to the one state change slice that accepts it. A command no single slice accepts stays a legacy button and still validates.
  • SliceNode.command and SliceNode.dialogTemplate, and ApplicationStructureIndex.findSlicesByCommand.
  • The core:toolbarItem descriptor: title, slice (editor slice, kinds StateChange), emphasis (enum chips), icon and the legacy target.
  • toolbar-slice-fixtures.json (state change ok, state view and automation rejected, missing slice, empty slice warning, dialog template resolution, conversion from a target command, reading buttons from items) asserted by both Engine.Specs/for_ToolbarButtonValidation and engine/for_validateToolbarButtons.
  • The toolbar section of blueprints/application-hierarchy.md documents the button, validation, resolution and compatibility.

Legacy kind: Action + target toolbars keep rendering as before.

Part of #102