Documentation
¶
Overview ¶
Package diff renders the TUI's diff page: two versions of one entry compared with github.com/aymanbagabas/go-udiff (the same engine the CLI uses), colorized per line in a scrollable viewport. The default layout is a unified diff; `s` toggles a SIDE-BY-SIDE (two-column, old | new) layout that degrades back to unified on a terminal too narrow to split (#674). Both layouts share the same udiff engine — side-by-side is a rendering option, not a second diff. A value that parses as JSON is ALWAYS pretty-printed before diffing (parity with the GUI, which formats every JSON value; #732) — no manual toggle — in both columns. When pretty-printing collapses the two sides to identical text even though the raw values differ (a whitespace-only difference), the page says so rather than showing a bare "(no differences)".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the diff page: it fetches two versions' values once, then renders (and re-renders, for parse-json) their unified diff.
func New ¶
New builds a diff page from a navigation request. ctx is the Run context threaded through the fetch. It does not fetch yet; Init dispatches the load.
func NewStatic ¶
NewStatic builds a diff page over already-known content (no fetch). It backs the staging page's remote-vs-staged detail, where the two sides are the staged review's values rather than two provider versions. Secret masking is honored exactly as in the fetched path.
func (*Model) HelpKeyMap ¶
HelpKeyMap reports the diff page's context-aware bindings for the help bar: scroll always, the layout toggle (`s`, side-by-side ⇄ unified) on a loaded diff, the mask toggle only on a loaded secret diff (`x` is a no-op on a non-secret diff, so it is hidden there), then back. The help bar makes `s`/`x`/esc discoverable — previously undocumented (#681, #674).
func (*Model) Init ¶
Init dispatches the one-shot version-contents fetch, or nothing for a static page whose content is already known.