TUI: `o` / `shift+o` do nothing in the details pane for committed-file diffs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in crates/but/src/command/legacy/status/tui/app/mod.rs at selected_openable, then compare its committed hunk handling with resolve_source in crates/but/src/command/open.rs and the IDs assigned in crates/but/src/utils/diff_rendering.rs. Check existing tests for opening files from the TUI and add coverage for o and shift+o on a committed hunk; done means both actions open the file at the hunk’s line or show the picker.
Written by the indexing model from the issue text.
Description
Version
but 0.23.2
Operating System
macOS (arm64)
Distribution Method
dmg (Mac OS - Apple Silicon), installed with the Homebrew cask
Describe the issue
In but tui, o (open) and shift+o (open with picker) do nothing when the details pane shows the diff of a committed file. The details help (?) lists both keys. No program opens, no picker appears, and no toast is shown.
The cause appears to be in selected_openable in crates/but/src/command/legacy/status/tui/app/mod.rs (checked on main at 0f8a975):
- In
Mode::Details, the selection comes fromself.details.selected_section_cli_id(). - For a committed file,
render_committed_hunk_sectionincrates/but/src/utils/diff_rendering.rsgives each section aCliId::CommittedHunkID. selected_openablehandlesCliId::UncommittedHunkOrFileandCliId::CommittedFile, but mapsCliId::CommittedHunktoOk(None).handle_open_in_default_programandhandle_pick_program_then_openthen return early without any feedback.
The non-TUI path already supports committed hunks. resolve_source in crates/but/src/command/open.rs maps ResolvedCliIdArg::CommittedHunk to Openable::try_from_hunk(repo, &committed_hunk.hunk, false).
A possible fix is to add the same case to selected_openable:
CliId::CommittedHunk(committed_hunk) => {
Openable::try_from_hunk(&*ctx.repo.get()?, &committed_hunk.hunk, false).map(Some)
}
That would also open the file at the hunk's line, like o does for uncommitted hunks. Note that try_from_hunk resolves the path in the current worktree, so it opens the working copy of the file, not the committed version.
It might also help to show a toast when selected_openable returns None, so the key does not fail silently.
How to reproduce (Optional)
- Run
but tuiin a workspace with at least one commit. - Select a file inside a commit in the status pane.
- Focus the details pane (
l/→) so a hunk of that committed file's diff is selected. - Press
oorshift+o.
Expected: the file opens in the default program, or the program picker appears.
Actual: nothing happens.
Based on the code, o with the committed file selected in the status pane (a CliId::CommittedFile) should still work; I have not checked this separately.
- Dominant language
- Rust
- Stars
- 21.9k
- Forks
- 1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 657
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gitbutlerapp/gitbutler
-
Gitlab is not on the list of allowed img-srcPossibly taken @masecla22 claimed this 46 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 2 comments ·
Maintainers usually reply within 1 day
-
copy branch name buttonPossibly taken @masecla22 claimed this 39 days ago. Openenhancement UI (Svelte)
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gitbutlerapp/gitbutler#15709 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#14406 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
gitbutlerapp/gitbutler#17057 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
gitbutlerapp/gitbutler#16997 ·
Maintainers usually reply within 1 day
All issues in gitbutlerapp/gitbutler
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pop-os/cosmic-applets#1619 ·
Maintainers usually reply within 3 days
-
binding:python bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
coollabsio/orbit#72 ·
Maintainers usually reply within 1 day
-
swc_common: Mark::least_ancestor never returns when the answer is the root mark (ANT-2026-JYDQGGRT)Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swc-project/swc-ai-issues#137 ·
-
Synth suite fails unless run from the repo root: signal_flow's default machine path is cwd-relativeOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Nimblesite/osprey#370 ·
Maintainers usually reply within 1 day