Skip to content

feat: include a --no-wrap flag for table displays#3613

Merged
heroku-johnny merged 4 commits intomainfrom
table-no-wrap-flag
Apr 7, 2026
Merged

feat: include a --no-wrap flag for table displays#3613
heroku-johnny merged 4 commits intomainfrom
table-no-wrap-flag

Conversation

@heroku-johnny
Copy link
Copy Markdown
Contributor

@heroku-johnny heroku-johnny commented Mar 25, 2026

Summary

Adds a --no-wrap flag so tabular CLI output can stay on one line for easier copy/paste. Default behavior is unchanged (overflow: 'wrap'). With --no-wrap, tables use unbounded width (maxWidth: 'none') and overflow: 'truncate' for single-line cells.

The flag is defined in @heroku-cli/command (flags.noWrap(), v12.3.1+). This repo bumps that dependency and uses a small shared helper huxTableNoWrapOptions() in src/lib/utils/tableUtils.ts so the same layout rules are not duplicated.

Commands updated: domains, ps (extended table), pg:credentials, data:pg:credentials, addons.

Type of Change

Breaking Changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • fix: Bug fix
  • deps: Dependency upgrade (@heroku-cli/command)
  • revert: Revert a previous commit
  • chore: Change that does not affect production code
  • refactor: Shared huxTableNoWrapOptions helper
  • test: Add/update tests

Testing

Notes:
Manual check recommended on an app with long domain targets / wide addon rows. Automated tests stub hux.table (or assert the helper) where applicable.

Steps:

  1. npm run build
  2. node ./bin/run domains -a <app> and ... --no-wrap
  3. Optionally: ps -a <app> --extended --no-wrap, pg:credentials, data:pg:credentials, addons with --no-wrap
  4. npm run test:file -- test/unit/commands/domains/index.unit.test.ts test/unit/commands/ps/index.unit.test.ts test/unit/commands/pg/credentials.unit.test.ts test/unit/commands/data/pg/credentials/index.unit.test.ts test/unit/commands/addons/index.unit.test.ts test/unit/lib/utils/tableUtils.unit.test.ts

Screenshots (if applicable)

Related Issues

GitHub issue: #3605
GUS work item: W-21715803

Notes / Follow-up

  • Other hux.table call sites do not use --no-wrap unless we add the flag there later.
  • Optional future work: move huxTableNoWrapOptions into @heroku-cli/command if the team wants all table helpers in one package.

@heroku-johnny heroku-johnny changed the title feat: Include a --no-wrap flag for table displays feat: include a --no-wrap flag for table displays Mar 25, 2026
@heroku-johnny heroku-johnny changed the title feat: include a --no-wrap flag for table displays feat: include a --no-wrap flag for table displays Mar 25, 2026
@heroku-johnny heroku-johnny changed the title feat: include a --no-wrap flag for table displays feat: include a --no-wrap flag for table displays Mar 25, 2026
@heroku-johnny heroku-johnny marked this pull request as ready for review March 26, 2026 01:04
@heroku-johnny heroku-johnny requested a review from a team as a code owner March 26, 2026 01:04
@k80bowman
Copy link
Copy Markdown
Contributor

I'm not sure this is working as intended... I tried it with a couple of commands and had mixed results.

First I tried it with domains... Without the --no-wrap flag everything printed as expected. When I added the --no-wrap flag, the output appeared as expected, but when I the resized the terminal window smaller, then increased it again, the output disappeared.

  • original command run:
image
  • resized window smaller:
image
  • resized window larger:
image

Second I tried it with addons. Again, without the --no-wrap flag everything printed as expected. But when I added the --no-wrap flag, some of the data was cut-off and replaced with an ellipsis.
image

Are these expected?

@heroku-johnny
Copy link
Copy Markdown
Contributor Author

heroku-johnny commented Apr 7, 2026

For the domain command, that is expected. Once the data is rendered to the terminal then the terminal controls the display.

Regarding the addons command, I'm looking at that. I saw that before in the domain command so must have just missed something there.

**Update: For the addons command the issue was that the column is multi-lined so it's acting odd. I'm pushing up a fix for that though now

Copy link
Copy Markdown
Contributor

@k80bowman k80bowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for the update.

@heroku-johnny heroku-johnny merged commit 1d27c09 into main Apr 7, 2026
17 checks passed
@heroku-johnny heroku-johnny deleted the table-no-wrap-flag branch April 7, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants