Add the outline and Note views, splits, popups and the bars

The outline shows the tree as an indented list: a row per node with its
fold marker, tree lines in the parent's color, tags, a ¶ for a body and
+N for what a fold hides. zb shows every body under its title, to read a
document like a page. j/k go row by row, h/l to the parent and the first
child, a click on a marker folds, and titles are edited in their row,
rapid entry included. In move mode, j/k swap the node with its siblings,
h takes it out a level and l puts it under the one above.

The Note view shows one node at full size, as parts: the title, the
tags, the body, each link and each child. j/k step through them, Enter
or i edits the part (or goes to that link or child), and h/l turn the
page to the sibling before or after. Bodies and tags are edited with the
same editor as titles: Enter starts a line in a body, Tab types spaces,
and tags that don't parse come back as they were. cc, C and s now start
typing on an empty line too, as in vim.

Panes split the screen the way vim's windows do (Ctrl-w v s h j k l w c
o =, :split, :vsplit, :only), each in a box with its view and document,
and any pane can show any open document (gt, gT, :b, the documents
picker, a click on the document bar). The status bar has two lines: the
mode, the view, the breadcrumb or a message, the keys typed; then key
hints for what you're doing, which <Space>w hides with which-key.

Popups are a mode of their own, built on one list: ? lists every key and
command, / searches it and Enter runs what you pick; the right-click menu
lists what you can do with a node (with the keys that do the same) or
adds a new idea on the empty canvas; the pickers set a node's color,
border, style or tags. K opens the body in a card beside the node, where
i edits it in place.

The example now opens two documents (the garden, and the kitchen its
portal leads to) and its tests drive all of the above end to end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
skkeyeandClaude Opus 5.5 committed 2026-10-01 19:10:09 -04:00
1 parent 84aefbecdb
commit c587c42115
37 files changed
+5579 -730

No files matched your search

+63 -3
View File
@@ -5,9 +5,14 @@
//!
//! [`Buffer::apply`]: super::buffer::Buffer::apply
use super::panes::Arrange;
use super::popup::{MenuFor, PickKind};
use super::text_edit::StartEdit;
use crate::command::parse::SetArg;
use crate::model::{EditOp, Group, NodeId};
use crate::input::command::Command;
use crate::input::key::Key;
use crate::model::{Direction, EditOp, Group, NodeId};
use crate::view::ViewKind;
/// How a status-bar message is meant.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -78,9 +83,12 @@ pub enum DocAction {
/// What happens around the documents.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AppAction {
/// Start editing the cursor's title.
/// Start editing the cursor's title, tags or body.
StartEdit(StartEdit),
/// Put the text cursor here, in the title being edited (a click).
/// The text edit is done: back to normal mode, or to the `K` card the
/// body was edited in.
EndEdit,
/// Put the text cursor here, in the text being edited (a click).
TextCursor(usize),
/// Move mode: hjkl moves the cursor's branch.
EnterMoveMode,
@@ -89,15 +97,67 @@ pub enum AppAction {
/// Back to normal mode.
LeaveMode,
OpenCommandLine,
/// The command line, with this typed already: a `:` command from the
/// help that needs more.
CommandLineWith(String),
/// A command line, run as if typed (without its `:`).
RunLine(String),
/// A command, run as if its keys were typed: the help and the menu run
/// commands this way.
Run(Command),
/// Keys, as if typed: for a key that waits for more (`m` waits for a
/// mark's letter).
Type(Vec<Key>),
/// Focus mode: Open branches act like Auto ones.
ToggleFocus,
ToggleWhichKey,
/// Change a setting.
Set(SetArg),
// Popups.
/// Every key and command, with this already searched for.
OpenHelp(String),
/// The cursor's body in a card beside it.
OpenCard,
OpenPicker(PickKind),
/// The right-click menu, at a cell on the screen.
OpenMenu {
what: MenuFor,
col: u16,
row: u16,
},
// Panes and documents.
/// Split the focused pane: the new pane shows `view`, or the same view.
Split {
arrange: Arrange,
view: Option<ViewKind>,
},
FocusPane(Direction),
NextPane,
/// Close the focused pane (the last one quits).
ClosePane,
OnlyPane,
EqualizePanes,
/// The focused pane shows another view.
ShowView(ViewKind),
SwitchDocument(DocumentChoice),
Quit,
Say(Message),
}
/// Which document the focused pane switches to.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DocumentChoice {
Next,
Previous,
/// The open document listed at this place (the documents picker).
At(usize),
/// The open document with this name (`:b`).
Named(String),
}
/// Anything views, keys and the command line ask for.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Action {