Skip to content

CPLAT-10756: open PR/Jira URL on Enter in References preview#63

Merged
gavin-jeong merged 1 commit into
masterfrom
CPLAT-10756-refs-enter-open
Jul 9, 2026
Merged

CPLAT-10756: open PR/Jira URL on Enter in References preview#63
gavin-jeong merged 1 commit into
masterfrom
CPLAT-10756-refs-enter-open

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

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

Problem

With the References preview focused, pressing Enter on a PR/Jira entry did nothing useful — it fell through to km.Session.Open and opened the conversation instead of the URL.

handleRefsPreviewKeys maps both enter and o to openRefUnderCursor, but the km.Session.Open case runs first for Enter and only had branches for the conversation/agents/workflows previews — not refs. So o opened the URL while Enter leaked to openConversation.

Fix

Add a refs branch to km.Session.Open mirroring the existing conversation/agents/workflows branches, so a focused refs preview opens the PR/Jira URL under the cursor on Enter.

Also make the browser opener injectable (a.openURL, defaulting to open) so the behavior is testable without spawning a real browser.

Testing

  • TestRefsPreviewEnterOpensURL — asserts both Enter and o open the ref URL and leave the view on viewSessions (regression guard against the Enter→openConversation leak).
  • Full go test ./internal/tui/ ./internal/session/ green; go build + install clean.

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

With the References preview focused, Enter on a PR/Jira entry did nothing useful
— it fell through to km.Session.Open and opened the conversation instead of the
URL. handleRefsPreviewKeys mapped both "enter" and "o" to openRefUnderCursor,
but the Session.Open case runs first for Enter and had branches for the
conversation/agents/workflows previews only, not refs. So `o` opened the URL
while Enter leaked to openConversation.

Add a refs branch to Session.Open mirroring the others, so a focused refs
preview opens the URL under the cursor on Enter.

Also make the browser opener injectable (a.openURL, defaulting to `open`) so the
behavior is testable without spawning a real browser. TestRefsPreviewEnterOpensURL
asserts both Enter and `o` open the ref URL and leave the view on viewSessions.

@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 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!

@gavin-jeong gavin-jeong merged commit 0df1830 into master Jul 9, 2026
3 checks passed
@gavin-jeong gavin-jeong deleted the CPLAT-10756-refs-enter-open branch July 9, 2026 07:49
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