-
Notifications
You must be signed in to change notification settings - Fork 44
feat: add title to tables and improve output structure #364
Conversation
Not sure if this would be a breaking change or not, but considering it's just human readable output I think a minor version bump would be fine. Thoughts @oclif/admins? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of sfdx-cli's existing tables use the styledHeader
this.ux.styledHeader(
Users in org ${this.org.getOrgId()});
suggestion: bold the header like that does (but don't use the ===
stuff since there's already plenty of borders in this PR.
then maybe that sets the header off enough visually that you don't need the row of ===
that this PR adds?
I like yours better with the solid line down the side. Maybe that's just the font but it looks good. |
src/styled/table.ts
Outdated
for (const col of columns) { | ||
const header = col.header! | ||
headers += header.padEnd(col.width!) | ||
} | ||
options.printLine(chalk.bold(headers)) | ||
|
||
// print header dividers | ||
let dividers = '| ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the |
devider also be between all columns? SHould both of these be configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amphro Geordie brought that up during one of the previous design sessions and we basically all said in the name of saving space they weren't needed between columns. That's why they don't show up in the env command spec.
I could make them configurable but I don't think it's necessary since it's a straight up improvement over the old format that was harder to read and it's a human readable format so we're not breaking (or shouldn't be) things for people.
@mshanemc yeah that's definitely just my font. I use The Fira Code Nerd Font with ligatures for coding & my terminal. |
@oclif/admins any more thoughts/QA on this before we merge? |
What does this PR do?
Makes the table output more readable and allows adding a title with a divider to a table.
Before
After
GUS Work Item
@W-9103917@