Skip to content

Commit e36ed42

Browse files
committed
refactor(picker_utils): create a base picker
This creates a base picker module to make it as easy as possible to create new ones with the same pattern It also aligns the date to the right properly for every picker
1 parent 511952f commit e36ed42

File tree

8 files changed

+490
-823
lines changed

8 files changed

+490
-823
lines changed

lua/opencode/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ M.defaults = {
8686
input_position = 'bottom',
8787
window_width = 0.40,
8888
input_height = 0.15,
89+
picker_width = 100,
8990
display_model = true,
9091
display_context_size = true,
9192
display_cost = true,

lua/opencode/core.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ function M.switch_session(session_id)
3737
state.active_session = selected_session
3838
if state.windows then
3939
state.restore_points = {}
40-
-- Don't need to update either renderer because they subscribe to
41-
-- session changes
4240
ui.focus_input()
4341
else
4442
M.open()

lua/opencode/types.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
---@field output_window OpencodeKeymapOutputWindow
7373
---@field permission OpencodeKeymapPermission
7474
---@field session_picker OpencodeSessionPickerKeymap
75+
---@field timeline_picker OpencodeTimelinePickerKeymap
7576

7677
---@class OpencodeSessionPickerKeymap
7778
---@field delete_session OpencodeKeymapEntry
@@ -99,6 +100,7 @@
99100
---@field input_position 'bottom'|'top' # Position of the input window (default: 'bottom')
100101
---@field window_width number
101102
---@field input_height number
103+
---@field picker_width number|nil # Default width for all pickers (nil uses current window width)
102104
---@field display_model boolean
103105
---@field display_context_size boolean
104106
---@field display_cost boolean

0 commit comments

Comments
 (0)