Skip to content

Label wrapping issues in prompts that do not handle long labels #556

@aqeelat

Description

@aqeelat

Context

This came up while evaluating @clack/prompts as a potential replacement for enquirer.js, comparing it with enquirer.js and @inquirer/prompts.

Split out from: #550

Problem

Some prompts may not handle long labels consistently.

For table-style labels with fixed-width columns, automatic wrapping can break visual alignment:

typescript-eslint       8.59.3  ❯  8.59.4       @scope/project   https://typescript-eslint.io/...
vitest                  4.1.6   ❯  4.1.7        @scope/project   https://vitest.dev

If one row wraps and another does not, the columns become difficult to scan:

│ ◻ typescript-eslint       8.59.3  ❯  8.59.4       @scope/project
│  https://typescript-eslint.io/packages/typescript-eslint
│ ◻ vitest                  4.1.6   ❯  4.1.7        @scope/project   https://vitest.dev

Proposal

Audit prompts that render labels and open/fix bugs for any prompt that does not already handle long labels correctly.

Possible solutions could include:

  • Consistent wrapping behavior across prompt types
  • A wrap: false option
  • A maxLabelWidth option
  • Better support for rendering secondary information separately, such as through hint

Notes

The maintainer noted that most prompts already handle wrapping, so this issue should focus only on prompts where wrapping is currently missing or inconsistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions