WIP: buffers and command history
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
decentral1se 2024-01-10 11:26:26 +01:00
parent 6db960bb78
commit fe2e968ced
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 26 additions and 0 deletions

26
ui/buffer.go Normal file
View File

@ -0,0 +1,26 @@
package ui
import (
tea "github.com/charmbracelet/bubbletea"
)
// Buffer represents the behaviour of a user-input buffer.
type Buffer interface {
validateInput(m model, input string) error
handleInput(input string) tea.Msg
logToFile(m model, input string)
}
// StatusBuffer is the privileged status buffer where e.g. you input
// program-wide commands. It can also report general status information, e.g.
// the status of ACN connectivity.
type StatusBuffer struct {
inputChannel chan string
}
// ProfileBuffer is the profile buffer. There can be several profile buffers
// which correspond to several profiles. Profile buffers take input and report
// output for profile-specific information, e.g. invites from a new contact.
type ProfileBuffer struct {
inputChannel chan string
}