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

@@ -12,7 +12,7 @@ Table of Contents *gitlab.nvim.table-of-contents*
- The Summary view |gitlab.nvim.the-summary-view|
- Reviewing an MR |gitlab.nvim.reviewing-an-mr|
- Discussions and Notes |gitlab.nvim.discussions-and-notes|
- Labels |gitlab.nvim.labels|
- Labels |gitlab.nvim.labels|
- Signs and diagnostics |gitlab.nvim.signs-and-diagnostics|
- Uploading Files |gitlab.nvim.uploading-files|
- MR Approvals |gitlab.nvim.mr-approvals|
@@ -23,9 +23,9 @@ Table of Contents *gitlab.nvim.table-of-contents*
- Restarting or Shutting Down |gitlab.nvim.restarting-or-shutting-down|
- Keybindings |gitlab.nvim.keybindings|
- Troubleshooting |gitlab.nvim.troubleshooting|
- Api |gitlab.nvim.api|
- Api |gitlab.nvim.api|
OVERVIEW *gitlab.nvim.overview*
OVERVIEW *gitlab.nvim.overview*
This Neovim plugin is designed to make it easy to review Gitlab MRs from within
the editor. This means you can do things like:
@@ -137,11 +137,11 @@ you call this function with no values the defaults will be used:
debug = { go_request = false, go_response = false }, -- Which values to log
attachment_dir = nil, -- The local directory for files (see the "summary" section)
reviewer_settings = {
diffview = {
imply_local = false, -- If true, will attempt to use --imply_local option when calling |:DiffviewOpen|
},
diffview = {
imply_local = false, -- If true, will attempt to use --imply_local option when calling |:DiffviewOpen|
},
},
help = "?", -- Opens a help popup for local keymaps when a relevant view is focused (popup, discussion panel, etc)
help = "g?", -- Opens a help popup for local keymaps when a relevant view is focused (popup, discussion panel, etc)
popup = { -- The popup for comment creation, editing, and replying
exit = "<Esc>",
perform_action = "<leader>s", -- Once in normal mode, does action (like saving comment or editing description, etc)
@@ -156,11 +156,11 @@ you call this function with no values the defaults will be used:
pipeline = nil,
reply = nil,
squash_message = nil,
backup_register = nil,
backup_register = nil,
},
discussion_tree = { -- The discussion tree that holds all comments
auto_open = true, -- Automatically open when the reviewer is opened
switch_view = "T", -- Toggles between the notes and discussions views
switch_view = "S", -- Toggles between the notes and discussions views
default_view = "discussions" -- Show "discussions" or "notes" by default
blacklist = {}, -- List of usernames to remove from tree (bots, CI, etc)
jump_to_file = "o", -- Jump to comment location in file
@@ -169,6 +169,10 @@ you call this function with no values the defaults will be used:
delete_comment = "dd", -- Delete comment
reply = "r", -- Reply to comment
toggle_node = "t", -- Opens or closes the discussion
toggle_all_discussions = "T", -- Open or close separately both resolved and unresolved discussions
toggle_resolved_discussions = "R", -- Open or close all resolved discussions
toggle_unresolved_discussions = "U", -- Open or close all unresolved discussions
keep_current_open = false, -- If true, current discussion stays open even if it should otherwise be closed when toggling
toggle_resolved = "p" -- Toggles the resolved status of the whole discussion
position = "left", -- "top", "right", "bottom" or "left"
open_in_browser = "b" -- Jump to the URL of the current note/discussion
@@ -184,18 +188,18 @@ you call this function with no values the defaults will be used:
enabled = true,
horizontal = false, -- Display metadata to the left of the summary rather than underneath
fields = { -- The fields listed here will be displayed, in whatever order you choose
"author",
"created_at",
"updated_at",
"merge_status",
"draft",
"conflicts",
"assignees",
"reviewers",
"branch",
"target_branch",
"pipeline",
"labels",
"author",
"created_at",
"updated_at",
"merge_status",
"draft",
"conflicts",
"assignees",
"reviewers",
"branch",
"target_branch",
"pipeline",
"labels",
},
},
discussion_sign_and_diagnostic = {
@@ -368,7 +372,7 @@ $XDG_CONFIG_HOME/nvim/after/ftplugin/gitlab.lua with the following contents:
vim.o.breakindent = true
<
LABELS *gitlab.nvim.labels*
LABELS *gitlab.nvim.labels*
You can add or remove labels from the current MR.
>lua
@@ -418,7 +422,7 @@ diagnostics for discussions on outdated diff revisions.
When interacting with multiline comments, the cursor must be on the "main" line
of diagnostic, where the `discussion_sign.text` is shown, otherwise
`vim.diagnostic.show` and `jump_to_discussion_tree_from_diagnostic` will not
`vim.diagnostic.show` and `move_to_discussion_tree_from_diagnostic` will not
work.