summaryrefslogtreecommitdiff
path: root/tui.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-25 10:47:35 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-25 10:47:35 +0300
commitb8e7649e69ef26cccd63371af12fbacd8c309fd8 (patch)
treea7832ef92477101879b61a313964625d8b81da17 /tui.go
parent6664c1a0fc9e6688e67ffcba9ce348f0a95afc6a (diff)
Enha (rag): one table to manage files and data loaded
Diffstat (limited to 'tui.go')
-rw-r--r--tui.go19
1 files changed, 6 insertions, 13 deletions
diff --git a/tui.go b/tui.go
index c7bfa06..ca40c58 100644
--- a/tui.go
+++ b/tui.go
@@ -913,6 +913,7 @@ func init() {
return nil
}
}
+ // Get files from ragdir
fileList := []string{}
for _, f := range files {
if f.IsDir() {
@@ -920,22 +921,14 @@ func init() {
}
fileList = append(fileList, f.Name())
}
- chatRAGTable := makeRAGTable(fileList)
- pages.AddPage(RAGPage, chatRAGTable, true, true)
- return nil
- }
- if event.Key() == tcell.KeyCtrlY { // Use Ctrl+Y to list loaded RAG files
- // List files already loaded into the RAG system
- fileList, err := ragger.ListLoaded()
+ // Get loaded files from vector DB
+ loadedFiles, err := ragger.ListLoaded()
if err != nil {
logger.Error("failed to list loaded RAG files", "error", err)
- if notifyerr := notifyUser("failed to list RAG files", err.Error()); notifyerr != nil {
- logger.Error("failed to send notification", "error", notifyerr)
- }
- return nil
+ loadedFiles = []string{} // Continue with empty list on error
}
- chatLoadedRAGTable := makeLoadedRAGTable(fileList)
- pages.AddPage(RAGLoadedPage, chatLoadedRAGTable, true, true)
+ chatRAGTable := makeRAGTable(fileList, loadedFiles)
+ pages.AddPage(RAGPage, chatRAGTable, true, true)
return nil
}
if event.Key() == tcell.KeyRune && event.Modifiers() == tcell.ModAlt && event.Rune() == '1' {