Liking cljdoc? Tell your friends :D

TUI text width policy

This document is the canonical developer-facing width-policy summary for user-visible TUI text surfaces.

Policy matrix

SurfaceText classWidth policyPrefix-budget ruleContinuation ruleProof location
Startup banner Model:label+value summarywrapsubtract visible width of " Model: "continuation aligns under value startpsi.tui.app-test/startup-banner-metadata-wraps-at-terminal-width-test
Startup banner Prompts:label+value summarywrapsubtract visible width of " Prompts: "continuation aligns under value startpsi.tui.app-test/startup-banner-metadata-wraps-at-terminal-width-test
Startup banner Skills:label+value summarywrapsubtract visible width of " Skills: "continuation aligns under value startpsi.tui.app-test/startup-banner-metadata-wraps-at-terminal-width-test
Startup banner Exts:label+value summarywrapsubtract visible width of " Exts: "continuation aligns under value startpsi.tui.app-test/startup-banner-metadata-wraps-at-terminal-width-test
Startup banner controls/helpcontrols summarywrapsubtract visible width of " "continuation aligns under content start after the base indentpsi.tui.app-test/startup-banner-metadata-wraps-at-terminal-width-test
Transcript user messagetranscript linewrapsubtract visible width of "刀: "continuation aligns under content startfocused unit test in psi.tui.app-view-runtime-test
Transcript assistant messageparagraph-like transcript / markdownwrap for paragraphs, preserve for code blockssubtract visible width of "ψ: " from paragraph widthcontinuation aligns under content start; implemented through width-aware markdown paragraph rendering, while markdown code blocks preserve width intentionallyfocused unit test in psi.tui.app-view-runtime-test
Transcript thinking messagethinking transcript linewrapsubtract visible width of "· "continuation aligns under content startfocused unit test in psi.tui.app-view-runtime-test
Rich transcript variants (agent-result, plan-state-learning)heading + indented bodymixedheadings are short labels; body uses the local body indent budgetcontinuation aligns under the variant body indentexisting variant render tests plus focused narrow-width tests where added
Tool header summary, collapsedcompact tool headertruncatesubtract visible width of " <status> "none; single-line compact summaryfocused unit test in psi.tui.app-view-runtime-test
Tool body, expanded, plain texttool bodywrapsubtract visible width of four-space body indentcontinuation aligns under body text indentfocused unit test in psi.tui.app-view-runtime-test
Tool body, expanded, warning linestool body warningwrapsubtract visible width of four-space body indentcontinuation aligns under body text indentfocused unit test in psi.tui.app-view-runtime-test
Tool body, expanded, preformatted/code-like outputpreformatted bodypreserve unless promoted to plain-text rendering by an explicit rendererexplicit indent only; no semantic reflowpreserve source line structure intentionallydocumented policy in this file; current focused proof is the negative scope boundary around plain-text wrapping in psi.tui.app-view-runtime-test/expanded-tool-body-wraps-at-narrow-width-test
Input editor before submiteditor inputwrapsubtract visible width of prompt prefixcontinuation aligns under content startexisting wrap-text-input-* tests
Prompt autocomplete rowsselector rowtruncatefull row width is the available widthnone; compact row summaryexisting autocomplete tests
Dialog/selectorsselector/input rowstruncate for compact option rows, preserve simple structural layoutfull row width is the available widthno paragraph continuation rule todayexisting dialog/selector tests
Footer path/model/status linesfooter summariesmixed truncate/layout-fitsurface-specific line budgetno paragraph continuation; footer is a compact status surfaceexisting footer tests

Rules

  • wrap: fit visible content within available width using continuation lines.
  • truncate: shorten deterministically to fit available width.
  • preserve: keep source line structure intentionally; overflow behavior is not accidental.
  • Default continuation rule for wrapped human-readable text: continuation lines align under the content start after prefix subtraction.

Current shared rule shapes

  1. Prefixed wrapped line

    • Used directly for user transcript and thinking transcript.
    • The assistant paragraph transcript follows the same visible-width/continuation contract, but is implemented through the markdown renderer rather than this helper shape.
    • Budget: available-width = terminal-width - visible-width(prefix).
    • Continuation: prefix-width spaces.
  2. Label+value wrapped summary

    • Used for startup banner metadata.
    • Budget: available-width = terminal-width - visible-width(label-prefix).
    • Continuation: spaces matching the full label prefix width so wrapped values align under the value region.
  3. Compact status/header truncation

    • Used for collapsed tool headers and several selector/footer rows.
    • Budget: full available row width after fixed leading status/padding.
    • Continuation: none.

Inventory boundaries

In scope for task 066:

  • startup banner metadata
  • submitted transcript rendering for user / assistant / thinking
  • tool header/body rendering
  • editor-adjacent TUI text surfaces where width behavior is user-visible

Out of scope for task 066:

  • Emacs UI
  • non-TUI adapters
  • broad visual redesign

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close