gum-tool-delete-logic

Orchestrate Gum UI deletion workflows with confirmation dialogs and undo locks.

597|79|Updated Mar 11, 2015
One-click install
npx skills add https://github.com/vchelaru/Gum --skill gum-tool-delete-logic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gum-tool-delete-logic
Source: https://github.com/vchelaru/Gum/tree/main/.claude/skills/gum-tool-delete-logic
Command: npx skills add https://github.com/vchelaru/Gum --skill gum-tool-delete-logic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a concise reference to prevent incorrect or unsafe deletions in the Gum editor by clarifying which APIs to call, when confirmation and undo locks are required, and how plugin options are surfaced in the delete dialog. It helps developers and integrators avoid direct data-mutation calls from UI code and ensures deletions follow the correct confirmation and mutation paths.

Core Features & Use Cases

  • Two clear delete patterns: AskTo* flows for states and categories with blocking validation, and a shared DeleteSelection flow for screens, components, behaviors, and instances that shows a DeleteOptionsWindow and supports plugin contributions.
  • Responsibility split: IEditCommands handles user-facing dialogs and undo locks while IDeleteLogic performs pure data mutation, enabling safer code organization and testability.
  • Testability & extensibility: Contains a testable seam for dialog message construction and documents plugin extension points such as DeleteObjectPlugin for "Delete XML?" and "Delete children?" options.
  • Use Case: When a user presses Delete on an element tree or chooses Remove > Element, follow EditCommands.DeleteSelection to show the dialog and then let DeleteLogic.Remove* perform the actual removal.

Quick Start

Use this guide to determine whether to call IEditCommands.AskToDeleteState, IEditCommands.DeleteSelection, or the IDeleteLogic.Remove* method for a selected deletion scenario.

Frequently Asked Questions about gum-tool-delete-logic

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely delete Gum UI elements without breaking undo history?

To safely delete Gum UI elements, use IEditCommands to handle user-facing dialogs and apply undo locks, then delegate the actual data mutation to pure IDeleteLogic methods. This separation prevents direct data-mutation calls from UI code and preserves undo integrity.

What is the correct way to handle delete confirmation dialogs for Gum states and categories?

Handling Gum delete confirmation for states and categories requires the AskTo* flow, which performs blocking validation. For screens, components, behaviors, and instances, use the shared DeleteSelection flow that displays a DeleteOptionsWindow to confirm the operation.

How do I add custom delete options to the Gum delete dialog using plugins?

You can add custom delete options to the Gum delete dialog by extending the DeleteObjectPlugin. This plugin extension point allows you to inject specific options into the DeleteOptionsWindow, such as "Delete XML?" or "Delete children?" prompts during the deletion workflow.

Does the Gum editor support a testable seam for delete dialog message content?

Yes, the Gum deletion workflow provides a testable seam specifically for dialog message construction. This design allows you to isolate and test the confirmation message content without triggering the actual UI dialogs or executing the underlying data mutation logic.

When should I use AskToDeleteState versus DeleteSelection in Gum?

Use AskToDeleteState when removing individual states or state categories that require blocking validation. Use DeleteSelection when removing screens, components, behaviors, or instances, as it triggers the DeleteOptionsWindow and supports plugin-contributed options.

Why should UI code avoid calling data mutation methods directly during Gum deletions?

UI code should avoid direct data mutation during Gum deletions to maintain safe confirmation workflows and proper undo locking. Routing through IEditCommands for dialogs and IDeleteLogic for pure mutation ensures correct code organization and testable deletion paths.