mirror of
https://github.com/penpot/penpot.git
synced 2026-05-02 14:48:29 +00:00
When working with large asset groups, users asked for a one-click way to remove every asset under a group path. Multi-select across hundreds of items is impractical, and ungrouping first and then deleting leaves the orphaned items in the flat list. This change adds a "Delete group" option to the assets-panel context-menu for three asset types that already carry group structure: - Components (including variants — sibling variants sharing a variant container are deduplicated, and the container is deleted once via the same dispatch the per-item delete uses in file_library.cljs). - Colors. - Typographies. A confirmation modal is shown before deletion, with the count of assets to be removed, so the action is never silent. All deletes run inside a single undo transaction, so one Cmd+Z restores the whole group. Changes ------- - `assets/groups.cljs` — `asset-group-title*` accepts an optional `on-delete-group` prop and conditionally adds the menu entry between "Ungroup" and "Combine as variants". When the callback is not supplied the option is hidden, so asset sections that do not implement it stay unaffected. - `assets/components.cljs` — threads `on-delete-group` through the recursive `components-group*` and defines the section-level handler, dispatching to `dwsh/delete-shapes` for variant containers and `dwl/delete-component` for plain components. - `assets/colors.cljs` — same threading + a simple `dwl/delete-color` dispatch per color in the group. - `assets/typographies.cljs` — same threading + a `dwl/delete-typography` dispatch per typography in the group. - `translations/en.po` — three new strings: the menu label (`workspace.assets.delete-group`) and the modal title/message (`modals.delete-asset-group.title`/`.message`, plural-aware). Github #9141 Signed-off-by: FairyPigDev <luislee3108@gmail.com> Signed-off-by: FairyPiggyDev <luislee3108@gmail.com>