// Renders one `TermRow` — flat `
{lines.map((line, i) => {
const cls = line.startsWith("+ ")
? "diff-add"
: line.startsWith("- ")
? "diff-del"
: "diff-ctx";
return (
{line}
{"\n"}
);
})}
);
}
// A row that a preference can hide: a `debug` row ("hide developer details")
// or a thinking row ("show thinking"). It follows them as they change. Only
// these rows subscribe, so a long terminal does not hold a listener per row.
function FilterableRow({ row }: { row: TermRow }) {
const [hideDebug, setHideDebug] = useState(() => getHideDebugPref());
const [showThinking, setShowThinking] = useState(() => getShowThinkingPref());
useEffect(
() => subscribeHideDebugPref(() => setHideDebug(getHideDebugPref())),
[],
);
useEffect(
() =>
subscribeShowThinkingPref(() => setShowThinking(getShowThinkingPref())),
[],
);
// A hidden row is a skip, not a dimmer — it occupies no DOM node at all, same
// as it never streamed, rather than a CSS `display: none` that would keep it
// in the layout/DOM for no benefit.
return rowHidden(row, hideDebug, showThinking) ? null : {linkifyToNodes(row.body)}
)}