Skip to content

resources: unify resolve-time leading blank across show and set #380

Description

@LukasWodka

Follow-up from #375 (banner removal). Low-severity cosmetic. Raised 2026-07-21.

Context

Removing the intro Banner left resources show and resources set handling the leading blank line differently:

  • runResourcesShow prints p.Newline() before resolveClusterTarget, so a resolve-time message (the multi-client redirect Infof in discoverRelease) gets a leading blank.
  • runResourcesSet has no leading Newline() before resolve, so in the multi-client case its first printed line (the redirect) opens with no blank.

Bugbot flagged this on #375 ("Missing lead blank on set path"). It only manifests when the resolve step prints a redirect line (multiple clients / fallback scan); single-client resources set is unaffected.

Why it wasn't fixed in #375

The naive fix — give set the same pre-resolve Newline()re-introduces the double-blank that #375 fixed (6afdd70): a leading Newline() stacks with the self-leading PromptHint (confirm) and Section (dry-run) to produce two blank lines.

Proposed fix

Standardize resolve-time spacing so it's correct for every command, not per-caller:

  • Make the shared resolve-redirect message in discoverRelease self-lead (emit its own leading blank), so any command that hits it gets exactly one blank — no per-command pre-resolve Newline() needed.
  • Move resources show's leading blank from before resolve to inside renderResources (before the first Stat), so it isn't stacked on top of the now-self-leading redirect in the multi-client case.
  • resources set then needs no command-level leading Newline() (keeps the ui: remove the shared Banner method (no intro banner on any command) #375 double-blank fix intact); its no-op/phantom Newline()s and the self-leading confirm/dry-run paths stay as-is.

Acceptance

  • Multi-client resources set opens with exactly one leading blank.
  • resources show (single + multi-client) still opens with exactly one blank — no double.
  • No regression to the ui: remove the shared Banner method (no intro banner on any command) #375 double-blank fix (confirm + dry-run paths).
  • Other discoverRelease-resolving commands (data list/delete/ingest, cluster info) still open with one leading blank in both single- and multi-client cases.

References

Metadata

Metadata

Assignees

Labels

work-type:tech-debtRefactor / cleanup, no behavior change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions