fix: restore human format table display for get and list commands #1101
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.
Summary
Fixes broken human format output in
km getandkm listcommands caused by #1100, which wrapped ContentDto objects in anonymous types that broke HumanOutputFormatter's type checking. This PR restores the table display functionality and improves the human format by:ContentDtoWithNodewrapper class instead of using anonymous objectsBefore: Human format was broken (displayed as JSON instead of tables)
After: Clean tables showing only essential information: Node, ID, Content, Title, Description, Tags
Changes
src/Core/Storage/Models/ContentDtoWithNode.cs- Proper wrapper class for content with node informationsrc/Main/CLI/Commands/GetCommand.cs- UsesContentDtoWithNode.FromContentDto()instead of anonymous objectsrc/Main/CLI/Commands/ListCommand.cs- UsesContentDtoWithNode.FromContentDto()for list itemssrc/Main/CLI/OutputFormatters/HumanOutputFormatter.cs- AddedFormatContentWithNode()andFormatContentWithNodeList()methodsHuman Format Display
km get (normal mode):
km get (verbose mode adds):
km list (normal mode):
| Node | ID | Content Preview |
Test Plan
km getdisplays table with node informationkm listdisplays table with node columnStats
ContentDtoWithNode)Breaking Changes
None - this is a bug fix that restores expected functionality and improves UX