Run cumulus for real: the app core and its files (stage 8a)
The playground becomes app::App, and `cumulus` runs it: the main loop with terminal setup and a panic hook, and the startup rules (./ideas.cum, else ~/ideas.cum, made the first time; files and folders by name; `cumulus new`; --paths). The documents' files: - autosave a second after the latest change (`:set noautosave` for vim-style :w), [+] in the document bar for unsaved changes; quitting saves first; without autosave :q refuses, :q! drops, ZZ saves first; - a file changed outside cumulus is read again as an undo step; with unsaved changes here too, cumulus asks which to keep; a file with a mistake in it holds autosave until it's fixed or :w saves over it; a deleted one waits for :w; nothing is reloaded under an edit; - the day's first save backs the file up to the data folder (30 days); - a document open in another cumulus is read-only ([RO]) until that one lets go: OS file locks in the data folder, so a crash leaves none; - where you left off (cursor, zoom, scroll), the recent documents (now in the documents picker) and the command history, in memory.ron; - :e (alone: read it again; ! drops changes), :new, :bd, :w, :wa, :x, :qa, <Space>i for :in, and :set for every setting. glyphs=ascii now reaches the frames and bars too, not just the canvas and outline. Stage 8 comes in four parts with a commit each (the user's choice); 8b is the settings files. The example is now a playground running the app on copies of the sample documents in a temporary folder, and the end-to-end tests moved to src/app/tests.rs, with tests for the files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e6f3c06ecc
commit
f6dc4564aa
47 files changed
+3985
-1024
No files matched your search
@@ -26,6 +26,22 @@ a folder on your `PATH`.
|
||||
`target/x86_64-unknown-linux-musl/release/cumulus` and runs on any
|
||||
distribution.
|
||||
|
||||
## Starting it
|
||||
|
||||
```sh
|
||||
cumulus # ./ideas.cum, or ~/ideas.cum (made the first time)
|
||||
cumulus garden.cum # that document (a new one if it isn't there yet)
|
||||
cumulus notes/ # that folder's ideas.cum
|
||||
cumulus new "Garden plans" # makes ./garden-plans.cum (cumulus new: ./ideas.cum)
|
||||
cumulus --paths # where cumulus keeps its settings and data
|
||||
```
|
||||
|
||||
Documents are plain text files (`.cum`) that live wherever you like. cumulus
|
||||
saves a second after each change, reloads a file another program changed
|
||||
(`u` undoes that), and keeps a copy of each document a day in its data folder.
|
||||
A document open in another cumulus opens read-only. Each one reopens where you
|
||||
left it.
|
||||
|
||||
## Keys
|
||||
|
||||
The plan for the everyday keys (all of them are in DESIGN.md):
|
||||
@@ -43,10 +59,12 @@ The plan for the everyday keys (all of them are in DESIGN.md):
|
||||
| `+` `-` | zoom in / out |
|
||||
| `K` | the body in a card beside the node (`i` edits it there) |
|
||||
| `C` `M` `v` | connect, move, select |
|
||||
| `<Space>` | the action menu: `c` color, `t` tags, `vo` outline, `vn` note… |
|
||||
| `<Space>` | the action menu: `c` color, `t` tags, `b` documents, `i` inbox, `vo` outline, `vn` note… |
|
||||
| `Ctrl-w v` `Ctrl-w s` | split the pane side by side / stacked (`Ctrl-w hjkl` to move between them) |
|
||||
| `gt` `gT` | the next / previous document |
|
||||
| `:` `?` | command line, help (search it with `/`, Enter runs the key or command) |
|
||||
| `:e` `:new` `:bd` | open a document / make one / close it |
|
||||
| `:w` `:q` `ZZ` | save / close the pane (the last one quits) / save and close |
|
||||
|
||||
After the first key of a sequence (`g`, `z`, `d`, `<Space>`…), a popup lists
|
||||
what can follow. The right mouse button opens a menu of what you can do with
|
||||
@@ -61,10 +79,13 @@ cargo lint # clippy, treating warnings as errors
|
||||
cargo fmt # format the code
|
||||
```
|
||||
|
||||
While the app is being built, the examples try out each part:
|
||||
To try things without touching your own documents:
|
||||
|
||||
```sh
|
||||
cargo run --example canvas # everything so far: the views, splits, popups, editing
|
||||
cargo test show_canvas -- --ignored --nocapture # print it at each zoom, as text
|
||||
cargo test --example canvas # type key sequences into it, and check what they do
|
||||
cargo run --example canvas # cumulus on copies of two sample documents
|
||||
cargo test show_canvas -- --ignored --nocapture # print the sample at each zoom, as text
|
||||
```
|
||||
|
||||
The end-to-end tests (`src/app/tests.rs`) type keys and click on a test
|
||||
terminal, with the sample documents copied to a temporary folder, and check
|
||||
the screen, the documents and the files.
|
||||
Reference in new issue
Block a user