Private
Public Access
1
0

tui: Add setting view with support for changing the current model

This commit is contained in:
2024-09-25 15:49:45 +00:00
parent 3ec2675632
commit 69cdc0a5aa
10 changed files with 485 additions and 37 deletions

View File

@@ -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)
}
}