feat: open in browser — o shortcut to open the focused result's GitHub URL#72
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a single-keystroke o shortcut to the interactive TUI that opens the focused result's GitHub URL in the system default browser. It is part of the larger TUI Navigation & Result Management EPIC (#66).
Changes:
- New
openInBrowser(url)helper insrc/tui.tsthat dispatches to the platform-appropriate open command, plus a newokeypress handler in the main input loop. - Updated
src/render.tsto surface the shortcut in both the help overlay and the status-bar hint line. - Two new render tests (
src/render.test.ts) verifying the overlay and status-bar text. - New row in
docs/reference/keyboard-shortcuts.mddocumenting theokey under the Selection table.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/tui.ts |
Adds openInBrowser() helper and o keypress handler |
src/render.ts |
Adds o open in browser line to help overlay and status bar |
src/render.test.ts |
Tests that overlay and status bar contain the new shortcut text |
docs/reference/keyboard-shortcuts.md |
Documents the o shortcut in the Selection table |
Closes #69 - openInBrowser() helper: open/xdg-open/start depending on platform, spawned detached so the TUI stays responsive - Repo row -> opens https://github.com/<org>/<repo> - Extract row -> opens the file htmlUrl returned by the GitHub API - Section header rows are a no-op (type === 'section') - renderHelpOverlay: adds 'o open in browser' entry - Status bar hint line: adds 'o open' - Tests: overlay contains 'open in browser', status bar contains 'o open' - docs/reference/keyboard-shortcuts.md: documents the shortcut in the Selection table
4ebf9d2 to
b38cc03
Compare
|
Both review points addressed in commit
Also rebased onto the updated |
Context
Part of the 🗂 TUI — Navigation & result management EPIC #66.
Closes #69.
Root cause / motivation
Users frequently want to open a result directly on GitHub without having to copy the URL. This adds a single keystroke to do it.
What changed
src/tui.tsopenInBrowser(url)helper: usesopen(macOS),xdg-open(Linux) orstart(Windows), spawned viaBun.spawnwith all stdio null so the TUI stays fully responsive.okeypress: repo row → openshttps://github.com/<org>/<repo>; extract row → opensCodeMatch.htmlUrl; section header → no-op.src/render.tsrenderHelpOverlay: newo open in browserline. Status bar hint:o open.src/render.test.tsopen in browser; status bar containso open.docs/reference/keyboard-shortcuts.mdoin the Selection table.How to test manually
Validation