Skip to content

feat(issue): add -w/--web flag to lc issue view - #204

Merged
ruby-automation merged 1 commit into
mainfrom
ext-20-issue-view-web-flag
Sep 3, 2026
Merged

feat(issue): add -w/--web flag to lc issue view#204
ruby-automation merged 1 commit into
mainfrom
ext-20-issue-view-web-flag

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • Adds --web/-w flag to lc issue view: resolves the issue normally, then opens its Linear URL in the system default browser and skips terminal output — matching gh issue view -w behavior
  • Adds url attribute to the Issue resource (included in both base_fields/0 and full_fields/0 GraphQL selections)
  • Creates LinearCli.Browser.open_url/2 — cross-platform browser launcher (xdg-open / open / cmd /c start) with an injectable opener for test doubles, same pattern as IssueHelpers.create_pr!/3's runner
  • Updates Readme.adoc with --web/-w usage examples

Closes

EXT-20

Test plan

  • --web opens the issue URL in the browser and prints nothing (injectable opener, asserts URL)
  • -w short flag works via the same injectable-opener path
  • --web --output json still opens browser and prints nothing (browser wins)
  • LinearCli.Browser.open_url/2 unit test with injected opener and error path
  • Existing issue view tests (text, JSON, alias) pass unchanged
  • mix ci clean (format, credo, usage_rules, tests) — one pre-existing flaky test in git_test.exs unrelated to these changes

🤖 Generated with Claude Code

Adds `--web`/`-w` to `lc issue view`: when given, opens the issue's
Linear URL in the system default browser and skips terminal output,
mirroring `gh issue view -w`.

- Add `url` attribute to Issue resource and include it in both
  `base_fields/0` and `full_fields/0` GraphQL selections.
- Create `LinearCli.Browser.open_url/2` — cross-platform browser open
  (`xdg-open`/`open`/`cmd /c start`) with an injectable `opener` for
  test doubles, same pattern as `IssueHelpers.create_pr!/3`'s `runner`.
- Add `--web`/`-w` flag to the `view` subcommand spec.
- Update `issue_view/1` → `issue_view/2` to check `flags.web` and
  delegate to `Browser.open_url/2` when set, skipping `Display.show/2`.
- Add tests for `--web`, `-w`, and `--web --output json` (all open
  browser, produce no output).
- Document `--web`/`-w` in `Readme.adoc`.

Closes EXT-20

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ruby-automation
ruby-automation merged commit f26757e into main Sep 3, 2026
3 checks passed
@ruby-automation
ruby-automation deleted the ext-20-issue-view-web-flag branch September 3, 2026 15:48
This was referenced Sep 3, 2026
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