feat(permission_window): render description/command from part updates#257
feat(permission_window): render description/command from part updates#257sudo-tee merged 9 commits intosudo-tee:mainfrom
Conversation
9d81466 to
90b2bcb
Compare
Update permission window rendering to prefer message.part.updated description and command, wire renderer correlation for part-to-permission updates, and add regression coverage including replay expectations and collapsing-order handling.
90b2bcb to
de38869
Compare
There was a problem hiding this comment.
I think we should improve the spacing in the window, currently in this MR it looks lile so

With the two remarks I added the permission window would look like this instead
This is the code I used to get this window
local content = {}
if permission._description and permission._description ~= '' then
table.insert(content, (icons.get(perm_type) or '') .. ' *' .. (perm_type or '') .. '* ' .. permission._description)
elseif permission.title then
table.insert(content, (icons.get(perm_type) or '') .. ' *' .. (perm_type or '') .. '* `' .. permission.title .. '`')
else
table.insert(content, (icons.get(perm_type) or '') .. ' *' .. (perm_type or '') .. '*')
local lines = vim.split(permission.patterns or {}, '\n')
table.insert(content, '```')
for i, line in ipairs(lines) do
table.insert(content, line)
end
table.insert(content, '```')
end
table.insert(content, '')
if permission._command and permission._command ~= '' then
local lines = vim.split(permission._command, '\n')
table.insert(content, '```')
for i, line in ipairs(lines) do
table.insert(content, line)
end
table.insert(content, '```')
end
| local patterns = table.concat(permission.patterns or {}, '`, `'):gsub('\r', '\\r'):gsub('\n', '\\n') | ||
| display_text = (icons.get(perm_type) or '') .. ' *' .. (perm_type or '') .. '* `' .. (patterns ~= '' and patterns or 'Unknown Permission') .. '`' | ||
| end | ||
|
|
There was a problem hiding this comment.
We should add an empty line after the title/description
There was a problem hiding this comment.
should be there now since I applied your suggestion
|
I was hoping to see a proper diff for the replay snapshots since a lot of them have changed. this would depend on #259 though. it also seems like the JSON keys are not ordered consistently. when I diff locally it shows a lot more changes than I would've expected 🤔 edit: sorted. configured |
Great I will have a look ar #259 Should be straightforward to merge Edit: merged |
|
It is indeed way better to see diffs this way, Thanks for all your efforts in helping me on this plugin |
|
🤝 likewise man, happy to support this project. It really is a fantastic plugin! |

close #241