feat(log): Add summary view (#70)

Display a summary of changed files for any revision in the log buffer
using a floating tooltip. From the tooltip, users can diff or edit
specific files directly.

- Add summary tooltip triggered by <S-k> in log buffer
- Integrate tooltip as stateful component of terminal
- Make summary keymaps configurable
- Add documentation and demo gif
This commit is contained in:
Nicolas GB
2026-01-25 09:25:06 -08:00
committed by GitHub
parent 9a20b24849
commit 8ed2aa52aa
6 changed files with 462 additions and 3 deletions
+15 -2
View File
@@ -51,6 +51,8 @@ local status_module = require("jj.cmd.status")
--- @field squash? string|string[]
--- @field squash_mode? jj.cmd.squash.keymaps
--- @field quick_squash? string|string[]
--- @field summary? string|string[]
--- @field summary_tooltip? jj.cmd.summary_tooltip.keymaps
--- @class jj.cmd.rebase.keymaps
--- @field onto? string|string[]
@@ -66,6 +68,11 @@ local status_module = require("jj.cmd.status")
--- @field into_immutable? string|string[]
--- @field exit_mode? string|string[]
--- @class jj.cmd.summary_tooltip.keymaps
--- @field diff? string|string[]
--- @field edit? string|string[]
--- @field edit_immutable? string|string[]
--- @class jj.cmd.bookmark
--- @field prefix? string Prefix to append when creating a bookmark
@@ -154,6 +161,12 @@ M.config = {
exit_mode = { "<Esc>", "<C-c>" },
},
quick_squash = "<S-s>",
summary = "<S-k>",
summary_tooltip = {
diff = "<S-d>",
edit = "<CR>",
edit_immutable = "<S-CR>",
},
},
status = {
open_file = "<CR>",
@@ -256,12 +269,12 @@ function M.floating_keymaps()
close = {
desc = "Close floating buffer",
handler = terminal.close_floating_buffer,
modes = { "n" },
modes = { "n", "v" },
},
hide = {
desc = "Hide floating buffer",
handler = terminal.hide_floating_buffer,
modes = { "n" },
modes = { "n", "v" },
},
})
end