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