summaryrefslogtreecommitdiff
path: root/helpfuncs.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-01-14 10:06:15 +0300
committerGrail Finder <wohilas@gmail.com>2026-01-14 10:06:15 +0300
commit3b542421e35180db9b9f972ee973befc42f1a46f (patch)
tree8a265754a18bb100eaa5cd301dec2572d6c3cde5 /helpfuncs.go
parente120a629397a8c594497bd61b8b1d9e5c0babf78 (diff)
Enha: sort chat table (by updated_at)
Diffstat (limited to 'helpfuncs.go')
-rw-r--r--helpfuncs.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/helpfuncs.go b/helpfuncs.go
index 73f8fb0..4a3719c 100644
--- a/helpfuncs.go
+++ b/helpfuncs.go
@@ -8,6 +8,7 @@ import (
"os"
"path"
"strings"
+ "time"
"unicode"
"math/rand/v2"
@@ -111,10 +112,11 @@ func startNewChat() {
chatBody.Messages = chatBody.Messages[:2]
textView.SetText(chatToText(cfg.ShowSys))
newChat := &models.Chat{
- ID: id + 1,
- Name: fmt.Sprintf("%d_%s", id+1, cfg.AssistantRole),
- Msgs: string(defaultStarterBytes),
- Agent: cfg.AssistantRole,
+ ID: id + 1,
+ Name: fmt.Sprintf("%d_%s", id+1, cfg.AssistantRole),
+ Msgs: string(defaultStarterBytes),
+ Agent: cfg.AssistantRole,
+ CreatedAt: time.Now(),
}
activeChatName = newChat.Name
chatMap[newChat.Name] = newChat