# Inkhaven 1.4.13 — The manuscript Outline

_The side Tree pane is a navigator: narrow, always a keystroke away, good for jumping to a paragraph.
But when you want to **restructure** a book — drag a scene to another chapter, reorder beats, promote
an aside into its own section — a thin sidebar fights you. OUTLINE-1 adds a **full-screen, foldable
Outline** of the whole manuscript with structural editing built in: reorder, promote/demote, and
**cross-parent paragraph copy/move**. Everything has CLI and Bund parity, and every mutation runs on
the same filesystem-aware store primitives the Tree pane uses, so the two stay in lock-step. **No new
runtime crates.**_

_Plan: [OUTLINE-1_PLAN.md](../PROPOSALS/OUTLINE-1_PLAN.md)_

## Open it

Press **`Ctrl+2`** to open the Outline full-screen. If your terminal re-encodes `Ctrl+2` as NUL or
`Ctrl+@` (many do), the reliable backup is **`Ctrl+B Shift+O`**. `Ctrl+T` now focuses the side **Tree**
pane.

The Outline opens with Books and Chapters expanded and everything deeper folded — a structural
overview you drill into. Its view state (folds, cursor, scroll, filter) persists per project to
`.inkhaven/outline-state.json`, so it reopens exactly where you left it. When the window is ≥ 80
columns wide, a **detail panel** on the right shows the cursor node's title, kind, ancestor
breadcrumb, status, word count vs target (or child count for branches), tags, and last-modified date.

## Navigate, fold, restructure

```
j / k   ↓ / ↑          move                 Enter / l / →   expand (or step in)
g / G                  first / last         h / ←           collapse (or step out)
Space                  toggle a fold        / + type        filter
Shift+J / Shift+K      reorder siblings     < / >           promote / demote one level
```

**Reorder** swaps two siblings (renaming their `NN-` filesystem prefixes for you). **Promote** (`<`)
lifts a node up a level — appending it under its grandparent; **demote** (`>`) nests it into the
preceding sibling. These act on childless nodes (paragraphs and leaves); branch restructuring stays in
the Tree pane. A move that would break the hierarchy rules leaves the manuscript untouched and explains
why in the status line.

## Copy and move a paragraph across chapters

A shared clipboard spans the Outline **and** the Tree pane:

```
y   copy the cursor paragraph     m   move (cut) it     f   affix it
```

`f` lands the held paragraph as the **last child of the target's effective parent** — INTO the target
when it's a branch, alongside it when it's a paragraph. **Move** relocates and clears the clipboard;
**copy** duplicates (fresh uuid, prose metadata carried — tags, status, target, links — but **not** any
timeline event, so you never mint a duplicate event) and stays held for repeat pastes. The Outline
footer shows what's held: `[move: harbour-scene]`.

## Filter

Press **`/`** and type. The Outline collapses to the **path-to-match tree** — every node whose title or
slug matches, plus its ancestors, so you see matches in context. Matching is case-insensitive and
**Unicode-aware** (it works in Russian, French, German…). `Enter` applies; `Esc` is **staged** — exit
editing → clear the filter → save the view state and close.

## From the terminal and from Bund

Full parity:

```sh
inkhaven outline [--filter <s>]                 # print the tree as text
inkhaven paragraph copy <src> <dest>            # cross-parent duplicate
inkhaven paragraph move <src> <dest>            # cross-parent relocate
```

`src` / `dest` are the slash-separated slug paths printed by `inkhaven outline`. Bund: `ink.outline.print`
( `-- text` ), `ink.outline.paragraph_copy` ( `src dest -- uuid` ), `ink.outline.paragraph_move`
( `src dest --` ) — the two mutators need the `store_write` category enabled.

## Notes

- **One implementation, four surfaces.** The Outline pane, the Tree-pane clipboard, the CLI, and the
  Bund words all run on the shared `store::{move_node_to_parent, copy_paragraph_to_parent}` primitives
  (and `swap_siblings` for reorder), so however you reach for a move, it behaves identically and stays
  filesystem-correct (directories renamed, `NN-` prefixes reassigned, descendant `file` paths rewritten).
- **Childless-only reparenting, on purpose.** Promote/demote and paragraph move operate on childless
  nodes. A *branch* move would also have to rewrite every descendant's stored `path` depth-key — that's
  the Tree pane's domain and out of scope here.
- **Activation.** `Ctrl+2` (and its `Ctrl+@` / NUL re-encodings) opens the Outline; `Ctrl+B Shift+O` is
  the rebindable backup (`outline.open`). `Ctrl+T` keeps focusing the side Tree pane.
- **No new runtime crates; no new `NodeKind` / `ChildRef` / DB tables.** One additive sidecar
  (`.inkhaven/outline-state.json`, excluded from backup) and two new store methods.
- New tutorial 96. Tests 1996 → 2005.
