From 4b2e52c834680301556ad103f7cd885071b8df6e Mon Sep 17 00:00:00 2001 From: plyght Date: Mon, 21 Jul 2025 17:31:29 +0200 Subject: feat(tui): paste minimizing (#784) Co-authored-by: adamdotdevin <2363879+adamdottv@users.noreply.github.com> --- packages/tui/internal/attachment/attachment.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'packages/tui/internal/attachment') diff --git a/packages/tui/internal/attachment/attachment.go b/packages/tui/internal/attachment/attachment.go index 178de9954..26bb91d49 100644 --- a/packages/tui/internal/attachment/attachment.go +++ b/packages/tui/internal/attachment/attachment.go @@ -4,6 +4,10 @@ import ( "github.com/google/uuid" ) +type TextSource struct { + Value string `toml:"value"` +} + type FileSource struct { Path string `toml:"path"` Mime string `toml:"mime"` @@ -46,6 +50,14 @@ func NewAttachment() *Attachment { } } +func (a *Attachment) GetTextSource() (*TextSource, bool) { + if a.Type != "text" { + return nil, false + } + ts, ok := a.Source.(*TextSource) + return ts, ok +} + // GetFileSource returns the source as FileSource if the attachment is a file type func (a *Attachment) GetFileSource() (*FileSource, bool) { if a.Type != "file" { -- cgit v1.2.3