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:
diguaandCursor committed 2026-05-31 10:28:29 +08:00
1 parent 783d61f742
commit 9bc0c4279d
15 files changed
+140 -109

No files matched your search

+7
View File
@@ -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')
},
/**
* 清空会话索引
*/
+1
View File
@@ -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[]>