Skip to content

feat(issue-list): show labels in compact output when filtering by --labels - #211

Merged
ruby-automation merged 2 commits into
mainfrom
EXT-28-show-labels-in-filtered-issue-list
Sep 4, 2026
Merged

feat(issue-list): show labels in compact output when filtering by --labels#211
ruby-automation merged 2 commits into
mainfrom
EXT-28-show-labels-in-filtered-issue-list

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • When lc issue list -l/--labels is used, each result issue's label names now appear in square brackets at the end of the compact output line (e.g. CRY-1 [In Progress] Fix the thing [Bug, Feature]).
  • Without --labels, compact output is completely unchanged — the list query still uses base_fields without a labels selection, so there's no extra API payload.
  • JSON output automatically includes labels when they're fetched (to_plain/1 serialises the whole struct).

Changes

  • app/lib/linear_cli/linear/issue.ex: Added Issue.list_fields_with_labels/0 (extends base_fields with labels { nodes { ... } }). Issue.Read.List now branches on args.labels != [] to select the label-aware query document.
  • app/lib/linear_cli/cli/display.ex: issue_line/2 accepts opts and appends [Label, ...] when opts.labels is truthy and the issue has labels.
  • app/lib/linear_cli/cli/commands.ex: Passes labels: input.labels != [] to Display.show/2.

Test plan

  • display_test.exs: compact line with labels shown when labels: true; brackets omitted when labels: false; brackets omitted when issue has no labels even if labels: true
  • issue_test.exs: query document contains labels { when filtering by labels; no labels { when not filtering; label names parsed from response
  • issue_commands_test.exs: short -l flag shows labels; long --labels flag shows labels; multiple comma-separated labels all appear; compact listing without --labels does not show brackets
  • All 403 pre-existing passing tests still pass (2 GitTest failures are pre-existing and unrelated to this change)

Closes EXT-28

🤖 Generated with Claude Code

@ruby-automation
ruby-automation force-pushed the EXT-28-show-labels-in-filtered-issue-list branch from 9628ad0 to 1f4e9e8 Compare September 4, 2026 17:28
…abels

When `lc issue list -l/--labels` is used, the compact output now includes
each issue's label names in square brackets at the end of the line. Without
`--labels`, compact output is unchanged (no extra API payload).

- Add `Issue.list_fields_with_labels/0` that extends `base_fields` with labels
- Branch in `Issue.Read.List` to use the label-aware query only when labels
  were requested
- Teach `Display.issue_line/2` to append `[Label, ...]` when the `labels`
  opt is truthy
- Pass `labels: input.labels != []` from `Commands.issue_list/1` to Display
- Add tests for query doc selection, label parsing, Display rendering, and
  end-to-end CLI output (short `-l`, long `--labels`, multiple labels,
  no-filter baseline)

Closes EXT-28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant