Tidy a branch and line nodes up (stage 9a)

The first small part of stage 9 (v1.1). <Space>= then m, c or g (the
user's pick: leader menus), or :tidy map|chart|grid, lays out the
cursor's branch while its top node stays put: a mind map puts each node
in the middle of its children (the user's pick), an org chart puts them
side by side below, and a grid makes a block of cards beside the node
(the user's pick), a card's own branch going along as a mind map. Every
node of the branch gets a place, folded away or not (the user's pick),
as one undo step, and the message says when the branch now covers nodes
outside it.

The lines follow the layouts: a parent whose children are all below it
sends its branches down to a shared bend, and a new child of it goes
beside the last one; a grid card behind another isn't joined by a line,
which would look like it joins the two cards.

In visual mode, <Space>a then h, l, k, j or c lines the selection up on
the box around it, each node bringing its branch along, and : opens the
command line on the selection: :align and :tidy take it, and so do
:color, :border, :style, :tag and :fold, as one undo step. The layouts
are pure functions in view::canvas::arrange, applied as one
EditOp::Reposition. Layout and Side moved from the parser to the model
so keys can name them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
skkeyeandClaude Opus 5.5 committed 2026-10-02 10:42:00 -04:00
1 parent 95c6c3ca37
commit 13a603837e
25 files changed
+709 -65

No files matched your search

+35 -6
View File
@@ -249,6 +249,33 @@ lines.
document by uid (a file moved or renamed by hand), and keeps the path it
finds.
**Tidying and lining up** (settled in part 9a)
- `<Space>=` then `m`, `c` or `g` (the user's pick: leader menus), or
`:tidy [map|chart|grid]`, lays out the cursor's branch: its top node
stays where it is, and every node under it gets a place, folded away or
not (the user's pick: unfolding later shows it tidy too). One undo step.
What's outside the branch stays put, even under it, and the message says
how many nodes the branch covers now.
- A mind map puts each node in the middle of its children (the user's
pick), with their branches stacked to the right. An org chart puts the
children's branches side by side below, each node in the middle above
its own. A grid makes a block of cards beside the node (the user's pick),
filled left to right, about as many columns as rows; a card's own branch
goes along with it, as a mind map.
- The lines follow: a parent whose children are all below it sends its
branches down to a shared bend, and a new child of it goes beside the
last one. In a grid, a card behind another in its row isn't joined by a
line: the bit showing between the two cards would look like it joins
them.
- In visual mode, `<Space>a` then `h`, `l`, `k`, `j` or `c` lines the
selection up: left, right, top or bottom edges, or middles in a column,
on the box around them all. Each brings its branch along (with `V`, each
branch goes by its top). `<Space>=` tidies each selected branch.
- `:` in visual mode opens the command line on the selection (the status
bar keeps counting it): `:align` and `:tidy` take it, and so do `:color`,
`:border`, `:style`, `:tag` and `:fold`, setting every selected node as
one undo step, the way the pickers do.
**Views, panes and popups** (settled in stage 7)
- The Note view is made of parts: the title, the tags, the body, each link
(out, then in) and each child. `j` and `k` step through them, with a bar
@@ -478,7 +505,7 @@ text).
| **Create and edit** | `o` `O` sibling below / above · `a` child · `i` `A` Enter edit the title · `I` edit from its start · `cc` `S` retype |
| **Operators** | `dd` or `dab` delete branch · `dib` delete children · `x` delete just the node · `yy` `yab` `yib` yank · `p` paste as children · `P` paste as siblings below · `>>` `<<` indent / outdent · `"a`–`"z` and `"+` registers · `.` repeat · `u` `Ctrl-r` undo / redo |
| **Modes** | `v` `V` visual · `M` move · `C` connect · `:` command · Esc back to normal |
| **Leader** `<Space>` | `c` color · `s` style · `B` border · `t` tags · `p` new portal (`:portal `) · `i` inbox · `b` documents · `v` then `c`/`o`/`n` for canvas / outline / note · `w` which-key on/off · `?` help |
| **Leader** `<Space>` | `c` color · `s` style · `B` border · `t` tags · `=` tidy (`m` map, `c` chart, `g` grid) · `p` new portal (`:portal `) · `i` inbox · `b` documents · `v` then `c`/`o`/`n` for canvas / outline / note · `w` which-key on/off · `?` help |
| **Panes, documents** | `Ctrl-w v` `Ctrl-w s` split · `Ctrl-w hjkl` focus · `Ctrl-w w` the next pane · `Ctrl-w c` close · `Ctrl-w o` only · `Ctrl-w =` even sizes · `gt` `gT` `]b` `[b` next / previous document · `ZZ` close pane (the last one quits) |
| **Outline** | `j` `k` rows · `h` `l` parent / first child · `zb` every body · `M` then `j` `k` (`J` `K`: 5) swap with siblings, `h` out, `l` under the one above |
| **Note view** | `j` `k` parts · Enter `i` `A` edit the part (`I` from its start, `cc` `S` anew), or go to that link or child · `h` `l` the sibling before / after |
@@ -488,7 +515,7 @@ text).
| **Inside text** | `h j k l w b e 0 ^ $ gg G` (and arrows, Home, End) · `f t F T ; ,` · `d` `c` `y` with any motion and `iw aw i" a" i( a(` · `x X s S D C Y` · `r ~ J p P` · `u Ctrl-r .` · `i a I A` back to typing · `o O` (title: a new sibling; body: a new line) · Esc done |
| **Move mode** | `hjkl` 1 cell · `HJKL` 5 cells · `M` branch ↔ node · Enter or Esc done |
| **Connect mode** | move to the target as usual (or click it) · Enter link · `d` remove (a branch: cut) · `>` attach as child · `<Space>` style menu (`s` named, `a` arrows, `l` line, `c` color, `t` label) · Esc cancel (takes it all back) |
| **Visual** | `d` `x` `y` `>` `<` `M` and `<Space>c` `<Space>s` `<Space>B` `<Space>t` act on the whole selection · `o` swaps ends · `v` `V` switch, or stop · Ctrl+click, Ctrl+drag pick with the mouse |
| **Visual** | `d` `x` `y` `>` `<` `M` and `<Space>c` `<Space>s` `<Space>B` `<Space>t` act on the whole selection · `<Space>a` then `h` `l` `k` `j` `c` line it up · `<Space>=` tidies each branch · `:` a command on the selection · `o` swaps ends · `v` `V` switch, or stop · Ctrl+click, Ctrl+drag pick with the mouse |
## Files
@@ -662,7 +689,7 @@ cumulus/
│ keymap (+ keys.toml), engine (counts, registers, operators), mouse
├─ command/ registry, parse, complete, history
├─ view/ mod.rs (the View trait), canvas/ (camera, boxes, lines, route, scene, render,
│ navigate, placement, view), outline, note; later board
│ navigate, placement, arrange (:tidy, :align), view), outline, note; later board
├─ ui/ text_input (a line of text and its cursor), text_editor/ (vim inside text:
│ motion, object, layout), list (the popup list help, menus and pickers
│ share), card (the K card), status_bar, document_bar, which_key,
@@ -687,8 +714,8 @@ cumulus/
```
The end-to-end tests are in `app/tests.rs` (with `app/tests/files.rs`,
`app/tests/config.rs`, `app/tests/vim.rs`, `app/tests/connect.rs` and
`app/tests/portals.rs`): they copy the sample
`app/tests/config.rs`, `app/tests/vim.rs`, `app/tests/connect.rs`,
`app/tests/portals.rs` and `app/tests/arrange.rs`): they copy the sample
documents to a temporary folder, type keys and click on a test terminal, and
check the screen, the documents and the files.
@@ -770,7 +797,9 @@ it.
Each stage ends with `cargo build`, `cargo lint` and `cargo test` passing, and
one commit. Stage 8, as big as stages 5 to 7 together, comes in four parts
with a commit each, and a pause after each for the user to try it (their
choice).
choice). Stage 9 comes in small parts the same way (their choice too): 9a
`:tidy` and align, 9b branch out, 9c export and import, 9d the search
across documents, 9e the Board.
## Crates and tooling