From 75354e66f9c947df3fad3ca80968de6577aca80a Mon Sep 17 00:00:00 2001 From: qer Date: Wed, 24 Jun 2026 23:44:23 +0800 Subject: [PATCH 01/11] perf(web): page session list per workspace on first load Load only the first page of sessions per workspace instead of draining every session up front, so the initial request count scales with the number of workspaces rather than the total number of sessions. The per-workspace "show more" button now fetches the next page on demand, and searching lazily loads the full list so results stay complete. To keep per-workspace paging working for sessions created with cwd only, the workspace registry now also surfaces directories that have sessions but were never explicitly registered. --- .changeset/web-session-list-paging.md | 5 + apps/kimi-web/src/App.vue | 2 + apps/kimi-web/src/api/types.ts | 4 +- apps/kimi-web/src/components/Sidebar.vue | 56 ++----- .../src/components/WorkspaceGroup.vue | 19 ++- .../composables/client/useWorkspaceState.ts | 126 +++++++++++++++- .../src/composables/useKimiWebClient.ts | 24 ++- apps/kimi-web/src/i18n/locales/en/sidebar.ts | 1 + apps/kimi-web/src/i18n/locales/zh/sidebar.ts | 1 + apps/kimi-web/src/types.ts | 4 + .../workspace/workspaceRegistryService.ts | 55 ++++++- .../test/services/workspace-registry.test.ts | 140 ++++++++++++++++++ 12 files changed, 370 insertions(+), 67 deletions(-) create mode 100644 .changeset/web-session-list-paging.md create mode 100644 packages/agent-core/test/services/workspace-registry.test.ts diff --git a/.changeset/web-session-list-paging.md b/.changeset/web-session-list-paging.md new file mode 100644 index 0000000000..521f45e0f4 --- /dev/null +++ b/.changeset/web-session-list-paging.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Page the web session list per workspace so the first screen no longer fetches every session up front. diff --git a/apps/kimi-web/src/App.vue b/apps/kimi-web/src/App.vue index 176910afaf..44e67bf897 100644 --- a/apps/kimi-web/src/App.vue +++ b/apps/kimi-web/src/App.vue @@ -562,6 +562,8 @@ function openPr(url: string): void { @rename-workspace="(id, name) => client.renameWorkspace(id, name)" @delete-workspace="(id) => client.deleteWorkspace(id)" @reorder-workspaces="client.reorderWorkspaces($event)" + @load-more-sessions="(id) => void client.loadMoreSessions(id)" + @load-all-sessions="void client.loadAllSessions()" @select-workspaces="handleSelectWorkspaces" @open-settings="showSettings = true" @collapse="toggleSidebarCollapse" diff --git a/apps/kimi-web/src/api/types.ts b/apps/kimi-web/src/api/types.ts index ad52b6e0d8..2c6da2cef2 100644 --- a/apps/kimi-web/src/api/types.ts +++ b/apps/kimi-web/src/api/types.ts @@ -658,8 +658,8 @@ export interface KimiWebApi { openInApp(sessionId: string, appId: string, path: string, line?: number): Promise; connectEvents(handlers: KimiEventHandlers): KimiEventConnection; - // Workspaces + daemon folder browser - // PRESUMED — falls back until the daemon ships /workspaces, /fs:browse, /fs:home. + // Workspaces + daemon folder browser. /workspaces now ships and includes + // derived workspaces (cwds with sessions that were never explicitly registered). listWorkspaces(): Promise; addWorkspace(input: { root: string; name?: string }): Promise; deleteWorkspace(id: string): Promise; diff --git a/apps/kimi-web/src/components/Sidebar.vue b/apps/kimi-web/src/components/Sidebar.vue index b3ec0f0b48..adf31d5597 100644 --- a/apps/kimi-web/src/components/Sidebar.vue +++ b/apps/kimi-web/src/components/Sidebar.vue @@ -3,7 +3,7 @@ The old workspace rail and workspace tabs have been removed; workspace switching, folding and renaming all live in the group header. -->