shadowdaoandClaude Opus 5.5 11cd967c90 fix(editor): generated columns/cards can be deleted; a refused delete says why
Sitesmith layouts put their cards/columns as Container children of a
ColumnLayout, which the flattener turns into Craft LINKED nodes (col-N).
Craft never deletes a linked node (isDeletable() is false), and
findDeletableTarget returned null for a populated column, so the context
menu, Delete/Backspace, command palette and mobile toolbar all silently did
nothing -- 100% of generated column containers in both captured Sitesmith
responses were undeletable.

- planDelete/runDelete (craft-helpers): one rule set for every delete route.
  A column of a Columns layout is removed by rebuilding the layout (minus the
  column subtree, slots renumbered col-0.., columns decremented, split
  rescaled) in one undo step; the rebuilt layout gets a new id so Craft's
  <Element> remounts. Last column -> the layout goes (as before).
- A Section/BackgroundSection/Form content area is still protected but now
  shows a notice explaining why with a "Delete <Section>" action; ROOT stays
  protected. No delete is a silent no-op any more.
- Sitesmith patch delete_node uses the same path (a card delete no longer
  fails with only a console warning).
- Tests: src/utils/sitesmith-delete.test.ts (real Craft editor + the two
  captured Sitesmith responses), updated core-commands test, and a
  real-browser check: npm run test:browser:sitesmith-delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXjXyosSkunDsdWz3mb
2026-11-08 06:54:00 -08:00
S
Description
Visual drag-and-drop website builder using GrapesJS
6.7 MiB
0 Stars 6 Watchers 0 Forks
Languages
TypeScript 75.9%
JavaScript 12.5%
HTML 8.5%
CSS 2.5%
PHP 0.4%
Other 0.2%