-
Notifications
You must be signed in to change notification settings - Fork 7
Support column presets for pod table #783
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This feature enables users to define and use column presets for pod views, making it easier to switch between different column configurations. - Add column presets in config file - Add CLI option `--pod-columns-preset` to specify preset - Support default preset in config - Implement priority: CLI > Preset > Config Default > Built-in Default
Update the example configuration to demonstrate the new column presets feature for pod views. Replace the fixed default_columns with named presets 'default' and 'minimal', with 'minimal' set as the default preset when no CLI flag is specified.
Improve the documentation for the --pod-columns-preset flag to make it clearer that --pod-columns will override the preset when both options are specified.
0898711
to
c3d8ff4
Compare
Add documentation for the new pod columns preset feature that supports predefined column layouts for pod view. README now explains how users can: - Define custom column presets in config.yaml - Select presets via the --pod-columns-preset CLI flag - Set a default preset in their configuration This documents how users can manage different pod column layouts more conveniently for different use cases.
c3d8ff4
to
a163d34
Compare
Fix capitalization of "If" in the documentation and help text for the pod-columns-preset option to maintain consistent formatting style.
Extract the duplicate PodColumns conversion logic into a separate function named `convert_columns` to improve code maintainability and reduce duplication. This refactoring helps follow the DRY (Don't Repeat Yourself) principle and makes the code easier to maintain.
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.
Pull Request Overview
This PR adds support for column presets in the pod table, allowing users to configure which columns appear either via CLI flags or by defining presets in the configuration file.
- Updated PodThemeConfig to include new fields (default_preset and column_presets) while removing old default_columns.
- Added a new CLI flag (--pod-columns-preset) and implemented logic in build_pod_columns to determine which columns to show based on CLI arguments and config settings.
- Updated related documentation in example/config.yaml and README.md to explain the new functionality.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/config/theme/pod.rs | Refactored PodThemeConfig to use presets and added conversion logic for PodColumns. |
src/config/theme.rs | Removed deprecated PodConfig conversion to align with the new preset functionality. |
src/cmd/command.rs | Introduced a new CLI argument for specifying the pod columns preset. |
src/app.rs | Implemented build_pod_columns to handle the priority of CLI-specified columns over presets. |
example/config.yaml | Modified config example to include preset definitions for pod columns. |
README.md | Updated usage instructions and examples to document the new column preset feature. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.