Repository navigation
fix(list): render rows in 'cu list list' table output - #59
Merged
Merged
Conversation
The table branch type-switched on map[string]interface{} while the
collected items were clickup.List structs, so every row was dropped.
Collect into []clickup.List and build rows with listTableRows so the
compiler catches this class of bug. The tasks column is now populated
from task_count. JSON/YAML/CSV output is unchanged.
Closes #24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
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.
Summary
cu list listprinted an empty table becauselistListCmdcollectedclickup.Liststructs into[]interface{}while the table branch only type-switched onmap[string]interface{}, so no row matched.-o jsonwas unaffected.[]clickup.List, which removes the type switch entirely and lets the compiler catch this kind of mismatch.listTableRows(package-levellistRow, json+yaml tags) so it can be tested.taskscolumn is now filled fromtask_count. Before this change the field existed but was never set.clickup.Listvalues.TestListTableRowsrenders throughoutput.TableFormatterand checks there is one line per list, plus the default marker and task counts.Live read-only check against a real space: table 9 rows,
-o json9,-o yaml9.Related, not changed here: on a cache hit,
cu space listsends the cached[]interface{}(decoded maps) straight to the formatter, skipping thespaceRowprojection. Table output on a cache hit therefore shows every raw field, not the id/name/private/archived columns. This is a different bug from the type switch fixed here.Closes #24
Checklist
./scripts/ci.shpasses locally (orgo test -race ./...at minimum): rango build,go vet,go test ./...and gosec v2.28.0, all cleanfeat:,fix:,docs:,chore:,ci:,test:)cu docs markdown --dir docs/site/commands): N/A, help text unchanged🤖 Generated with Claude Code