Mark a relation by its kind rather than its target's status, and bump to 0.15.1
A column of ▁▄▆█ read as undifferentiated blocks. What is worth seeing at a glance is which kind of edge a row is: × for blocked by and blocks, → for relates to, ← for regression of and regressed by. The labels are five long words that blur when one ticket carries several, and the rows holding it up are now the crosses. Both directions of a kind carry one mark, since blocked by and blocks are the same edge read from two ends and the label is what says which end you are on. × is BLOCKED_MARK, the constant a held-up card already draws, in the same brightred. On a card it says this ticket is held up, in the block that this edge is what holds one, which is one word, so one glyph and one definition: the constant moved to util.rs, where both renderers can reach it. Brightred rather than the red asked for, because the id one cell to the right is red and the two would have blended. The arrows are the ones the footer already draws, so they render wherever it does, and no_relation_mark_is_a_priority_glyph pins all three against every level of the meter: the circles belong to priority. The mark now survives a target the board cannot find, because a kind is read from the ticket's own file rather than from the board. Only the name is gone, and `_missing_` in grey is what says so. That is one case fewer than the status mark had, which needed a `?` for a target with no status to show. What this gives up is the status: 6ce2c47's motivation was reading whether a blocker is finished without leaving the overlay, and nothing in the block shows that now. Its criteria 1 and 3 describe the commit before this one, and the ticket says so. RelationTarget went with it. Nothing read the status field once the mark stopped keying on it, and a field written but never shown is a field that goes stale unnoticed, so RelationRow carries the kind and the title and the status is one lookup away on the index if a later ticket wants it. A patch, not a second minor: 0.15.0 was the arrival of a mark and settling which glyph it is belongs to that, where a second minor would read as two features. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
ce32b42ae4
commit
5ae9c7fe00
+19
-17
@@ -1209,15 +1209,6 @@ fn aligned_offset(offset: u16, start: u16, end: u16, inner: u16, total: u16) ->
|
||||
offset.min(total.saturating_sub(inner))
|
||||
}
|
||||
|
||||
/// The mark a card carries while it waits on a ticket that is not done.
|
||||
///
|
||||
/// Not a fourth circle. The Geometric Shapes glyphs belong to the priority meter, and
|
||||
/// another one two cells away from it would read as part of that ramp rather than as a
|
||||
/// different fact. A multiplication sign is Latin-1, like the middle dot the unset
|
||||
/// priority draws, so it renders wherever the meter already does. That is the same
|
||||
/// safe-glyph rule that took the quadrant circles out of the ramp.
|
||||
const BLOCKED_MARK: &str = "\u{d7}";
|
||||
|
||||
/// One card as four corners with the title between them:
|
||||
///
|
||||
/// ```text
|
||||
@@ -4130,7 +4121,7 @@ mod tests {
|
||||
board: &Board,
|
||||
width: u16,
|
||||
height: u16,
|
||||
symbol: char,
|
||||
symbol: &str,
|
||||
) -> Option<ratatui::style::Color> {
|
||||
let mut terminal = Terminal::new(TestBackend::new(width, height)).unwrap();
|
||||
terminal.draw(|frame| draw(frame, board)).unwrap();
|
||||
@@ -4138,7 +4129,7 @@ mod tests {
|
||||
|
||||
(0..buffer.area.height)
|
||||
.flat_map(|y| (0..buffer.area.width).map(move |x| (x, y)))
|
||||
.find(|(x, y)| buffer[(*x, *y)].symbol() == symbol.to_string())
|
||||
.find(|(x, y)| buffer[(*x, *y)].symbol() == symbol)
|
||||
.map(|(x, y)| buffer[(x, y)].fg)
|
||||
}
|
||||
|
||||
@@ -4174,7 +4165,7 @@ mod tests {
|
||||
let mut board = one_board(&dir);
|
||||
board.toggle_detail();
|
||||
|
||||
let (mark, colour) = status_mark(Some("reviewing"));
|
||||
let (mark, colour) = relation_mark(RelationKind::BlockedBy);
|
||||
let detail = board.detail.as_ref().expect("no detail");
|
||||
assert!(
|
||||
detail.plain().contains(mark),
|
||||
@@ -4346,8 +4337,13 @@ mod tests {
|
||||
Some(Color::Red.into()),
|
||||
"the id went with the title it could not find"
|
||||
);
|
||||
// `?` rather than a stage of the flow, in grey rather than the status orange.
|
||||
assert_eq!(span_color(&row, "?"), Some(Color::Grey.into()));
|
||||
// The mark is the kind, read off this ticket's own file, so it survives a target
|
||||
// the board cannot find: only the name is gone.
|
||||
assert_eq!(
|
||||
span_color(&row, BLOCKED_MARK),
|
||||
Some(Color::BrightRed.into()),
|
||||
"the mark went with the title it could not find"
|
||||
);
|
||||
}
|
||||
|
||||
/// The detail view is the second renderer of a ticket body, so it resolves a
|
||||
@@ -4372,8 +4368,11 @@ mod tests {
|
||||
board.toggle_detail();
|
||||
|
||||
let text = &board.detail.as_ref().expect("no detail").plain();
|
||||
// Marked with the target's status, backlog, and the mark sits ahead of the id.
|
||||
assert!(text.contains("blocked by \u{2581} (2222222) The target"), "{text:?}");
|
||||
// Marked for its kind, and the mark sits ahead of the id.
|
||||
assert!(
|
||||
text.contains(&format!("blocked by {BLOCKED_MARK} (2222222) The target")),
|
||||
"{text:?}"
|
||||
);
|
||||
assert!(!text.contains(target), "the bare uuid was drawn: {text:?}");
|
||||
}
|
||||
|
||||
@@ -4397,7 +4396,10 @@ mod tests {
|
||||
board.toggle_detail();
|
||||
|
||||
let text = &board.detail.as_ref().expect("no detail").plain();
|
||||
assert!(text.contains("blocks \u{2581} (1111111) A holder"), "{text:?}");
|
||||
assert!(
|
||||
text.contains(&format!("blocks {BLOCKED_MARK} (1111111) A holder")),
|
||||
"{text:?}"
|
||||
);
|
||||
}
|
||||
|
||||
/// The detail view resolves the Campaign field the way `show` does. The field stores
|
||||
|
||||
Reference in New Issue
Block a user