# Inkhaven 1.4.11 — Structural paragraphs & deletion hardening

_Technical and nonfiction chapters aren't pure prose — they're prose interleaved with **code
listings, admonition boxes, math, procedures, and tables**. Inkhaven used to treat all of those as
ordinary paragraphs: same `¶` glyph, same Inner Editor style notes, all counted toward your word
total. STRUCT-2 lets you mark them for what they are — and hardens deletion so removing a chapter is
no longer a leap of faith. **Purely additive**: no new content type, no store change, **no new
dependencies.**_

_Plan: [STRUCT-2_PLAN.md](../PROPOSALS/STRUCT-2_PLAN.md)_

## Part A — Structural paragraph subtypes

Press **`i`** in the Tree pane and pick a subtype:

```
⌨  code listing
⚠  admonition: note / warning / tip / caution
∫  math
≡  procedure
⊞  table
```

You get a `.typ` paragraph with a type-specific tree glyph and the matching **Typst boilerplate
seeded** — a `#figure` code block, a coloured `#block` admonition, a `$ … $` equation, a `+`-step
procedure, or a `#table`.

The marker is a **`para:*` tag**, not a new content type. So a structural paragraph:

- shows its subtype glyph (`⌨ ⚠ ∫ ≡ ⊞`) instead of `¶`;
- is **skipped by the Inner Editor and Inner Socrates** — style and Socratic questions don't apply to
  a code block (procedures are the exception — steps are prose, so they still get feedback);
- is **excluded from the prose word count** — **Book Info** (`Ctrl+B I`) shows prose `paragraphs` and
  `structural` separately, so your word total reflects the writing.

Because it's just a tag, you manage it with the tag picker (**`Ctrl+B ]`**): add `para:table` to an
existing paragraph to make it structural, or remove it to turn it back into prose — the body never
moves, no morph cycle to walk.

## Part B — Deletion hardening

Deleting a chapter or book gained three recovery layers (`d` on a node):

1. **The confirmation shows the word count** — `Delete chapter `Act II` and 12 descendants (15,342
   words)?` — so you know what's at stake (omitted for zero-word deletes).
2. **Branch deletes are recoverable.** A chapter/book delete now stashes **every paragraph leaf**
   into the kill-ring (was single-paragraph only); **`Ctrl+B U`** restores them one at a time, in
   original order, and the status reports each one's word count. **`Ctrl+V Shift+U`** is the picker.
3. **Pre-delete snapshots.** Before a branch delete, inkhaven snapshots every paragraph
   (`pre-delete: <title> · <date>`), taken before the delete fires so it's safe even on partial
   failure — recover any of them from the **`F6`** picker long after the kill-ring has cycled.

Three layers: you see what you'll lose, you get instant undo, and you have a durable safety net.

## Notes

- **Purely additive, self-describing.** Structural type is a `para:*` tag on an ordinary `.typ`
  paragraph — **no new content type, no new `NodeKind`, no `ChildRef`, no DuckDB schema change.**
  A paragraph can be both `content_type: "jinja"` and `para:code` (the jinja gate fires first).
  Single-paragraph delete behaviour is unchanged.
- **No new dependencies.** Built on the existing tag system, the kill-ring, and the annotated-snapshot
  API. New tutorial 94. Tests 1949 → 1952.
