Skip to main content

max / makeover-tui

0.29.1: a markdown field gets the rows a textarea does makeover-layout 0.30.0 adds FieldKind::Rich, and field_height keyed its three rows on the member rather than on the kind, so a markdown field fell through to the single-row arm -- one line for a value whose whole point is that it has several. Keyed on FieldKind::multiline now, which is the method that arrived upstream for exactly this. A terminal does nothing with the markdown itself, and that is the honest answer rather than a gap: the source is the text, and drawing it as text loses nothing.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-18 20:30 UTC
Signed with PGP, not checked
Commit: e14f2d08bea9855e8cbb1ba15738913e859eee58
Parent: 82861d3
2 files changed, +26 insertions, -3 deletions
M Cargo.toml +2 -2
@@ -1,6 +1,6 @@
1 1 [package]
2 2 name = "makeover-tui"
3 - version = "0.29.0"
3 + version = "0.29.1"
4 4 edition = "2024"
5 5 description = "The terminal renderer for makeover-layout, on ratatui. Colour stops being the constraint above 256 entries; geometry never does, because an edge occupies a whole cell on every side."
6 6 license = "MIT"
@@ -19,7 +19,7 @@
19 19 # compile against an API added in a later one -- which is what `Depth::Overlay`
20 20 # would do here. The rest of the suite has pinned this way since
21 21 # makeover-webview found it the hard way.
22 - makeover-layout = "0.29.1"
22 + makeover-layout = "0.30.0"
23 23 makeover = { version = "3.0", optional = true }
24 24
25 25 [lints.rust]
M src/piece.rs +24 -1
@@ -410,7 +410,13 @@
410 410 // and the reading are one line by construction, and a bar that wrapped
411 411 // would stop being a bar.
412 412 let body = match field.kind {
413 - FieldKind::Textarea => 3,
413 + // Both multi-line kinds get the same three rows, keyed on the
414 + // description's own `multiline` rather than on the member: a markdown
415 + // field falling through to the single-row arm is one line for a value
416 + // whose whole point is that it has several. What a terminal does *with*
417 + // the markdown is another question and the answer here is nothing --
418 + // the source is the text, and drawing it as text is honest.
419 + kind if kind.multiline() => 3,
414 420 kind if kind.offers_options() => u16::try_from(field.options.len()).unwrap_or(u16::MAX),
415 421 _ => 1,
416 422 };
@@ -1021,6 +1027,23 @@
1021 1027 assert_eq!(rows(&buf)[1], "[ ]");
1022 1028 }
1023 1029
1030 + #[test]
1031 + fn a_markdown_field_gets_the_rows_a_textarea_does() {
1032 + // Keyed on `multiline`, so a member added upstream does not silently
1033 + // land on the single-row arm. One row for a value whose whole point is
1034 + // that it has several is the failure this replaced.
1035 + let style = PieceStyle::default();
1036 + let rich = Field::new(FieldKind::Rich, "body", "Body");
1037 + let textarea = Field::new(FieldKind::Textarea, "body", "Body");
1038 + let plain = Field::new(FieldKind::Text, "body", "Body");
1039 +
1040 + assert_eq!(
1041 + field_height(&style, &rich, 40),
1042 + field_height(&style, &textarea, 40)
1043 + );
1044 + assert!(field_height(&style, &rich, 40) > field_height(&style, &plain, 40));
1045 + }
1046 +
1024 1047 #[test]
1025 1048 fn a_tone_and_a_heading_map_without_a_fallback_arm() {
1026 1049 // Both source enums are closed, which is what lets these be total. A