Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winbar Support + Notes and Discussions; Help Popup + Auto-Open #133

Merged
merged 35 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6374476
Adding a winbar
harrisoncramer Dec 5, 2023
312333a
Adds the title of discussions / or notes to each winbar
harrisoncramer Dec 5, 2023
6ac07b3
Added logic to build local winbar w/ count of resolved + unresolved
harrisoncramer Dec 5, 2023
a1c1ab8
Breaking signs/diagnostics into separate file
harrisoncramer Dec 5, 2023
b788cd8
More refactoring
harrisoncramer Dec 6, 2023
0fab90e
Apply formatting
harrisoncramer Dec 6, 2023
7180a68
Merge branch 'main' into adding-winbar
harrisoncramer Dec 6, 2023
c70e317
Fixed formatting
harrisoncramer Dec 6, 2023
e4b4ee7
Moved winbar logic to separate file
harrisoncramer Dec 6, 2023
66b1818
Customize winbar title
harrisoncramer Dec 6, 2023
c1aecd7
Formatting
harrisoncramer Dec 6, 2023
e6d478c
Added ability to toggle between discussions and notes views
harrisoncramer Dec 9, 2023
b2d4184
Fixed reloading after resolving discussions
harrisoncramer Dec 9, 2023
5ce5005
Adds a help popup for each of the different views
harrisoncramer Dec 9, 2023
62d535f
Updates readme
harrisoncramer Dec 9, 2023
647f8cd
Added auto_open functionality to the discussion tree
harrisoncramer Dec 9, 2023
a47a9ba
Formatting
harrisoncramer Dec 9, 2023
1125add
Handle missing data
harrisoncramer Dec 9, 2023
c41947a
Formatting
harrisoncramer Dec 9, 2023
4df14fc
Fixed issue w/ win ID
harrisoncramer Dec 9, 2023
0bb4336
Styling
harrisoncramer Dec 9, 2023
07f14c4
Added small note to readme about lualine
harrisoncramer Dec 9, 2023
4a0094c
Fixed issue jumping back to discussions split
harrisoncramer Dec 9, 2023
a0e83ab
Fixed refresh issues, added configurability of default view
harrisoncramer Dec 10, 2023
a84f076
Fixed issue with view configurability
harrisoncramer Dec 10, 2023
35da45a
Added highlighting + toggling logic
harrisoncramer Dec 10, 2023
3ca3de4
Adjusted formatting
harrisoncramer Dec 10, 2023
8448619
Fix: Set correct zindex for Help pupup and don't add help kyemap for …
jakubbortlik Dec 12, 2023
552e020
Fix typo
harrisoncramer Dec 12, 2023
6fd4d15
Removed extraneous print
harrisoncramer Dec 12, 2023
770d325
Only refresh winbar when split is open
harrisoncramer Dec 12, 2023
f04ae11
Fixed symbols + highlighting
harrisoncramer Dec 11, 2023
d7db8de
Deleted unnecessary global variables
harrisoncramer Dec 11, 2023
1d3aa1f
Updated readme
harrisoncramer Dec 13, 2023
75ee951
Updated tests w/ new symbol
harrisoncramer Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ require("gitlab").setup({
config_path = nil, -- Custom path for `.gitlab.nvim` file, please read the "Connecting to Gitlab" section
debug = { go_request = false, go_response = false }, -- Which values to log
attachment_dir = nil, -- The local directory for files (see the "summary" section)
help = "?", -- 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)
Expand All @@ -132,6 +133,9 @@ require("gitlab").setup({
reply = 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
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
jump_to_reviewer = "m", -- Jump to the location in the reviewer window
Expand All @@ -146,6 +150,8 @@ require("gitlab").setup({
resolved = '✓', -- Symbol to show next to resolved discussions
unresolved = '✖', -- Symbol to show next to unresolved discussions
tree_type = "simple", -- Type of discussion tree - "simple" means just list of discussions, "by_file_name" means file tree with discussions under file
winbar = nil -- Custom function to return winbar title, should return a string. Provided with WinbarTable (defined in annotations.lua)
-- If using lualine, please add "gitlab" to disabled file types, otherwise you will not see the winbar.
},
info = { -- Show additional fields in the summary pane
enabled = true,
Expand Down
4 changes: 4 additions & 0 deletions after/syntax/gitlab.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ syntax match Username "@\S*"
syntax match Date "\v\d+\s+\w+\s+ago"
syntax match ChevronDown ""
syntax match ChevronRight ""
syntax match Resolved "✓$"
syntax match Unresolved "-$"

highlight link Username GitlabUsername
highlight link Date GitlabDate
highlight link ChevronDown GitlabChevron
highlight link ChevronRight GitlabChevron
highlight link Resolved GitlabResolved
highlight link Unresolved GitlabUnresolved

let b:current_syntax = "gitlab"
1 change: 1 addition & 0 deletions lua/gitlab/actions/comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ M.confirm_create_comment = function(text, range, unlinked)
job.run_job("/comment", "POST", body, function(data)
u.notify("Note created!", vim.log.levels.INFO)
discussions.add_discussion({ data = data, unlinked = true })
discussions.refresh_discussion_data()
end)
return
end
Expand Down
7 changes: 7 additions & 0 deletions lua/gitlab/actions/discussions/annotations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@
---@class DiscussionData
---@field discussions Discussion[]
---@field unlinked_discussions UnlinkedDiscussion[]

---@class WinbarTable
---@field name string
---@field resolvable_discussions number
---@field resolved_discussions number
---@field resolvable_notes number
---@field resolved_notes number
Loading
Loading