From 3b542421e35180db9b9f972ee973befc42f1a46f Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 14 Jan 2026 10:06:15 +0300 Subject: Enha: sort chat table (by updated_at) --- helpfuncs.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'helpfuncs.go') 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 -- cgit v1.2.3