From fe2e968ced7085b45d0cb992fb730bb51e31c01f Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 10 Jan 2024 11:26:26 +0100 Subject: [PATCH] WIP: buffers and command history --- ui/buffer.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ui/buffer.go diff --git a/ui/buffer.go b/ui/buffer.go new file mode 100644 index 0000000..beaec6b --- /dev/null +++ b/ui/buffer.go @@ -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 +}