Compare commits

..
1 Commits
Author SHA1 Message Date
Ansho ReiandClaude Opus 5 b4534eb86d (a9bd6f0) Recall typed lines with up and down, kept in .wlhistory, and bump to 0.32.17
The lines typed at the command prompt are walked with up and down and kept
in .wlhistory in the board's own folder, so a recall spans runs rather than
one opening of the prompt.

One Recall per tab, parallel to Board::tabs, so the tab in view decides
which list up walks: a project's lines are the ones naming its ticket ids.
The merge tab is no board, so it keeps its lines for the run and writes no
file, the answer current_project already gives a command typed there.

The position sits on Prompt and the lines on Recall, so closing the prompt
forgets the position and not the lines. A failed write is silent and an
unreadable file is an empty recall: the line is in memory either way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 12:40:21 +02:00
4 changed files with 500 additions and 3 deletions
+10
View File
@@ -370,6 +370,16 @@ and this file is for what someone changing worklane's own code needs.
- **The keys' width comes off the row before the line is windowed**, so a long command does not push them off the end; a message takes the row from the keys instead, since the reader has just been told something and `esc` and `enter` still do what they did. `prompt_window` anchors the window on the cursor's right edge, which costs the text *after* the cursor on a long line: keeping both ends needs a scroll offset in state, and the draw is where the width is known and the state is not writable
- `: command` is named in every footer state, because the key works in every one of them, and the prompt's own key is drawn as `↵ run`
### The Prompt's Recall
- **`up` and `down` walk the lines already typed, and the lines are on disk.** `.wlhistory` in the board's own folder, appended as each line is entered. It is the one file under `.worklane` the board writes rather than a command, and the only one that is not markdown, which is the cost of a recall worth having: a board is opened and closed all day, and one that emptied on quit would only help inside a single sitting
- **`Recall` is per tab, parallel to `Board::tabs`**, so the tab in view decides which list `up` walks. A project's lines are the ones naming its ticket ids, and handing another board's `mv` back on this one would offer an id that resolves to nothing there. The tabs are fixed for the run, so the two vectors cannot drift, and the same index that picks the tab picks the recall
- **The merge tab has no file.** It is the one tab that is not a board, `current_project` answers `None` there and a command typed there is refused for that reason, so there is nothing to attribute a line to. Those lines are still recalled for the run: every one of them was refused, and a refused line is the one most worth getting back. When ebc5755 routes a merge line to the board its card names, that board's file is the one to append to
- **The position is on `Prompt` and the lines are on `Recall`**, so closing the prompt forgets the position and not the lines: the next `:` opens at the end of the list again, which is where a shell opens. `pending` holds the half typed line `up` walked away from, and walking `down` past the newest entry puts it back, so leaving a command to look for an older one never costs it
- **The ends are stops, not wraps.** `up` on the oldest line leaves it up rather than cycling round to the newest, which is what a shell does with it; `down` with no walk under way does nothing, since there is nothing in front of a line still being typed and emptying the row would be a keypress that destroys work. **An empty recall does nothing at all**, and that includes leaving the line alone, or `up` on a board nobody has typed at would be a way to lose what is half written
- **The line is kept before anything can refuse it.** A refused line never reached a handler and the fix is usually two characters, which is what the walk exists to save. Consecutive duplicates are kept once, against what is already held, so the rule spans runs as well as one sitting; a blank line is no command and is not kept. Nothing is trimmed
- **A failed write is silent, and an unreadable file is an empty recall.** The line is in memory either way, so the walk works for the run on a board whose folder cannot be written, and a board with no history yet is the ordinary case rather than something to say. A notice about a history file would be about the one thing the reader did not ask for
- **`.wlhistory` is not in `digest`.** Appending to it must not read as the tree moving, or every command typed would provoke a reload of every board on top of the one `run` already does
### Splitting a Typed Line
- **`split_line` is the whole module, and it knows nothing about `Board`.** The command prompt reads one string and clap reads an argv, so `comment 1b78a24 the offset was never passed` has to be tokenised before anything can parse it: split on whitespace it is five arguments and `comment` takes two. A pure function over the line and the cursor is what makes every rule reachable from a unit test, and it is in a file of its own rather than in `tui.rs`, which is eleven thousand lines already
- **The rules are the shell's, because that is what the prompt promises**: the line is spelled there exactly as it is spelled in the shell. Runs of whitespace separate arguments, single and double quotes group one, a backslash escapes the next character *except* inside single quotes where it is a backslash, and an explicitly empty `''` is an argument that exists and is empty — which is what `--title ""` being a usage error rather than a silent clear depends on. A leading hyphen is not special here: whether `--foo` is a flag or the text of a criterion is clap's question, and `PROSE` already answers it
Generated
+1 -1
View File
@@ -1503,7 +1503,7 @@ dependencies = [
[[package]]
name = "worklane"
version = "0.32.16"
version = "0.32.17"
dependencies = [
"anyhow",
"assert_cmd",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "worklane"
version = "0.32.16"
version = "0.32.17"
edition = "2024"
[dependencies]
+488 -1
View File
@@ -14,6 +14,7 @@
use std::collections::hash_map::DefaultHasher;
use std::collections::{BTreeMap, HashMap};
use std::hash::{Hash, Hasher};
use std::io::Write as _;
use std::path::{Path, PathBuf};
use std::time::{Duration, SystemTime};
@@ -35,6 +36,15 @@ use crate::util::*;
/// How long the event poll waits before letting the tick run.
pub const POLL: Duration = Duration::from_millis(250);
/// The file the lines typed on a board are kept in, in the board's own folder beside the
/// status directories.
///
/// The one file under `.worklane` the board writes rather than a command, and the only
/// one that is not markdown: it is a list of lines, read by nobody but the prompt. Not in
/// `digest`, so appending to it never counts as the tree moving and never provokes a
/// reload.
pub const RECALL_FILE: &str = ".wlhistory";
/// The tab that throws every monitored board into one set of columns.
///
/// Lowercase like the column headings, since it sits in the same row of chrome and is
@@ -720,6 +730,16 @@ pub struct Prompt {
/// the cursor leaves it up, since the line it is about has not changed. `Search::missed`
/// is the same rule with nothing to say but "no match".
pub refused: Option<String>,
/// How far back `up` has walked into the tab's [`Recall`], or `None` while the line on
/// the row is the reader's own.
///
/// Here rather than on the recall, so closing the prompt forgets the position and not
/// the lines: the next `:` opens at the end of the list again, which is where a shell
/// opens. The lines outlive one opening of the prompt and the position does not.
position: Option<usize>,
/// The half typed line `up` walked away from, put back by walking down past the newest
/// entry. `Some` exactly while `position` is.
pending: Option<String>,
}
impl Prompt {
@@ -810,6 +830,92 @@ impl Prompt {
self.cursor = from;
self.refused = None;
}
/// Put a recalled line on the row with the cursor at its end, the way a shell hands
/// one back: what a reader does with a recalled command is append to it or fix its
/// tail, and the end is where both start.
///
/// The message about the last enter goes with it, for the reason every edit in `key`
/// takes it away: it was about a line that is no longer on the row.
fn show(&mut self, line: String) {
self.cursor = line.len();
self.line = line;
self.refused = None;
}
}
/// The lines already typed against one tab, and the file they outlive the run in.
///
/// One per tab and parallel to [`Board::tabs`], so the tab in view decides which list `up`
/// walks. A project's lines are the ones naming its ticket ids, and handing another
/// board's `mv` back on this one would offer an id that resolves to nothing there. The
/// tabs are fixed for the run, so the two cannot drift apart.
///
/// `file` is `None` on the merge tab, which is the one tab that is not a board.
/// `Board::current_project` resolves to nothing there and a command typed there is refused
/// for that reason, see ebc5755, so there is no board to attribute the line to and nothing
/// to append it to. Those lines are still recalled for the run: a refused line is the one
/// most worth getting back, and it goes when the board does.
pub struct Recall {
/// Oldest first, so `up` walks backwards from the end.
lines: Vec<String>,
/// The board's own [`RECALL_FILE`], or `None` for a recall that is kept nowhere.
file: Option<PathBuf>,
}
impl Recall {
/// What a board has already been typed at, oldest first.
///
/// A file that is missing or unreadable is an empty recall rather than a failure. A
/// board with no history yet is the ordinary case and not worth a message, and one
/// whose file cannot be read is a convenience gone rather than a board that will not
/// start. Blank lines are dropped on the way in, so a file truncated or edited by hand
/// cannot put an empty entry in the walk.
fn load(dir: &Path) -> Self {
let file = dir.join(RECALL_FILE);
let lines = std::fs::read_to_string(&file)
.unwrap_or_default()
.lines()
.filter(|line| !line.trim().is_empty())
.map(str::to_string)
.collect();
Recall { lines, file: Some(file) }
}
/// A recall with no file behind it, which is the merge tab's.
fn unkept() -> Self {
Recall { lines: Vec::new(), file: None }
}
/// Keep a line that was entered, and append it to the file.
///
/// Consecutive duplicates are kept once, so holding `up` steps through distinct
/// commands rather than through the same `mv` typed four times. The rule is applied
/// against what is already held, which after a [`load`](Self::load) is the file's last
/// line, so it spans runs as well as one sitting. A blank line is no command and is
/// not kept.
///
/// Nothing is trimmed: the file is every line ever typed against that board.
///
/// **A write that fails is silent.** The line is in `lines` either way, so the recall
/// still works for the run on a board whose folder is read only, and a notice about a
/// history file would be about the one thing the reader did not ask for. The line
/// itself is what they asked for, and `run` already has the row for what came of it.
fn keep(&mut self, line: &str) {
if line.trim().is_empty() || self.lines.last().is_some_and(|last| last == line) {
return;
}
self.lines.push(line.to_string());
let Some(file) = &self.file else { return };
let _ = std::fs::OpenOptions::new()
.create(true)
.append(true)
.open(file)
.and_then(|mut handle| handle.write_all(format!("{line}\n").as_bytes()));
}
}
/// What a line that ends half typed is waiting for, or nothing when it is whole.
@@ -1297,6 +1403,9 @@ pub struct Board {
pub visibility: Visibility,
pub should_quit: bool,
projects: Vec<Project>,
/// The lines typed against each tab, parallel to `tabs`. See [`Recall`] for why it is
/// per tab rather than one list for the board.
recalls: Vec<Recall>,
digest: u64,
}
@@ -1316,6 +1425,15 @@ impl Board {
}
tabs.extend(projects.iter().map(|project| Tab::new(project.name.clone())));
// One per tab and in the same order, the merge's first when there is one. Read here
// rather than at the first `:`, so a board that has been typed at before opens with
// the walk already behind it and no keypress pays for a file read.
let mut recalls: Vec<Recall> = Vec::new();
if projects.len() > 1 {
recalls.push(Recall::unkept());
}
recalls.extend(projects.iter().map(|project| Recall::load(&project.dir)));
let mut board = Board {
tabs,
tab: 0,
@@ -1328,6 +1446,7 @@ impl Board {
visibility: Visibility::default(),
should_quit: false,
projects,
recalls,
digest: 0,
};
board.reload()?;
@@ -1371,6 +1490,16 @@ impl Board {
&mut self.tabs[self.tab]
}
/// The recall of the tab in view: the lines `up` walks there, and where a line entered
/// there is kept.
///
/// Indexed by `tab` like `current`, because `recalls` is built parallel to `tabs` and
/// both are fixed for the run. Switching tabs therefore switches the recall with it,
/// with nothing to keep in step.
fn recall_mut(&mut self) -> &mut Recall {
&mut self.recalls[self.tab]
}
/// The project whose board the tab in view is showing, or nothing on the merge.
///
/// The merge tab is the one tab that is not a board: its cards came from several
@@ -2220,6 +2349,11 @@ impl Board {
match key.code {
KeyCode::Esc if !control => self.prompt = None,
KeyCode::Enter if !control => self.submit(screen),
// The mode's, like `esc` and `enter`, and for the same reason: the walk is over
// the tab's lines and the line on the row is only where it lands, so it takes
// the whole board rather than the prompt alone.
KeyCode::Up if !control => self.recall_back(),
KeyCode::Down if !control => self.recall_forward(),
_ => {
if let Some(prompt) = &mut self.prompt {
prompt.key(key, control);
@@ -2230,6 +2364,62 @@ impl Board {
true
}
/// `up`: one line further back, or the newest line when the reader is still on their
/// own.
///
/// The line being typed is put aside on the first press and comes back on the way down,
/// so walking away from a half typed command never costs it. The oldest line is a stop
/// rather than a wrap, which is what a shell does with it: holding `up` settles on the
/// far end instead of cycling past it and offering the newest line again.
///
/// An empty recall does nothing, and that includes leaving the line alone. `up` on a
/// board that has not been typed at must not be a way to lose what is on the row.
fn recall_back(&mut self) {
// Two fields, borrowed apart: the lines are read while the prompt is written to.
let lines = &self.recalls[self.tab].lines;
let Some(prompt) = self.prompt.as_mut() else {
return;
};
let at = match (prompt.position, lines.len()) {
(_, 0) => return,
(None, len) => {
prompt.pending = Some(prompt.line.clone());
len - 1
}
(Some(0), _) => return,
(Some(at), _) => at - 1,
};
prompt.position = Some(at);
prompt.show(lines[at].clone());
}
/// `down`: one line nearer the present, and past the newest the line that was being
/// typed, which is where the walk started.
///
/// `down` with no walk under way does nothing. There is nothing in front of a line the
/// reader is still typing, and emptying the row would be a keypress that destroys work.
fn recall_forward(&mut self) {
let lines = &self.recalls[self.tab].lines;
let Some(prompt) = self.prompt.as_mut() else {
return;
};
let Some(at) = prompt.position else { return };
if at + 1 < lines.len() {
prompt.position = Some(at + 1);
prompt.show(lines[at + 1].clone());
return;
}
// Off the end of the walk and back on the reader's own line, which is unset when
// `up` was pressed on an empty row.
let pending = prompt.pending.take().unwrap_or_default();
prompt.position = None;
prompt.show(pending);
}
/// What enter does with the line: run the command it resolved to, or say why it did
/// not resolve to one.
///
@@ -2249,12 +2439,19 @@ impl Board {
/// and the reason both are true of one field.
fn submit(&mut self, screen: Size) {
let Some(prompt) = &self.prompt else { return };
let (line, cursor) = (prompt.line.clone(), prompt.cursor);
// Kept before anything can refuse it, since a line that was refused is the one most
// worth getting back: the fix is usually two characters, and retyping it from `:`
// is what the walk exists to stop. `keep` drops a blank line and a repeat of the
// line already at the end, so neither needs deciding here.
self.recall_mut().keep(&line);
// Before clap sees anything, because a line ending inside a quote is not a line
// that failed to parse: it is one the reader has not finished typing, and handing
// its half-open argument to clap would report a grammar fault about a sentence
// nobody finished.
let split = split_line(&prompt.line, prompt.cursor);
let split = split_line(&line, cursor);
if let Some(open) = unclosed_message(split.unclosed) {
self.refuse(open.to_string());
return;
@@ -8424,6 +8621,296 @@ approach";
);
}
// ------------------------------------------------------------------- the recall --
/// Press a key on the open prompt and assert it was taken, which every key there is.
fn press_prompt(board: &mut Board, code: KeyCode) {
assert!(board.prompt_key(typed(code), SCREEN), "{code:?} was not taken");
}
/// What a board has kept, oldest first, whatever tab it is on.
fn kept(board: &Board) -> &[String] {
&board.recalls[board.tab].lines
}
/// What the file holds, or nothing when there is no file to read.
fn recall_file(dir: &Path) -> Option<String> {
std::fs::read_to_string(dir.join(RECALL_FILE)).ok()
}
/// The walk itself: `up` hands back the previous line, repeated presses go further
/// back, and `down` comes forward again and returns the line that was being typed.
#[test]
fn up_walks_back_through_the_lines_and_down_comes_forward_to_the_half_typed_one() {
let (_root, mut board) = runnable();
for line in ["ls backlog", "show 1111111"] {
run_line(&mut board, line);
}
board.open_prompt();
type_line(&mut board, "comm");
press_prompt(&mut board, KeyCode::Up);
assert_eq!(
prompt_line(&board),
Some("show 1111111"),
"up did not hand back the last line"
);
press_prompt(&mut board, KeyCode::Up);
assert_eq!(prompt_line(&board), Some("ls backlog"), "up did not walk further back");
// The oldest line is a stop, not a wrap onto the newest again.
press_prompt(&mut board, KeyCode::Up);
assert_eq!(prompt_line(&board), Some("ls backlog"), "up wrapped past the oldest line");
press_prompt(&mut board, KeyCode::Down);
assert_eq!(prompt_line(&board), Some("show 1111111"), "down did not come forward");
press_prompt(&mut board, KeyCode::Down);
assert_eq!(prompt_line(&board), Some("comm"), "the half typed line was lost");
// Nothing in front of the reader's own line, so down there does nothing.
press_prompt(&mut board, KeyCode::Down);
assert_eq!(prompt_line(&board), Some("comm"), "down emptied the row");
}
/// The cursor lands at the end of a recalled line, since what a reader does with one is
/// append to it or fix its tail.
#[test]
fn a_recalled_line_arrives_with_the_cursor_at_its_end() {
let (_root, mut board) = runnable();
run_line(&mut board, "ls backlog");
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
type_line(&mut board, " --tag bug");
assert_eq!(
prompt_line(&board),
Some("ls backlog --tag bug"),
"the cursor was not at the end of the recalled line"
);
}
/// An empty recall does nothing at all, and that includes leaving the row alone: `up` on
/// a board nobody has typed at must not be a way to lose a half typed command.
#[test]
fn up_on_a_board_with_no_lines_leaves_the_row_alone() {
let (_root, mut board) = runnable();
board.open_prompt();
type_line(&mut board, "mv 111");
press_prompt(&mut board, KeyCode::Up);
press_prompt(&mut board, KeyCode::Down);
assert_eq!(prompt_line(&board), Some("mv 111"), "an arrow touched the line");
assert!(kept(&board).is_empty(), "a line nobody entered was kept");
}
/// The line this is most needed for. A refused line never reached a handler, and the fix
/// is usually two characters, so it has to be recallable like any other.
#[test]
fn a_line_that_was_refused_is_recalled_too() {
let (_root, mut board) = runnable();
run_line(&mut board, "mb 1111111 --status committed");
assert!(refused(&board).is_some(), "the typo was not refused");
// The prompt is still open on the refused line, so this is the next opening of it.
board.prompt = None;
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
assert_eq!(
prompt_line(&board),
Some("mb 1111111 --status committed"),
"the refused line was not kept"
);
}
/// Holding `up` steps through distinct commands rather than through the same `mv` typed
/// four times.
#[test]
fn consecutive_duplicates_are_kept_once() {
let (root, mut board) = runnable();
run_line(&mut board, "ls backlog");
run_line(&mut board, "ls backlog");
run_line(&mut board, "show 1111111");
run_line(&mut board, "ls backlog");
assert_eq!(
kept(&board),
["ls backlog", "show 1111111", "ls backlog"],
"the repeat was kept twice, or a line away from its repeat was folded into it"
);
let dir = root.join(".worklane");
assert_eq!(
recall_file(&dir).unwrap_or_default(),
"ls backlog\nshow 1111111\nls backlog\n",
"the file and the walk disagree"
);
}
/// The point of the file: the lines outlive the run. A board is opened and closed all
/// day, and a recall that empties on quit only helps inside a single sitting.
#[test]
fn the_lines_go_in_the_board_folder_and_come_back_on_the_next_run() {
let (root, mut board) = runnable();
let dir = root.join(".worklane");
run_line(&mut board, "ls backlog");
assert_eq!(recall_file(&dir).as_deref(), Some("ls backlog\n"), "nothing was written");
drop(board);
// The next run of the board over the same tree, which is what a quit and a restart
// leaves behind.
let mut next = Board::new(projects(&[], root.as_ref()).unwrap()).unwrap();
assert_eq!(kept(&next), ["ls backlog"], "the file was not read back");
next.open_prompt();
press_prompt(&mut next, KeyCode::Up);
assert_eq!(prompt_line(&next), Some("ls backlog"), "the previous run is not recalled");
// And the duplicate rule spans the two runs, since it is applied to what was loaded.
run_line(&mut next, "ls backlog");
assert_eq!(kept(&next), ["ls backlog"], "the file's last line was repeated");
}
/// One file per board, and the walk follows the tab. A project's lines are the ones
/// naming its ticket ids, and handing another board's `mv` back here would offer an id
/// that resolves to nothing.
#[test]
fn each_tab_walks_the_lines_of_its_own_board() {
let (first, one) = runnable();
let (second, two) = runnable();
let mut board = Board::new(vec![
project_at(&one.projects[0].dir),
project_at(&two.projects[0].dir),
])
.unwrap();
// A delta and not an index, so the two project tabs are one step apart from the
// merge the board opens on.
board.select_tab(1, SCREEN);
assert_eq!(board.tab, 1, "the first project tab is not where one step lands");
run_line(&mut board, "ls backlog");
board.prompt = None;
board.select_tab(1, SCREEN);
assert_eq!(board.tab, 2, "the second project tab is not the next step");
run_line(&mut board, "show 1111111");
board.prompt = None;
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
assert_eq!(
prompt_line(&board),
Some("show 1111111"),
"the second tab walked the first's"
);
board.prompt = None;
board.select_tab(-1, SCREEN);
assert_eq!(board.tab, 1, "the step back missed the first project tab");
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
assert_eq!(prompt_line(&board), Some("ls backlog"), "the first tab lost its own line");
assert_eq!(kept(&board), ["ls backlog"], "the other tab's line reached this one");
assert_eq!(
recall_file(&first.join(".worklane")).as_deref(),
Some("ls backlog\n"),
"the first board's file"
);
assert_eq!(
recall_file(&second.join(".worklane")).as_deref(),
Some("show 1111111\n"),
"the second board's file"
);
}
/// The merge tab is not a board, so there is nothing to attribute its lines to. They are
/// still recalled for the run, since every one of them was refused and a refused line is
/// the one worth getting back.
#[test]
fn a_line_typed_on_the_merge_tab_is_recalled_for_the_run_and_written_nowhere() {
let (first, one) = runnable();
let (second, two) = runnable();
let mut board = Board::new(vec![
project_at(&one.projects[0].dir),
project_at(&two.projects[0].dir),
])
.unwrap();
assert_eq!(board.tab, 0, "the merge is not the tab the board opens on");
run_line(&mut board, "mv 1111111 --status committed");
assert!(refused(&board).is_some(), "the merge tab ran the command somewhere");
board.prompt = None;
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
assert_eq!(
prompt_line(&board),
Some("mv 1111111 --status committed"),
"the merge tab did not recall its own line"
);
for dir in [first.join(".worklane"), second.join(".worklane")] {
assert_eq!(
recall_file(&dir),
None,
"a merge line landed on a board: {}",
dir.display()
);
}
}
/// A board whose folder cannot take the file still recalls within the run. The line is
/// what the reader asked for and it is on the row either way, so a failed write is
/// silent rather than a notice about the one thing nobody asked for.
#[test]
fn a_file_that_cannot_be_written_still_recalls_for_the_run() {
let (root, _board) = runnable();
let dir = root.join(".worklane");
// A directory where the file goes: the read fails, and so does every append.
std::fs::create_dir_all(dir.join(RECALL_FILE)).unwrap();
let mut board = Board::new(projects(&[], root.as_ref()).unwrap()).unwrap();
assert!(kept(&board).is_empty(), "an unreadable file was not an empty recall");
run_line(&mut board, "ls backlog");
assert!(board.prompt.is_none(), "the command was refused: {:?}", refused(&board));
assert_eq!(kept(&board), ["ls backlog"], "the line was lost with the write");
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
assert_eq!(prompt_line(&board), Some("ls backlog"), "the recall stopped working");
}
/// The swallow contract, restated with something in the recall: the arrows now do
/// something inside the prompt, and it still must not be the thing they do on the board.
#[test]
fn the_arrows_walk_the_recall_and_never_the_cards() {
let (_root, mut board) = runnable();
run_line(&mut board, "ls backlog");
board.prompt = None;
let before = selected_title(&board);
let column = board.current().column;
board.open_prompt();
press_prompt(&mut board, KeyCode::Up);
press_prompt(&mut board, KeyCode::Down);
press_prompt(&mut board, KeyCode::Up);
assert_eq!(selected_title(&board), before, "an arrow moved the selection");
assert_eq!(board.current().column, column, "an arrow changed column");
assert_eq!(prompt_line(&board), Some("ls backlog"), "the walk did not happen");
}
// ------------------------------------------------------------------ the copy key --
/// A sink that records what it was handed, standing in for the clipboard.