Skip to content

feat(simulate): wrap --full-messages health output to the terminal width #613

Backlog

Description

@jcogilvie

What problem are you facing?

Raised by @adamwg in review of #554. Simulate's health output uses fixed widths (internal/health/format.go):

  • wrapRunes = 100: --full-messages wraps condition messages at 100 columns.
  • messageRunes = 120: one-line descriptions truncate the message at 120 runes, with an ellipsis.

Help output and styled output already size themselves to the terminal (cmd/crossplane/help.go:247, internal/style/style.go:34): each calls term.GetSize(os.Stdout.Fd()) and caps the result at 120. Health output doesn't, so --full-messages wraps badly in narrow terminals and wastes width in wide ones.

How could Crossplane help solve your problem?

  1. Pull the two existing term.GetSize + min(…, 120) call sites into one shared helper.
  2. Pass a width into health.Lines and health.Block instead of reading the terminal inside the formatter. Each caller (internal/plan/output.go, internal/simulate/result.go, internal/diff/renderer/health.go) sets it from the helper.
  3. When stdout isn't a terminal (pipes, CI logs, tests), fall back to the current fixed width, so output stays deterministic there.

Keep the one-line truncation fixed for now. It counts only the message, not the marker, tier and condition before it. Fitting it to the terminal needs prefix-aware budgeting, which can be its own change.

If #612's refactor lands first, the width becomes a renderer option there instead of being plumbed through each path.


Filed by an AI agent (Claude Code) on behalf of @jcogilvie.

Activity

  1. added
    enhancement
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions