Skip to content

Inconsistent Table Header Styling - No Longer Bold After Upgrade #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulaldridge opened this issue Apr 25, 2025 · 2 comments
Open

Comments

@paulaldridge
Copy link

Hi team,

We've noticed a change in table output formatting after upgrading the SDK. Specifically, table headers are no longer rendered in bold, which seems to conflict with the IBM Cloud CLI plugin developer guide.

What's Happening

In PrintableTable.Print(), a go-pretty table writer is created and configured, but header styling is not explicitly set:

tbl := table.NewWriter()
tbl.Style().Format.Header = text.FormatDefault

Version History

We observed this behaviour when upgrading from:

  • github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.5.0
    to
  • v1.6.2 (which introduced go-pretty/v6 v6.6.1)

We also tried updating to v1.7.1, and the behaviour remains unchanged - headers still render as plain text.

Developer Guide Inconsistency

According to the IBM Cloud CLI Plugin Developer Guide (Section 2.11):

  1. Table header should be bold.
  2. Each word in table header should be capitalized.
  3. The entity name or resource name in table (usually the first column) should be cyan with bold.

This suggests that bold headers are still part of the intended user experience.

Proposed Fix

To align with the documented guidance and preserve visual consistency across CLI plugins, consider adding this line to PrintableTable.Print():

tbl.Style().Color.Header = text.Colors{text.Bold}

This would restore bold headers and ensure compatibility with future go-pretty updates.

Questions

  • Was bold header styling previously expected, or was it incidental due to changes in go-pretty?
  • Would the team be open to explicitly restoring header styling as part of the SDK?
  • Would you accept a PR for this fix? (When I tested this fix on a branch, tests failed as they were not expecting bold headers)

Thanks for maintaining the SDK! Happy to help further if needed.

@paulaldridge
Copy link
Author

Here's a comparison of our current live CLI plugin version, against what a local build using the updated SDK:
Image

@Aerex
Copy link
Collaborator

Aerex commented Apr 28, 2025

Thanks for the thorough writeup for this issue.

Questions

* Was bold header styling previously expected, or was it incidental due to changes in `go-pretty`?

Yes, it was incidental due to the change to using go-pretty

* Would the team be open to explicitly restoring header styling as part of the SDK?

Yes

* Would you accept a PR for this fix? (When I tested this fix on a branch, tests failed as they were [not expecting bold headers](https://github.com/IBM-Cloud/ibm-cloud-cli-sdk/blob/master/bluemix/terminal/table_test.go#L22))

Yes. That is a good catch. We have not been testing bold in the headers.

Thanks for maintaining the SDK! Happy to help further if needed.

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

No branches or pull requests

2 participants