Feature: Un-intrusive floating popup for opencode permissions #304
Open
r0ckHopper wants to merge 4 commits into
Open
Feature: Un-intrusive floating popup for opencode permissions #304r0ckHopper wants to merge 4 commits into
r0ckHopper wants to merge 4 commits into
Conversation
2cf5baf to
30d2069
Compare
- gives a custom buffer with extmarks, that doesn't steal focus - allows navigation between permissions requests - adds allow all capability and relabels reject as reject all when appropriate - formats the requests with new lines - adds some permissions label - allows control either by nav to window or by keybinds
…ove unnecessary typecasts, correct calc_height (simpler human like)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks
Description
Issue 1 and Solution
The current 2 options (vim.ui.select and snacks) for permissions from opencode break the flow of coding, I found that while I was doing edits, opencode kept giving me popups and I wasn't ready to context switch yet. So I needed a non-intrusive solution to reviewing opencode requests.
This plugin addition is an optional floating window for Permissions that is not focused by default.
It keeps a queue of all concurrent requests that opencode made which can be navigated through and approved one at a time once user is ready to do so.
Issue 2 and Solution
if I hit cancel on the requests I couldn't go back to viewing them from within nvim which meant I had to use the tui to accept
This change allows user to toggle hide for permissions and go back to work, then toggle it back without losing state or needing to use tui.
Issue 3 and Solution
sometimes permissions can get out of sync if user replies in the tui. So nvim still shows the permission even though it is no longer up
Opencode server already sends events notifying us of this, so we can update when we receive this request.
Other niceties added
Some design decisions
How to configure
This is an optional feature and requires user to add the following to opts
Additionally they can keybind to most functions by doing the following
Testing
Related Issue(s)
Not reported as an issue but there was a discussion regarding a non intrusive solution to permissions in #290 (reply in thread)
I had already been making this locally and wanted to share in case you were interested in this
Screenshots/Videos
recording_2026-06-23_19-28-41.mp4