Skip to content

Commit 19503d8

Browse files
authored
feat: commit info overlay with m key (#103)
## Summary - Add `m` key to open a floating overlay showing the full commit preamble (hash, author, date, message body) - Display commit metadata in the header bar: `DIFFNAV • hash date author • [branch] subject` - Clicking the header bar opens the overlay; clicking outside closes it - Scrollable viewport with scrollbar when content overflows (mouse wheel, j/k, up/down, ctrl+d/ctrl+u for half-page) - Branch detection via `git branch --points-at` for any commit - Does nothing for plain diffs without commit metadata <img width="1831" height="1073" alt="image" src="https://github.com/user-attachments/assets/03cdc2bb-58ad-4105-be3a-18d1694cca31" />
1 parent c899b9e commit 19503d8

3 files changed

Lines changed: 425 additions & 28 deletions

File tree

pkg/ui/keys.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type KeyMap struct {
2121
ToggleDiffView key.Binding
2222
ToggleIconStyle key.Binding
2323
ToggleHelp key.Binding
24+
ToggleMessage key.Binding
2425
}
2526

2627
var keys = &KeyMap{
@@ -96,6 +97,10 @@ var keys = &KeyMap{
9697
key.WithKeys("?", "f1"),
9798
key.WithHelp("F1/?", "toggle help"),
9899
),
100+
ToggleMessage: key.NewBinding(
101+
key.WithKeys("m"),
102+
key.WithHelp("m", "commit info"),
103+
),
99104
}
100105

101106
func KeyGroups() [][]key.Binding {
@@ -115,6 +120,7 @@ func KeyGroups() [][]key.Binding {
115120
keys.ToggleDiffView,
116121
keys.ToggleIconStyle,
117122
}, {
123+
keys.ToggleMessage,
118124
keys.ToggleHelp,
119125
keys.Quit,
120126
}}

0 commit comments

Comments
 (0)