mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
refactor(ui): simplify model button and optimize session index loading
- StatusBar model button: show model name instead of provider, click opens settings directly (scrolls to default model section), remove dropdown - SessionIndexSection: replace N serial pluginQuery calls with single batch API (GET /_web/sessions/index-stats), add IntersectionObserver lazy loading - Full-stack implementation: CLI route, Electron IPC/Worker, frontend adapters Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
783d61f742
commit
9bc0c4279d
15 files changed
+140
-109
No files matched your search
@@ -256,6 +256,13 @@ export const sessionApi = {
|
||||
return ipcRenderer.invoke('session:getStats', sessionId)
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量获取所有会话的索引状态
|
||||
*/
|
||||
getAllIndexStats: (): Promise<Array<{ sessionId: string; hasIndex: boolean; sessionCount: number }>> => {
|
||||
return ipcRenderer.invoke('session:getAllIndexStats')
|
||||
},
|
||||
|
||||
/**
|
||||
* 清空会话索引
|
||||
*/
|
||||
|
||||
Vendored
+1
@@ -1128,6 +1128,7 @@ interface SessionApi {
|
||||
generateIncremental: (sessionId: string, gapThreshold?: number) => Promise<number>
|
||||
hasIndex: (sessionId: string) => Promise<boolean>
|
||||
getStats: (sessionId: string) => Promise<SessionStats>
|
||||
getAllIndexStats: () => Promise<Array<{ sessionId: string; hasIndex: boolean; sessionCount: number }>>
|
||||
clear: (sessionId: string) => Promise<boolean>
|
||||
updateGapThreshold: (sessionId: string, gapThreshold: number | null) => Promise<boolean>
|
||||
getSessions: (sessionId: string) => Promise<ChatSessionItem[]>
|
||||
|
||||
Reference in new issue
Block a user