Commit graph

12 commits

Author SHA1 Message Date
Babak K. Shandiz
f62875fb63
fix(discussion list): quote author qualifier in web mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 15:05:22 +01:00
Babak K. Shandiz
8d70cc9ca8
refactor(discussion list): encapsulate printing within printDiscussions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 15:03:02 +01:00
Babak K. Shandiz
d45ce940eb
refactor(discussion list): inline printed messages
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 15:00:17 +01:00
Babak K. Shandiz
2d1b1a79bf
fix(discussion list): only print remaining items in tty mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 14:52:05 +01:00
Babak K. Shandiz
835d7f3a48
fix(discussion/client): remove reaction groups from list/search types
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 14:50:40 +01:00
Babak K. Shandiz
2a46a9d733
fix(discussion/client): change list return type to pointer
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 12:24:08 +01:00
Babak K. Shandiz
034e38f0e7
fix(discussion/client): fetch author/answerChosenBy fields
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 12:11:00 +01:00
Babak K. Shandiz
236224dc44
fix(discussion list): replace state with closed in domain types
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 11:52:52 +01:00
Babak K. Shandiz
3f52503a67
fix(discussion list): use separate list of fields
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-04-14 11:45:55 +01:00
Max Beizer
a08f5f22f0
Fix gofmt alignment in test file
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-13 10:24:52 -05:00
Max Beizer
e84ecb1585
Address review feedback on discussion list PR
- Export domain consts (FilterStateOpen/Closed, OrderByCreated/Updated,
  OrderDirectionAsc/Desc) in types.go
- Change State fields to *string (nil = all states)
- Add DiscussionListResult type with NextCursor for pagination
- Update List/Search signatures: add after param, return result type
- Add limit <= 0 guard clauses in client methods
- Replace strings.ToUpper/ToLower with switch statements + default errors
- Rename pageLimit to remaining, hoist hasDiscussionsEnabled check
- Use qualifier/keyword terminology in search query building
- Quote author values with %q for whitespace safety
- Add Keywords string field (single string, not []string)
- Split --order into --sort {created|updated} and --order {asc|desc}
- Add --search/-S and --after flags
- Add next field in JSON output envelope
- Extract defaultLimit const
- Add toFilterState helper for CLI-to-domain mapping
- Move matchCategory to shared/categories.go with godoc
- Use single-line error messages with sorted slugs
- Add (preview) annotations to Short docs
- Update Use to "list [flags]"
- Add examples for --answered=false, --state all, multi-label
- Update tests for new signatures and new flags

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-13 10:20:09 -05:00
Max Beizer
90449b5197
Implement gh discussion list command
Add the discussion list command with full support for:
- Listing discussions with state, category, answered, and order filters
- Searching discussions by author and labels (uses Search API)
- Category resolution by slug or name (case-insensitive)
- TTY and non-TTY table output with colored IDs and labels
- JSON output with totalCount envelope
- Web mode (--web) to open discussions in browser
- Pagination for large result sets

Implement List, Search, and ListCategories methods on the
DiscussionClient. List and Search use plain text GraphQL for
flexible variable handling. ListCategories uses safely typed
GraphQL via shurcooL/githubv4.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 12:46:28 -05:00