Skip to content

Commit bce0569

Browse files
committed
refactor(ui/renderer/tests): remove trailing-border flags, filter internal messages, normalize extmarks
- Remove extend_border_to_trailing_blank from permission and question window displays. - Filter messages with ids starting with __opencode_ before calling full-session render. - Normalize extmark serialization (move virt_text_pos, virt_text_hide, virt_text_win_col, priority into consistent ordering) and update expected test fixtures/timestamps. - Update unit tests to match new display options.
1 parent 1680822 commit bce0569

15 files changed

Lines changed: 4472 additions & 2102 deletions

lua/opencode/ui/permission_window.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ function M.format_display(output)
174174
title = icons.get('warning') .. ' Permission Required' .. progress,
175175
title_hl = 'OpencodePermissionTitle',
176176
border_hl = 'OpencodePermissionBorder',
177-
extend_border_to_trailing_blank = true,
178177
content = render_content and nil or content,
179178
render_content = render_content,
180179
options = options,

lua/opencode/ui/question_window.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ function M.format_display(output)
252252
title = icons.get('question') .. ' Question' .. progress,
253253
title_hl = 'OpencodeQuestionTitle',
254254
border_hl = 'OpencodeQuestionBorder',
255-
extend_border_to_trailing_blank = true,
256255
content = vim.split(question_info.question, '\n'),
257256
options = options,
258257
unfocused_message = 'Focus Opencode window to answer question',

lua/opencode/ui/renderer/events.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ function M.on_session_updated(properties)
383383
end
384384

385385
if revert_changed then
386-
require('opencode.ui.renderer')._render_full_session_data(state.messages)
386+
local real_messages = vim.tbl_filter(function(msg)
387+
return not (msg.info and msg.info.id and msg.info.id:match('^__opencode_'))
388+
end, state.messages or {})
389+
require('opencode.ui.renderer')._render_full_session_data(real_messages)
387390
end
388391
end
389392

0 commit comments

Comments
 (0)