summaryrefslogtreecommitdiff
path: root/helpfuncs.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpfuncs.go')
-rw-r--r--helpfuncs.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/helpfuncs.go b/helpfuncs.go
index 849b0a0..49069a2 100644
--- a/helpfuncs.go
+++ b/helpfuncs.go
@@ -22,6 +22,28 @@ func isASCII(s string) bool {
return true
}
+// refreshChatDisplay updates the chat display based on current character view
+// It filters messages for the character the user is currently "writing as"
+// and updates the textView with the filtered conversation
+func refreshChatDisplay() {
+ // Determine which character's view to show
+ viewingAs := cfg.UserRole
+ if cfg.WriteNextMsgAs != "" {
+ viewingAs = cfg.WriteNextMsgAs
+ }
+ // Filter messages for this character
+ filteredMessages := filterMessagesForCharacter(chatBody.Messages, viewingAs)
+ displayText := chatToText(filteredMessages, cfg.ShowSys)
+ // Use QueueUpdate for thread-safe UI updates
+ app.QueueUpdate(func() {
+ textView.SetText(displayText)
+ colorText()
+ if scrollToEndEnabled {
+ textView.ScrollToEnd()
+ }
+ })
+}
+
func colorText() {
text := textView.GetText(false)
quoteReplacer := strings.NewReplacer(