1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! **How a row is built** — the identity it wears, the constructor every
//! variant funnels through, and the preview/body split that decides what a
//! `▶` has to reveal.
//!
//! Split from [`super`] at §12's per-file budget, on the seam the parent's own
//! doc already names: *what an entry becomes* is the exhaustive per-variant
//! match up there; *what a row is made of* is here. Nothing in this file knows
//! the entry vocabulary — it takes a prefix, a payload and a class — which is
//! why the two change for unrelated reasons.
use ;
use crateRole;
/// Key namespace for a transcript row's fold override (see [`super::super`]).
const KEY_ROOT: &str = "tx";
/// Characters of payload a contracted row previews before the ellipsis.
const PREVIEW_CAP: usize = 160;
/// A row's stable identity: the entry's filename and the block ordinal.
/// `pub(crate)` because the step spine's placement derivation
/// (`crate::rail::place`) names the row each rule paints above by this same
/// key — one spelling of the identity, not two.
pub
/// Build a row, splitting `payload` into its one-line preview and the body
/// that folding reveals. `expanded` is filled by [`rows`]. `role` is who the
/// row speaks for (§11 role stripe) — `None` on machinery, where nobody is.
pub
/// State in the prefix how big the fold is, in **characters** (bl-1f75,
/// operator: *"I'd like tool result collapses to show me the number of
/// characters in the output"*). Characters, not bytes: a byte count lies about
/// any payload carrying non-ASCII, and this seat is read by a human sizing up
/// a click.
///
/// The count is the **body's** — what the `▶` opens onto — which makes "a row
/// with nothing to fold says nothing" the same rule as the toggle's own, not a
/// second one about small payloads (see [`split`]: the empty body *is* the
/// fact). It also means the plural never arises: a body exists only where the
/// payload is clipped or multi-line, so it is never one character long.
///
/// Derived at projection time from the payload the entry already carries — no
/// field, no cache, nothing stored (§11: the row is a pure projection).
pub
/// Split a payload into `(one-line preview, foldable body)`. The body is
/// **empty** when the payload is already one line short enough to show whole
/// — the row then has nothing to fold, which is why no separate "foldable"
/// flag exists (the empty body *is* the fact).