(2733b10) Colour the history block, and indent a comment's body deeper, and bump to 0.31.3

The block shipped with three painted things: the heading, the kind label
and the actor with its timestamp as one cyan span. Every value in it was
plain, so a status entry drew two status names in no colour while the
same names are orange in the metadata table three lines above, and a tags
entry drew its tags without the slots every other view gives them.

The kind label is now grey, as chrome that names a row. It was orange,
which means Status everywhere else, so an `owner` or `tags` label claimed
a meaning belonging to the value beside it. `From` on a comment's author
line goes grey for the same reason.

Each value takes the meaning its field carries in the metadata table:
status orange, tags through the same `tag_cells` the Tags field uses, a
campaign codename through `tag_color` bare the way `Codename` is, an
owner plain, and `_Not set_`, `_None_` and `_missing_` grey. The
separator is a constant beside `change`, with `split_change` next to it,
so the writer and the reader cannot disagree about what divides the two
halves.

The actor is drawn through `tag_color`, so one writer is one colour in
every entry it wrote, and cyan goes back to meaning the timestamp alone.

A comment's body moves to four spaces and the author line stays at column
0, so an indented line is somebody's own words and a line of values at
column 0 is the tool reporting itself.

The padding is still measured on the unpainted label, now pinned with the
alignment test running both ways.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ansho Rei
2026-08-25 10:54:36 +02:00
co-authored by Claude Opus 5
parent ab337ca7f8
commit 45b513bdce
8 changed files with 314 additions and 90 deletions
+13 -9
View File
@@ -5120,6 +5120,11 @@ mod tests {
///
/// Paired the way the guideline demands: a renderer that dropped every colour would
/// pass the no-escape half, so the presence is asserted beside it.
///
/// The spans it looks for are 2733b10's: the label went grey as chrome, the values
/// took the meanings they carry in the metadata table, and the actor came away from
/// the timestamp so a name is one colour and cyan is the stamp's alone. Asserted on
/// the board as well as in `show`, because these are the cells both render.
#[test]
fn the_history_block_is_styled_in_the_overlay_and_no_escape_reached_it() {
let dir = board_dir();
@@ -5147,17 +5152,16 @@ mod tests {
assert_eq!(span_color(&heading, "HISTORY"), Some(Color::Orange.into()));
let from = body_line(detail, "From bob");
assert_eq!(
span_color(&from, "From bob (2026-08-21 12:00:01)"),
Some(Color::Cyan.into())
);
assert_eq!(span_color(&from, "From"), Some(Color::Grey.into()));
assert_eq!(span_color(&from, "bob"), Some(tag_color("bob").into()));
assert_eq!(span_color(&from, "2026-08-21 12:00:01"), Some(Color::Cyan.into()));
let change = body_line(detail, "backlog → committed");
assert_eq!(span_color(&change, "status"), Some(Color::Orange.into()));
assert_eq!(
span_color(&change, "claude (2026-08-21 12:00:00)"),
Some(Color::Cyan.into())
);
assert_eq!(span_color(&change, "status"), Some(Color::Grey.into()));
assert_eq!(span_color(&change, "backlog"), Some(Color::Orange.into()));
assert_eq!(span_color(&change, "committed"), Some(Color::Orange.into()));
assert_eq!(span_color(&change, "claude"), Some(tag_color("claude").into()));
assert_eq!(span_color(&change, "2026-08-21 12:00:00"), Some(Color::Cyan.into()));
// The other half: the colour arrived as styles, not as bytes.
assert!(