mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
craft-ui-gallery: a story whose dialog is open replays in a settled frame. The dialog's layer is part of the story's run and replays where it ran (f418a2a3f7); the story ran every frame only because the pointer stayed over the card after the click, which no longer runs a settled view while what sensing gives it is unchanged (4fe31f5dc3). The trial asserts the dialog stays painted, the card keeps the story in place of its opener, and the story does not run. craft-layers: a blend-mode edit is a new version of the panel's view, so the header measures its content afresh (7f4311f96f) and the blend rows run in that measuring run and once in the real run, all in one pass. The trial asserts one pass and one real run of the blend rows.
craft-layers
The Layers panel for Craft apps. The app implements LayerTree, a read-only view of its layers; LayersPanel shows it and reports what the user did as events in the order they happened. The app applies them with its own commands and undo.
Module (craft_layers::ui::…) |
What it gives the app |
|---|---|
tree |
LayerTree, the one trait an app implements: children and parent, one LayerInfo per row (name, kind, visibility, label colour, locks, clipping, link, blend label, masks, effects, smart object source, warning), the selection and target, sub-rows, the active layer's properties, the blend modes (Entry<String> lists), the footer's state and the drop rules. |
panel |
LayersPanel: the filter bar, the blend and opacity row, the lock and fill row, the rows, the footer; one focus stop, keyboard, rename in place (double-click on the name, F2 or start_rename), drag and drop, AccessKit. LayersEvents out; panel_menu and run_command for the panel menu; LayersPanel::style(&UiTokens) gives the look. |
rows |
BlendRows: Blend mode, Opacity, Lock and Fill as one block, usable alone (a Properties panel). |
comps |
LayerCompsPanel over the app's comp rows, reporting LayerCompsEvents. |
filter |
LayerFilter and LayerFilterBar: filter by kind, name, effect, blend mode, attribute, label colour, smart object, artboard or group; the matching rule is plain code, and LayerTree::listed lets the app answer what only it knows (missing linked files, empty layers). |
options |
LayersSettings (the persisted section), LayersOptions and LayersOptionsDialog (Layers Panel Options: thumbnail size and contents, the five switches). |
thumbs |
LayerThumb, LayerThumbKind, ThumbContents: the key the panel gives craft_ui::primitives::textures::Thumbnails for each thumbnail of a row; the app implements ThumbSource for it. |
Its words are the words! structs of the parts: LayersPanelWords, BlendRowsWords, LayerCompsWords, LayerFilterWords and LayersOptionsWords.
The crate is UI-only: egui and craft-ui are plain dependencies, and screen-testing is its only feature.