Skip to content

feat: open in browser — o shortcut to open focused result's GitHub URL #67

Description

@shouze

Context

Part of the 🗂 TUI — Navigation & result management EPIC #66.

When browsing results in the TUI, users frequently want to open the file directly on GitHub. This feature adds an o shortcut that opens the focused result's GitHub URL in the default browser.

Acceptance criteria

  • Pressing o on a focused result row opens its GitHub URL in the default browser
  • macOS: uses open <url>, Linux: uses xdg-open <url>, Windows: uses start <url>
  • If the focused row is a repository header or team section (no direct file URL), o is a no-op (or shows a brief status message)
  • No blocking: the browser open command is spawned as a detached child process so the TUI remains responsive
  • Keyboard shortcut is documented in docs/reference/keyboard-shortcuts.md

Implementation notes

  • URL is available in CodeMatch.html_url (already present in the API response)
  • Platform detection: process.platform === 'darwin' → open, 'linux' → xdg-open, 'win32' → start
  • Use Bun.spawn (detached) or child_process.spawn — keep the spawn call isolated in a small helper so it can be tested via mock
  • No new type changes needed

Branch

feat/tui-open-in-browser → merge into feat/tui-navigation-result-management

Validation

bun test
bun run lint
bun run format:check
bun run knip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions