From fa95c09cdce6e212be1b2c8d6b2a07f701821770 Mon Sep 17 00:00:00 2001 From: Yihui Khuu Date: Sun, 3 Aug 2025 00:23:32 +1000 Subject: fix(tui): attachment source is not stored when using message from message history (#1542) --- packages/tui/internal/app/state.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packages/tui/internal/app') diff --git a/packages/tui/internal/app/state.go b/packages/tui/internal/app/state.go index e797d4220..bf2a602b3 100644 --- a/packages/tui/internal/app/state.go +++ b/packages/tui/internal/app/state.go @@ -120,5 +120,13 @@ func LoadState(filePath string) (*State, error) { } return nil, fmt.Errorf("failed to decode TOML from file %s: %w", filePath, err) } + + // Restore attachment sources types that were deserialized as map[string]any + for _, prompt := range state.MessageHistory { + for _, att := range prompt.Attachments { + att.RestoreSourceType() + } + } + return &state, nil } -- cgit v1.2.3