Skip to content

feat(cli): preserve table column order #16843

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

Merged
merged 8 commits into from
Mar 10, 2025
Merged

feat(cli): preserve table column order #16843

merged 8 commits into from
Mar 10, 2025

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Mar 7, 2025

Fixes: #16055

This PR modifies table rendering code in CLI to preserve the same order of columns as selected with --column.

@mtojek mtojek self-assigned this Mar 7, 2025
@mtojek mtojek changed the title 16055 column sorting feat(cli): preserve table column order Mar 7, 2025
@mtojek mtojek requested a review from mafredri March 7, 2025 13:35
@mtojek mtojek marked this pull request as ready for review March 7, 2025 13:35
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Elegant solution ❤️, did not think it would be this easy, thanks!

Do we need an explicit test? We already have a bunch of golden files that implicitly test it though so I could go either way.

mtojek and others added 3 commits March 10, 2025 12:25
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@mtojek
Copy link
Member Author

mtojek commented Mar 10, 2025

Do we need an explicit test? We already have a bunch of golden files that implicitly test it though so I could go either way.

Looking at the number of golden files affected by changes introduced in this PR, I would say we're fine :)

@mtojek mtojek force-pushed the 16055-column-sorting branch from c8c3f89 to b01c35f Compare March 10, 2025 12:13
@mtojek mtojek enabled auto-merge (squash) March 10, 2025 12:15
@mtojek mtojek merged commit 4b1da9b into main Mar 10, 2025
32 checks passed
@mtojek mtojek deleted the 16055-column-sorting branch March 10, 2025 12:28
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add column ordering support to cliui table
2 participants