CPLAT-10756: open PR/Jira URL on Enter in References preview#63
Merged
Conversation
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.
Kairo-Kim
approved these changes
Jul 9, 2026
mitrilmad
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Openand opened the conversation instead of the URL.handleRefsPreviewKeysmaps bothenterandotoopenRefUnderCursor, but thekm.Session.Opencase runs first for Enter and only had branches for the conversation/agents/workflows previews — not refs. Sooopened the URL while Enter leaked toopenConversation.Fix
Add a refs branch to
km.Session.Openmirroring 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 toopen) so the behavior is testable without spawning a real browser.Testing
TestRefsPreviewEnterOpensURL— asserts both Enter andoopen the ref URL and leave the view onviewSessions(regression guard against the Enter→openConversation leak).go test ./internal/tui/ ./internal/session/green;go build+ install clean.