Skip to content

Open Link picker: mark PR links in TUI + webapp#804

Merged
drn merged 3 commits into
masterfrom
argus/In-the-open-link-modal-in-tui
Jun 24, 2026
Merged

Open Link picker: mark PR links in TUI + webapp#804
drn merged 3 commits into
masterfrom
argus/In-the-open-link-modal-in-tui

Conversation

@drn

@drn drn commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Mark pull-request URLs in the Open Link picker so the most actionable link
is scannable at a glance, in both the TUI and the web client.

  • internal/links: shared IsPR(url) classifier (GitHub /pull/, GitLab
    /merge_requests/, matched by path so GHE / self-hosted GitLab count)
    stamps an IsPR field on each extracted Link — single source of truth.
  • TUI: both pickers draw a git-pull-request glyph before PR rows; every row
    reserves a 2-col gutter so rows stay column-aligned.
  • Webapp: Open Link modal renders a purple "PR" badge before PR rows from the
    server's isPR field (DOM API, no innerHTML). SW_VERSION bumped to v63.
  • Routed through OpenSpec (add-pr-link-indicator), archived with base specs
    merged. Tests + gotcha notes added.

Co-Authored-By: Claude noreply@anthropic.com

drn and others added 3 commits June 24, 2026 14:07
Pull-request URLs are usually the link the user is hunting for, but in the
Open Link picker they look identical to CI links, docs, and references. Mark
them so the most actionable link is scannable at a glance.

- internal/links: add IsPR(url) (GitHub /pull/<n>, GitLab /merge_requests/<n>,
  matched by path so GHE / self-hosted GitLab count too) and an IsPR field on
  Link, stamped by Extract — single source of truth, clients never re-derive.
- TUI: both pickers (simple + ctrl+l fuzzy) draw a git-pull-request glyph
  before PR rows; every row reserves a 2-col gutter so rows stay aligned.
- Webapp: Open Link modal renders a purple "PR" badge before PR rows from the
  server's isPR field (DOM API, no innerHTML). Bump SW_VERSION v61->v62.
- Routed through OpenSpec (add-pr-link-indicator), archived with base specs
  merged. Tests + gotcha notes added.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…s, honest IsPR test table

- theme: StylePRLink = StylePRAwaiting (structural identity, not prose) so a
  future restyle of the PR purple moves both surfaces together.
- pickers: comment why textW needs no clamp on narrow terminals (DrawText
  early-returns on non-positive width, SetContent clips) — closes the
  asymmetry with the filter row's fieldW clamp.
- links_test: assert IsPR in the TestExtract loop and stamp IsPR:true on the
  PR-URL want entries so the table matches real output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Captured from this session: openspec validate parses the requirement
statement as text up to the first blank line and requires SHALL/MUST on
the first physical line, so wrapping SHALL onto line 2 fails validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@drn drn force-pushed the argus/In-the-open-link-modal-in-tui branch from 90997e7 to 5ee37ad Compare June 24, 2026 21:08
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/drn/argus/internal/api 87.99% (ø)
github.com/drn/argus/internal/links 93.65% (+0.43%) 👍
github.com/drn/argus/internal/tui 83.99% (+0.02%) 👍
github.com/drn/argus/internal/tui/theme 100.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/drn/argus/internal/links/links.go 93.65% (+0.43%) 63 (+4) 59 (+4) 4 👍
github.com/drn/argus/internal/tui/fuzzylinkpicker.go 86.88% (+0.34%) 160 (+4) 139 (+4) 21 👍
github.com/drn/argus/internal/tui/links.go 92.77% (+0.37%) 83 (+4) 77 (+4) 6 👍
github.com/drn/argus/internal/tui/theme/theme.go 100.00% (ø) 5 5 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/drn/argus/internal/api/handlers_test.go
  • github.com/drn/argus/internal/links/links_test.go
  • github.com/drn/argus/internal/tui/links_test.go

@drn drn merged commit 6ced546 into master Jun 24, 2026
1 check passed
@drn drn deleted the argus/In-the-open-link-modal-in-tui branch June 25, 2026 00:50
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