plan: b, t and C open their own view alone or beside what is there, q closes one view

S still puts the board, the agenda and the calendar on the plan screen.
From the documents, b, t or C opens the plan with only that view; on the
plan they add the view beside the others, or focus it if it is there.
q and Esc close the focused view the way they close a document's tile,
back along the trail, and only closing the last view leaves the plan.
This commit is contained in:
nvrl committed 2026-10-23 00:48:50 +02:00
1 parent 4542b9692e
commit c6c5e9e144
9 files changed
+62 -52

No files matched your search

+6 -5
View File
@@ -156,9 +156,9 @@ it; in the document pane it is that document. In the browse pane:
| `m` / `p` | pick nodes up — `m` again puts one back, `M` takes the whole folder — then drop them all into the folder you walk to | | `m` / `p` | pick nodes up — `m` again puts one back, `M` takes the whole folder — then drop them all into the folder you walk to |
| `za` | fold a document's own files open under it in the list, or away again | | `za` | fold a document's own files open under it in the list, or away again |
| `Ctrl`/`Shift`-click | pick a row up / every row from the cursor to it; drag picked-up rows onto a folder, a crumb or a space | | `Ctrl`/`Shift`-click | pick a row up / every row from the cursor to it; drag picked-up rows onto a folder, a crumb or a space |
| `S` | the plan screen — the board, the agenda and the calendar, in place of the documents and the list — or back to the documents as they were left | | `S` | the plan screen with every view on it — the board, the agenda and the calendar, in place of the documents and the list — or back to the documents as they were left |
| `b` | the board of this space, on the plan screen; a digit there shows another space's | | `b` | the board of this space, alone on the plan screen or beside what is on it; a digit there shows another space's |
| `t` | the agenda: what is late, due this week, or in hand, on every board, on the plan screen | | `t` | the agenda: what is late, due this week, or in hand, on every board, alone on the plan screen or beside what is on it |
| `T` | today's diary entry, started if there is none | | `T` | today's diary entry, started if there is none |
| `C` | the diary by month (`:cal`) — see [The diary](#the-diary) | | `C` | the diary by month (`:cal`) — see [The diary](#the-diary) |
| `[d` / `]d` | the diary entry before / after the one open, by date | | `[d` / `]d` | the diary entry before / after the one open, by date |
@@ -291,8 +291,9 @@ start as `sftp_host_key` in the data directory.
## Boards ## Boards
`b`, the board door on the rail, or `:board` shows the board of the space `b`, the board door on the rail, or `:board` shows the board of the space
being browsed on the plan screen, beside the agenda and the calendar, and `q` being browsed on the plan screen — alone, or beside the views already there —
or `Esc` goes back to the documents. Every space has one except the and `q` or `Esc` closes it again; closing the last view goes back to the
documents. Every space has one except the
diary — a journal has no backlog — and `:set board` / `:set noboard` changes diary — a journal has no backlog — and `:set board` / `:set noboard` changes
that for the space you are in (the dimmed board door on the rail does the that for the space you are in (the dimmed board door on the rail does the
same). A new board starts with `backlog`, `doing` and `done`, and the columns mean same). A new board starts with `backlog`, `doing` and `done`, and the columns mean
+12 -9
View File
@@ -4,22 +4,25 @@
The board, the agenda, the [calendar](Diary.md#the-calendar) and the back of The board, the agenda, the [calendar](Diary.md#the-calendar) and the back of
a card are views, and they have a screen of their own: the plan. `S` (or a card are views, and they have a screen of their own: the plan. `S` (or
`:plan`) goes there — the board on the left, the agenda over the calendar on `:plan`) goes there with all three on it — the board on the left, the agenda
the right, and no list — and back to the documents, which wait behind it as over the calendar on the right, and no list — and back to the documents, which
they were left. The views are tiles like the documents', walked the same way. wait behind it as they were left. `b`, `t` and `C` go there with their own view
alone, and on the plan they add it beside what is there. The views are tiles
like the documents', walked the same way, and `q` closes one as it closes a
document; closing the last goes back to the documents.
![The board, the agenda and the calendar](../images/board.png) ![The board, the agenda and the calendar](../images/board.png)
| key | what it does | | key | what it does |
| --- | --- | | --- | --- |
| `S` | to the plan screen, or back to the documents | | `S` | to the plan screen with every view on it, or back to the documents |
| `b`, `t`, `C` | to the board, the agenda or the calendar, on the plan screen | | `b`, `t`, `C` | the board, the agenda or the calendar: alone on the plan screen, or beside what is on it |
| `gt` / `gT` | the next / previous tile | | `gt` / `gT` | the next / previous tile |
| `Ctrl-h` / `Ctrl-j` / `Ctrl-k` / `Ctrl-l` | the tile that way | | `Ctrl-h` / `Ctrl-j` / `Ctrl-k` / `Ctrl-l` | the tile that way |
| `l` past the last list, `h` in the agenda, `j` past its end | on into the tile beside | | `l` past the last list, `h` in the agenda, `j` past its end | on into the tile beside |
| `f` | the focused tile fills the screen; again or `Esc` to leave | | `f` | the focused tile fills the screen; again or `Esc` to leave |
| `1` … `9` | switch space; the plan stays, and the board shows that space's | | `1` … `9` | switch space; the plan stays, and the board shows that space's |
| `q`, `Esc` | from a card's back to the board; from the board, the agenda or the calendar back to the documents | | `q`, `Esc` | close the focused view — a card's back goes back to the board; the last view back to the documents |
The keys go to the tile with focus, which wears the light border and its key The keys go to the tile with focus, which wears the light border and its key
lit in its head; the other views keep their cursors, dimmed. What is opened lit in its head; the other views keep their cursors, dimmed. What is opened
@@ -28,14 +31,14 @@ is a document, so it opens on the documents' screen, beside what is there, and
`S` comes back to the plan. Each view is read again whenever it is gone to. `S` comes back to the plan. Each view is read again whenever it is gone to.
The plan is the same in every space, the way the desktop's special workspace The plan is the same in every space, the way the desktop's special workspace
stays up: a digit on the board shows that space's board, with the agenda still stays up: a digit on the board shows that space's board, with whatever was
beside it. Each space keeps its own documents behind it, and they are there beside it still there. Each space keeps its own documents behind it, and they are there
again on going back. again on going back.
## The board ## The board
Every space except the diary has a board. `b`, the board button on the rail, or Every space except the diary has a board. `b`, the board button on the rail, or
`:board` shows it on the plan screen, and `q` or `Esc` goes back to the documents. `:board` shows it on the plan screen, and `q` or `Esc` closes it again.
It is the board of the space being browsed, or, in a space without one such as It is the board of the space being browsed, or, in a space without one such as
the diary, the last board shown. The head of the board names every space that the diary, the last board shown. The head of the board names every space that
has one, with the digit that goes there. has one, with the digit that goes there.
+8 -8
View File
@@ -43,13 +43,13 @@ arguments and `↑` / `↓` recall earlier lines.
| `za` | a document's own files, folded open under it in the list — again folds them away; p drops marked files in there | | `za` | a document's own files, folded open under it in the list — again folds them away; p drops marked files in there |
| `M` | pick up the whole folder — again puts it all back | | `M` | pick up the whole folder — again puts it all back |
| `Ctrl / Shift-click` | pick a row up · every row up to it — drag them onto a folder | | `Ctrl / Shift-click` | pick a row up · every row up to it — drag them onto a folder |
| `S` | the plan screen: the board, the agenda and the calendar, in place of the documents and the list — S again goes back to the documents as they were | | `S` | the plan screen with every view on it: the board, the agenda and the calendar, in place of the documents and the list — S again goes back to the documents as they were |
| `t` | agenda — late, due this week, in hand, on every board — on the plan screen | | `t` | agenda — late, due this week, in hand, on every board — on the plan screen, alone or beside what is there |
| `T` | today's diary entry, started if there is none — from templates/day when the diary has one | | `T` | today's diary entry, started if there is none — from templates/day when the diary has one |
| `C` | the diary by month, on the plan screen: h/l a day, j/k a week, H/L a month, . today, Enter opens or starts the day among the documents | | `C` | the diary by month, on the plan screen, alone or beside what is there: h/l a day, j/k a week, H/L a month, . today, Enter opens or starts the day among the documents |
| `[d / ]d` | the diary entry before / after the one open, by date | | `[d / ]d` | the diary entry before / after the one open, by date |
| `Ctrl-P` | go to anything by its name, in every space — words before the last narrow the path, as in proj/ingest; Tab or Ctrl-N/P walk, Enter goes | | `Ctrl-P` | go to anything by its name, in every space — words before the last narrow the path, as in proj/ingest; Tab or Ctrl-N/P walk, Enter goes |
| `b` | the board, on the plan screen: this space's, or the last one shown — 1 … 9 there shows another's | | `b` | the board, on the plan screen, alone or beside what is there: this space's, or the last one shown — 1 … 9 there shows another's |
| `c` | capture a card into this space's inbox, without leaving here — reading a document, a card about it; Tab on the line makes it a note, or a line in today's entry | | `c` | capture a card into this space's inbox, without leaving here — reading a document, a card about it; Tab on the line makes it a note, or a line in today's entry |
| `Esc · q` | close the document, and its tile when there are several — Esc first puts down what m picked up, and in the list lets go of a search | | `Esc · q` | close the document, and its tile when there are several — Esc first puts down what m picked up, and in the list lets go of a search |
| `/` | full-text search, inside the current space and its text files — Tab takes it to every space, Ctrl-N/P walk the results, Enter opens one, Esc gives up | | `/` | full-text search, inside the current space and its text files — Tab takes it to every space, Ctrl-N/P walk the results, Enter opens one, Esc gives up |
@@ -63,7 +63,7 @@ arguments and `↑` / `↓` recall earlier lines.
| `Ctrl-S` | save, from anywhere | | `Ctrl-S` | save, from anywhere |
| `?` | this screen — the keys to start with, then on a second ? every key and command; h/l a column, / filters it down | | `?` | this screen — the keys to start with, then on a second ? every key and command; h/l a column, / filters it down |
| `,` | the settings sheet: vim and the clipboard, the vault, the backup, signed-in browsers, ssh keys, capture tokens | | `,` | the settings sheet: vim and the clipboard, the vault, the backup, signed-in browsers, ssh keys, capture tokens |
| `q · Esc` | on the plan screen: from a card's back to the board, from the board, the agenda or the calendar back to the documents | | `q · Esc` | on the plan screen: the view goes, and the plan stays while anything is left on it — a card's back goes back to the board, the last view back to the documents |
### On a board ### On a board
@@ -154,8 +154,8 @@ whole workspace. A command that does a second thing takes a word for it:
| command | what it does | | command | what it does |
| --- | --- | | --- | --- |
| `:board` | this space's board, on the plan screen — the last one shown when this space has none | | `:board` | this space's board, on the plan screen, alone or beside what is there — the last one shown when this space has none |
| `:plan, :special` | the plan screen: the board, the agenda and the calendar, in place of the documents — S goes there and back again; 1 … 9 on the board picks the board | | `:plan, :special` | the plan screen with every view on it: the board, the agenda and the calendar, in place of the documents — S goes there and back again; 1 … 9 on the board picks the board |
| `:card, :c [title]` | add a card — reading a document, one about it, titled after it unless named, and gf on it comes back; on the board to the list under the cursor, elsewhere to this space's inbox | | `:card, :c [title]` | add a card — reading a document, one about it, titled after it unless named, and gf on it comes back; on the board to the list under the cursor, elsewhere to this space's inbox |
| `:due <when\|->` | due date of the card in focus — on the board, its back, in the agenda, or the open document's: today, tm, fri, +3d, +2w, 10-31, 2026-10-31 — - clears | | `:due <when\|->` | due date of the card in focus — on the board, its back, in the agenda, or the open document's: today, tm, fri, +3d, +2w, 10-31, 2026-10-31 — - clears |
| `:repeat <rule\|->` | once the card is done, a copy comes back in the inbox: daily, weekly, monthly, yearly, +3d, +2w, +6m — - stops it | | `:repeat <rule\|->` | once the card is done, a copy comes back in the inbox: daily, weekly, monthly, yearly, +3d, +2w, +6m — - stops it |
@@ -196,7 +196,7 @@ whole workspace. A command that does a second thing takes a word for it:
| command | what it does | | command | what it does |
| --- | --- | | --- | --- |
| `:close, :clo` | close the focused tile — q while reading; on the plan screen, back to the documents; asks when its draft could not be written | | `:close, :clo` | close the focused tile — q while reading; on the plan screen the view, and the last one back to the documents; asks when its draft could not be written |
| `:only, :on` | close every tile but the focused one | | `:only, :on` | close every tile but the focused one |
| `:ls, :buffers, :files` | list the open tiles, % on the focused one | | `:ls, :buffers, :files` | list the open tiles, % on the focused one |
| `:buffer, :b <n\|name>` | focus a tile by its number in :ls, or by the start of its name | | `:buffer, :b <n\|name>` | focus a tile by its number in :ls, or by the start of its name |
+1 -1
View File
@@ -72,7 +72,7 @@ The rail of buttons on the right does the same as the keys, for a mouse.
`h` comes back up. `h` comes back up.
6. Press `c`, type `try the board`, and press `Enter`. That is a card in the 6. Press `c`, type `try the board`, and press `Enter`. That is a card in the
inbox of this space's board. Press `b` to see the board on the plan screen, inbox of this space's board. Press `b` to see the board on the plan screen,
beside the agenda and the calendar, and `Esc` to go back to the documents. `t` to put the agenda beside it, and `Esc` twice to go back to the documents.
`S` goes to the plan and back; `Ctrl-h`/`j`/`k`/`l` walk between the tiles. `S` goes to the plan and back; `Ctrl-h`/`j`/`k`/`l` walk between the tiles.
7. Press `T`. That is today's diary entry, started for you. 7. Press `T`. That is today's diary entry, started for you.
8. Press `?` for the list of every key and command. `h` / `l` walk its columns, `/` narrows it down, and `Esc` closes it. 8. Press `?` for the list of every key and command. `h` / `l` walk its columns, `/` narrows it down, and `Esc` closes it.
+3 -1
View File
@@ -25,7 +25,9 @@ beside the documents, or belongs to the one document it was put into.
They are shown on two screens. The **documents** screen has the list on the They are shown on two screens. The **documents** screen has the list on the
left and the documents open in tiles beside it. The **plan** screen has the left and the documents open in tiles beside it. The **plan** screen has the
board, the agenda and the calendar, and a card turned over. `S` goes from one to board, the agenda and the calendar, and a card turned over. `S` goes from one to
the other, and each keeps what was on it. The scratchpad comes down over either. the other, with every view on the plan, and the documents keep what was on them.
`b`, `t` and `C` open the plan on their own view alone, or add it beside what is
there; `q` closes one view at a time. The scratchpad comes down over either.
## Morning: what needs you ## Morning: what needs you
+1 -1
View File
@@ -565,7 +565,7 @@ export const actions: { [C in Context]: Record<ActionOf<C>, Run> } = {
calendar: () => void runCommand('cal'), calendar: () => void runCommand('cal'),
// `S`, as the desktop's special workspace is bound: the plan screen — // `S`, as the desktop's special workspace is bound: the plan screen —
// the board, the agenda and the calendar — and back to the documents. // the board, the agenda and the calendar — and back to the documents.
// `b`, `t` and `C` go there too, to their own view. // `b`, `t` and `C` go there with their own view alone, or add it beside.
plan: () => void runCommand('plan'), plan: () => void runCommand('plan'),
line: () => line(':'), line: () => line(':'),
help: () => void runCommand('help'), help: () => void runCommand('help'),
+3 -3
View File
@@ -605,14 +605,14 @@ export const commands: CommandSpec[] = [
{ {
name: 'board', name: 'board',
group: 'board', group: 'board',
help: "this space's board, on the plan screen — the last one shown when this space has none", help: "this space's board, on the plan screen, alone or beside what is there — the last one shown when this space has none",
run: () => workspace.guard(() => workspace.tiles.show('board')), run: () => workspace.guard(() => workspace.tiles.show('board')),
}, },
{ {
name: 'plan', name: 'plan',
aliases: ['special'], aliases: ['special'],
group: 'board', group: 'board',
help: 'the plan screen: the board, the agenda and the calendar, in place of the documents — S goes there and back again; 1 … 9 on the board picks the board', help: 'the plan screen with every view on it: the board, the agenda and the calendar, in place of the documents — S goes there and back again; 1 … 9 on the board picks the board',
run: () => workspace.guard(() => workspace.tiles.togglePlan()), run: () => workspace.guard(() => workspace.tiles.togglePlan()),
}, },
{ {
@@ -888,7 +888,7 @@ export const commands: CommandSpec[] = [
name: 'close', name: 'close',
aliases: ['clo'], aliases: ['clo'],
group: 'tiles', group: 'tiles',
help: 'close the focused tile — q while reading; on the plan screen, back to the documents; asks when its draft could not be written', help: 'close the focused tile — q while reading; on the plan screen the view, and the last one back to the documents; asks when its draft could not be written',
run: () => run: () =>
workspace.guard(async () => { workspace.guard(async () => {
await workspace.drafts.flushTile() await workspace.drafts.flushTile()
+5 -5
View File
@@ -108,14 +108,14 @@ export const bindings = [
{ context: 'tree', keys: ['za'], action: 'files', help: "a document's own files, folded open under it in the list — again folds them away; p drops marked files in there" }, { context: 'tree', keys: ['za'], action: 'files', help: "a document's own files, folded open under it in the list — again folds them away; p drops marked files in there" },
{ context: 'tree', keys: ['M'], action: 'markAll', help: 'pick up the whole folder — again puts it all back' }, { context: 'tree', keys: ['M'], action: 'markAll', help: 'pick up the whole folder — again puts it all back' },
{ context: 'tree', label: 'Ctrl / Shift-click', help: 'pick a row up · every row up to it — drag them onto a folder' }, { context: 'tree', label: 'Ctrl / Shift-click', help: 'pick a row up · every row up to it — drag them onto a folder' },
{ context: 'global', keys: ['S'], action: 'plan', help: 'the plan screen: the board, the agenda and the calendar, in place of the documents and the list — S again goes back to the documents as they were', essential: true }, { context: 'global', keys: ['S'], action: 'plan', help: 'the plan screen with every view on it: the board, the agenda and the calendar, in place of the documents and the list — S again goes back to the documents as they were', essential: true },
{ context: 'global', keys: ['t'], action: 'agenda', help: 'agenda — late, due this week, in hand, on every board — on the plan screen', essential: true }, { context: 'global', keys: ['t'], action: 'agenda', help: 'agenda — late, due this week, in hand, on every board — on the plan screen, alone or beside what is there', essential: true },
{ context: 'global', keys: ['T'], action: 'today', help: "today's diary entry, started if there is none — from templates/day when the diary has one", essential: true }, { context: 'global', keys: ['T'], action: 'today', help: "today's diary entry, started if there is none — from templates/day when the diary has one", essential: true },
{ context: 'global', keys: ['C'], action: 'calendar', help: 'the diary by month, on the plan screen: h/l a day, j/k a week, H/L a month, . today, Enter opens or starts the day among the documents' }, { context: 'global', keys: ['C'], action: 'calendar', help: 'the diary by month, on the plan screen, alone or beside what is there: h/l a day, j/k a week, H/L a month, . today, Enter opens or starts the day among the documents' },
{ context: 'tree', keys: ['[d'], action: 'previousEntry', label: '[d / ]d', help: 'the diary entry before / after the one open, by date' }, { context: 'tree', keys: ['[d'], action: 'previousEntry', label: '[d / ]d', help: 'the diary entry before / after the one open, by date' },
{ context: 'tree', keys: [']d'], action: 'nextEntry' }, { context: 'tree', keys: [']d'], action: 'nextEntry' },
{ context: 'global', keys: ['Ctrl-p'], action: 'find', label: 'Ctrl-P', help: 'go to anything by its name, in every space — words before the last narrow the path, as in proj/ingest; Tab or Ctrl-N/P walk, Enter goes', essential: true }, { context: 'global', keys: ['Ctrl-p'], action: 'find', label: 'Ctrl-P', help: 'go to anything by its name, in every space — words before the last narrow the path, as in proj/ingest; Tab or Ctrl-N/P walk, Enter goes', essential: true },
{ context: 'global', keys: ['b'], action: 'board', help: "the board, on the plan screen: this space's, or the last one shown — 1 … 9 there shows another's" }, { context: 'global', keys: ['b'], action: 'board', help: "the board, on the plan screen, alone or beside what is there: this space's, or the last one shown — 1 … 9 there shows another's" },
{ context: 'tree', keys: ['c'], action: 'capture', help: "capture a card into this space's inbox, without leaving here — reading a document, a card about it; Tab on the line makes it a note, or a line in today's entry", essential: true }, { context: 'tree', keys: ['c'], action: 'capture', help: "capture a card into this space's inbox, without leaving here — reading a document, a card about it; Tab on the line makes it a note, or a line in today's entry", essential: true },
{ context: 'tree', keys: ['q'], action: 'close', label: 'Esc · q', help: 'close the document, and its tile when there are several — Esc first puts down what m picked up, and in the list lets go of a search', essential: true }, { context: 'tree', keys: ['q'], action: 'close', label: 'Esc · q', help: 'close the document, and its tile when there are several — Esc first puts down what m picked up, and in the list lets go of a search', essential: true },
{ context: 'tree', keys: ['Escape'], action: 'escape' }, { context: 'tree', keys: ['Escape'], action: 'escape' },
@@ -141,7 +141,7 @@ export const bindings = [
{ context: 'writing', keys: ['*'], action: 'refocus' }, { context: 'writing', keys: ['*'], action: 'refocus' },
// --- what the views share: the board, the agenda, the calendar, a card's back // --- what the views share: the board, the agenda, the calendar, a card's back
{ context: 'views', keys: ['q', 'Escape'], action: 'close', label: 'q · Esc', caps: ['q'], hint: 'close', help: "on the plan screen: from a card's back to the board, from the board, the agenda or the calendar back to the documents" }, { context: 'views', keys: ['q', 'Escape'], action: 'close', label: 'q · Esc', caps: ['q'], hint: 'close', help: "on the plan screen: the view goes, and the plan stays while anything is left on it — a card's back goes back to the board, the last view back to the documents" },
// --- on a board --------------------------------------------------------------- // --- on a board ---------------------------------------------------------------
{ context: 'board', keys: ['h', 'ArrowLeft'], action: 'left', label: 'h / l', caps: ['h', 'j', 'k', 'l'], hint: 'move', help: 'to the list left / right — right of the last, to the tile beside' }, { context: 'board', keys: ['h', 'ArrowLeft'], action: 'left', label: 'h / l', caps: ['h', 'j', 'k', 'l'], hint: 'move', help: 'to the list left / right — right of the last, to the tile beside' },
+23 -19
View File
@@ -171,11 +171,11 @@ export class Tiles {
/** /**
* `:close`: the focused tile goes, or with only one, what it shows. On the * `:close`: the focused tile goes, or with only one, what it shows. On the
* plan only a card's back goes; closing the board, the agenda or the * plan a view goes as a document's tile does, and the plan stays while
* calendar goes back to the documents. * anything is left on it; closing the last goes back to the documents.
*/ */
close() { close() {
if (this.planning && this.current.kind !== 'card') return this.leavePlan() if (this.planning && this.all.length === 1) return this.leavePlan()
this.ws.drafts.leaveCard() this.ws.drafts.leaveCard()
this.current.clear() this.current.clear()
this.prune() this.prune()
@@ -219,11 +219,13 @@ export class Tiles {
/* /*
* The views — the board, the agenda, the calendar, a card's back — are * The views — the board, the agenda, the calendar, a card's back — are
* the tiles of the plan screen. Each is read again whenever it is gone to: * the tiles of the plan screen. The plan opens on the one asked for, and
* it is looked at in passing, and what it says should be what is true now. * the others come beside it when they are asked for in turn. Each is read
* again whenever it is gone to: it is looked at in passing, and what it
* says should be what is true now.
*/ */
/** The views the plan screen holds, in the order they are tiled. */ /** The views `S` puts on the plan screen, in the order they are tiled. */
static readonly PLAN: View[] = ['board', 'agenda', 'calendar'] static readonly PLAN: View[] = ['board', 'agenda', 'calendar']
/** The other screen on show, and this one put away as it is. */ /** The other screen on show, and this one put away as it is. */
@@ -237,14 +239,12 @@ export class Tiles {
this.planning = !this.planning this.planning = !this.planning
} }
/** To the plan screen, with every view on it, from wherever the documents were. */ /** To the plan screen, with `kinds` on it and nothing else, from wherever the documents were. */
enterPlan() { enterPlan(kinds: View[]) {
if (this.planning) return if (this.planning) return
this.ws.drafts.leaveCard() this.ws.drafts.leaveCard()
this.swap() this.swap()
const cards = this.all.filter((tile) => tile.kind === 'card') this.replace(kinds.map((kind) => new Tile(kind)))
this.all = [...Tiles.PLAN.map((kind) => this.view(kind) ?? new Tile(kind)), ...cards]
this.focused = Math.min(this.focused, this.all.length - 1)
this.ws.pane = 'document' this.ws.pane = 'document'
} }
@@ -258,21 +258,25 @@ export class Tiles {
if (!this.current.empty) this.focusOn(this.focused) if (!this.current.empty) this.focusOn(this.focused)
} }
/** `b`, `t`, `C`, Enter on a card: to the plan screen, and that view on it focused. */ /**
async show(kind: View) { * `b`, `t`, `C`, Enter on a card: that view focused on the plan screen —
// Coming to the plan, every view on it is read again, not only this one. * alone on it when coming from the documents, beside what is there when
const kinds = this.planning ? [kind] : Tiles.PLAN * already on it.
*/
async show(kind: View, all = false) {
// Coming to the plan, every view put on it is read again, not only this one.
const kinds = all ? Tiles.PLAN : [kind]
await Promise.all(kinds.map((each) => this.loadView(each))) await Promise.all(kinds.map((each) => this.loadView(each)))
this.enterPlan() this.enterPlan(kinds)
if (!this.view(kind)) this.all.push(new Tile(kind)) if (!this.view(kind)) this.add(new Tile(kind))
this.focusOn(this.all.indexOf(this.view(kind)!)) this.focusOn(this.all.indexOf(this.view(kind)!))
if (kind === 'board' && this.ws.cards.boardSpaceId === null) this.ws.say('no space has a board — :set board turns one on', 'error') if (kind === 'board' && this.ws.cards.boardSpaceId === null) this.ws.say('no space has a board — :set board turns one on', 'error')
} }
/** `S`: the plan screen with the board focused, or back to the documents. */ /** `S`: the plan screen with every view on it and the board focused, or back to the documents. */
async togglePlan() { async togglePlan() {
if (this.planning) return this.leavePlan() if (this.planning) return this.leavePlan()
await this.show('board') await this.show('board', true)
} }
/** Read again what a view shows. */ /** Read again what a view shows. */