(0fd1ddc) Pick a tag in the tui, and bump to 0.27.1
The board could be cut by campaign and not by the axis `ls --tag` has answered since 2f3796e. `t` opens a picker of every tag the board declares or carries, and taking one filters every column to the cards carrying it, matched whole and case sensitively the way the listing matches. The picker is one piece of machinery over two lists rather than a second picker. `PickerRow::key` is what made that cheap: a campaign is keyed by its uuid and a tag by itself, both strings, so stepping over selectable rows, keeping the highlight across a rebuild and taking a row with `enter` are written once. Only the list and what the answer filters differ. `Tab::campaign` became `Tab::filter`, an enum of whole, campaign or tag, with `select_filter` its only writer. Picking either clears the other because they are one field rather than because two setters remember to, which is also what the shared frame slot needs: it holds one frame and can now only be asked to name one thing. The tag sections are declared above undeclared and neither is truncated, where the completed campaigns are: a finished campaign is done with and that tail only grows, while an undeclared tag is the row a reader most wants to see. `campaign` and `campaigns` would have sat one under the other here the day the second was invented. The digest stamps `tags.md`, or a tag declared elsewhere would never reach an open picker. The footer names the tag in its own colour beside `q board`, because a tag draws no frame until 2a83bd4 and nothing else would say why the cards are missing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3592584747
commit
7126138d46
Generated
+1
-1
@@ -1503,7 +1503,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "worklane"
|
||||
version = "0.27.0"
|
||||
version = "0.27.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"assert_cmd",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "worklane"
|
||||
version = "0.27.0"
|
||||
version = "0.27.1"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
+5
-1
@@ -248,7 +248,11 @@ fn run_tui(paths: &[std::path::PathBuf], start: &std::path::Path) -> Result<()>
|
||||
// The way in to the campaign picker, like `/` is to the search prompt: from
|
||||
// the next keypress on `picker_key` above has the keyboard. Free of every
|
||||
// other binding, and `ctrl-c` is matched above this so quitting still wins.
|
||||
KeyCode::Char('c') => board.open_picker(),
|
||||
KeyCode::Char('c') => board.open_picker(tui::PickerKind::Campaign, screen),
|
||||
// The other axis the board is cut along, and the one `ls --tag` has
|
||||
// answered since 2f3796e. Free of every other binding: `tab` is its own
|
||||
// key code, not this letter.
|
||||
KeyCode::Char('t') => board.open_picker(tui::PickerKind::Tag, screen),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -163,6 +163,16 @@ impl TagIndex {
|
||||
self.tags.keys().map(String::as_str)
|
||||
}
|
||||
|
||||
/// What a tag means, whole, or `None` for a tag the file does not declare.
|
||||
///
|
||||
/// The raw section, paragraphs and all, where [`Self::summary`] is the one line a
|
||||
/// listing has room for. `Some("")` is a tag declared with nothing said about it, which
|
||||
/// the caller has to tell apart from `None`: the board draws the two in different
|
||||
/// sections.
|
||||
pub fn annotation(&self, tag: &str) -> Option<&str> {
|
||||
self.tags.get(tag).map(String::as_str)
|
||||
}
|
||||
|
||||
/// The opening line of what a tag means, or `None` for a tag the file does not declare.
|
||||
///
|
||||
/// The cut to one line lives here rather than on the parse, the way
|
||||
|
||||
+997
-156
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user