Feat collapse and expand nodes (#176)

This MR adds the ability to expand and collapse nodes in the discussion tree in bulk. You can now toggle expansion of all nodes, toggle expansion of only resolved discussions, and toggle expansion of only unresolved discussions.

The MR also adjusts keybindings in the discussion tree to support forward and backward searching, as well as the keybinding for the help popup.

Thank you for the contribution @jakubbortlik!

This is a #MINOR bump since it's changing keybindings, although core workflows are unchanged.
This commit is contained in:
Jakub F. Bortlík
2024-02-13 17:39:21 +01:00
committed by GitHub
parent 6046669391
commit 3f1c5effe5
5 changed files with 154 additions and 29 deletions

View File

@@ -19,7 +19,7 @@ M.settings = {
},
},
attachment_dir = "",
help = "?",
help = "g?",
popup = {
exit = "<Esc>",
perform_action = "<leader>s",
@@ -39,6 +39,8 @@ M.settings = {
},
discussion_tree = {
auto_open = true,
switch_view = "S",
default_view = "discussions",
blacklist = {},
jump_to_file = "o",
jump_to_reviewer = "m",
@@ -47,6 +49,10 @@ M.settings = {
open_in_browser = "b",
reply = "r",
toggle_node = "t",
toggle_all_discussions = "T",
toggle_resolved_discussions = "R",
toggle_unresolved_discussions = "U",
keep_current_open = false,
toggle_resolved = "p",
relative = "editor",
position = "left",
@@ -54,8 +60,6 @@ M.settings = {
resolved = "",
unresolved = "-",
tree_type = "simple",
switch_view = "T",
default_view = "discussions",
---@param t WinbarTable
winbar = function(t)
local discussions_content = t.resolvable_discussions ~= 0