tui: Add setting view with support for changing the current model
This commit is contained in:
@@ -22,24 +22,24 @@ type View int
|
||||
const (
|
||||
ViewChat View = iota
|
||||
ViewConversations
|
||||
//StateSettings
|
||||
ViewSettings
|
||||
//StateHelp
|
||||
)
|
||||
|
||||
type (
|
||||
// send to change the current state
|
||||
MsgViewChange View
|
||||
// sent to a state when it is entered
|
||||
MsgViewEnter struct{}
|
||||
// sent to a state when it is entered, with the view we're leaving
|
||||
MsgViewEnter View
|
||||
// sent when a recoverable error occurs (displayed to user)
|
||||
MsgError struct { Err error }
|
||||
// sent when the view has handled a key input
|
||||
MsgKeyHandled tea.KeyMsg
|
||||
)
|
||||
|
||||
func ViewEnter() tea.Cmd {
|
||||
func ViewEnter(from View) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
return MsgViewEnter{}
|
||||
return MsgViewEnter(from)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user