summaryrefslogtreecommitdiff
path: root/windowChats.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-02 17:47:30 -0500
committerJeff Carr <[email protected]>2025-09-02 17:47:30 -0500
commit61179d6aaef8ab5b6e5c941e61e7ce1e848bf49e (patch)
treeae5e076c0f07be68bacbb90978180b9f3729beef /windowChats.go
parent589d50d95019638ca394382cbc6b21c6b248888d (diff)
make a "books" window
Diffstat (limited to 'windowChats.go')
-rw-r--r--windowChats.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/windowChats.go b/windowChats.go
index 39906b7..14e09ac 100644
--- a/windowChats.go
+++ b/windowChats.go
@@ -129,9 +129,30 @@ func addChatsPB(win *gadgets.GenericWindow, pb *chatpb.Chats) *chatpb.ChatsTable
genaiButton.Custom = func(chat *chatpb.Chat) {
log.Info("show *genai.GeminiRequsts for", chat.GetUuid())
chat.PrintChatGeminiTable()
+ pb := makeBooksTable(chat)
+ makeBookWindow(pb)
}
// draw the tabel (send the gui protobuf to the GO plugin)
t.ShowTable()
return t
}
+
+func makeBooksTable(chat *chatpb.Chat) *chatpb.Books {
+ var pb *chatpb.Books
+
+ pb = chatpb.NewBooks()
+
+ for _, entry := range chat.GetEntries() {
+ if entry.GeminiRequest == nil {
+ continue
+ }
+ newb := new(chatpb.Book)
+ newb.Ctime = entry.Ctime
+ newb.Uuid = entry.Uuid
+ newb.From = entry.From
+ newb.GeminiRequest = entry.GeminiRequest
+ pb.Append(newb)
+ }
+ return pb
+}