Skip to content

CPLAT-10756: show PR/Jira status inline in ccx URL menus#64

Merged
gavin-jeong merged 1 commit into
masterfrom
CPLAT-10756-urls-status-aware
Jul 9, 2026
Merged

CPLAT-10756: show PR/Jira status inline in ccx URL menus#64
gavin-jeong merged 1 commit into
masterfrom
CPLAT-10756-urls-status-aware

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-10756

Problem

The References preview resolves PR/Jira status (OPEN/MERGED/DRAFT/CLOSED, review decision, checks rollup, Jira status), but the URL menus — both the in-TUI URL modal and the standalone ccx urls picker — showed only a bare PR/JIRA badge and the label.

So when jumping between adjacent tmux sessions, you couldn't tell at a glance whether a linked PR was still open or already merged without opening it.

Fix

Make both URL menus status-aware, reusing the same resolve path the References preview uses.

internal/session

  • Export ClassifyURLRef (URL → SessionRef PR/Jira classifier), a thin wrapper over the existing internal classifyRef.
  • Add RefStatusText — a plain-text (no-ANSI) status summary usable by both menus (e.g. OPEN · approved · checks ✓, MERGED, In Progress).
  • Both covered by unit tests (TestClassifyURLRef, TestRefStatusText).

internal/tui (URL modal)

  • openURLMenuFromItems dispatches an async resolve for every PR/Jira row (resolveURLRefsCmd), streaming urlRefStatusMsg back one ref at a time.
  • Rows render the status suffix inline via urlRefStatusText.

internal/cli (ccx urls picker)

  • The picker's Init() dispatches the same async resolve (resolveRefsCmd), handles pickerRefStatusMsg, and renders the status suffix per row.

Notes

  • Both reuse session.ResolveRef, so results are TTL-cached (5 min) and share the existing bounded gh/Jira concurrency — no extra load beyond what the References preview already incurs.
  • File/changes scopes contain no PR/Jira links, so this is a no-op for them.
  • --plain output is intentionally left untouched (tab-separated, machine-consumed; no synchronous gh/Jira calls injected into a pipe).

Testing

  • go test ./internal/session/ ./internal/tui/ ./internal/cli/ ./internal/extract/ all green.
  • go build + install clean.

JIRA: https://sendbird.atlassian.net/browse/CPLAT-10756

The References preview resolves PR/Jira status (OPEN/MERGED/DRAFT/CLOSED,
review decision, checks rollup, Jira status) but the URL menus — both the
in-TUI URL modal and the standalone `ccx urls` picker — showed only a bare
"PR"/"JIRA" badge and the label. So when jumping between adjacent tmux
sessions you couldn't tell at a glance whether a linked PR was still open or
already merged without opening it.

Make both URL menus status-aware, reusing the same resolve path the References
preview uses:

- session: export ClassifyURLRef (URL → SessionRef PR/Jira classifier) and add
  RefStatusText, a plain-text (no-ANSI) status summary usable by both menus and
  potential --plain output. Both are covered by unit tests.
- tui: openURLMenuFromItems now dispatches an async resolve for every PR/Jira
  row (resolveURLRefsCmd), streaming urlRefStatusMsg back one ref at a time.
  Rows render the status suffix inline via urlRefStatusText.
- cli: the picker's Init() dispatches the same async resolve (resolveRefsCmd),
  handles pickerRefStatusMsg, and renders the status suffix per row.

Both reuse session.ResolveRef, so results are TTL-cached (5 min) and share the
existing bounded gh/Jira concurrency — no extra load beyond what the References
preview already incurs. File/changes scopes contain no PR/Jira links, so this
is a no-op for them.
@Kairo-Kim Kairo-Kim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Jul 9, 2026

@jinsekim jinsekim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jinsekim jinsekim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gavin-jeong gavin-jeong merged commit 16fe7c6 into master Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants