diff --git a/.changeset/web-delayed-new-session.md b/.changeset/web-delayed-new-session.md new file mode 100644 index 0000000000..f527c946ac --- /dev/null +++ b/.changeset/web-delayed-new-session.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +In the bundled web UI, a new session is now created only when the first message is sent, so + New without a workspace opens the composer instead of making an empty session. diff --git a/apps/kimi-web/src/App.vue b/apps/kimi-web/src/App.vue index 4a610657e8..bec2ce4db6 100644 --- a/apps/kimi-web/src/App.vue +++ b/apps/kimi-web/src/App.vue @@ -14,7 +14,6 @@ import DiffView from './components/chat/DiffView.vue'; import ModelPicker from './components/settings/ModelPicker.vue'; import ProviderManager from './components/settings/ProviderManager.vue'; import LoginDialog from './components/dialogs/LoginDialog.vue'; -import NewSessionDialog from './components/dialogs/NewSessionDialog.vue'; import SettingsDialog from './components/settings/SettingsDialog.vue'; import AddWorkspaceDialog from './components/dialogs/AddWorkspaceDialog.vue'; import StatusPanel from './components/chat/StatusPanel.vue'; @@ -227,7 +226,6 @@ function handleSelectWorkspaces(ids: string[]): void { const showModelPicker = ref(false); const showProviders = ref(false); const showLogin = ref(false); -const showNewSession = ref(false); const showAddWorkspace = ref(false); const showStatusPanel = ref(false); const showSettings = ref(false); @@ -246,7 +244,6 @@ const anyOverlayOpen = computed(() => showModelPicker.value || showProviders.value || showLogin.value || - showNewSession.value || showAddWorkspace.value || showStatusPanel.value || showSettings.value || @@ -391,8 +388,8 @@ function handleCommand(cmd: string): void { return; } switch (cmd) { - // `/new` and `/clear` are aliases: both open the onboarding composer (or - // the new-session dialog when no workspace is active). + // `/new` and `/clear` are aliases: both open the onboarding composer. The + // session is only created when the user sends the first message. case '/new': case '/clear': handleCreateSession(); @@ -505,10 +502,10 @@ function handleCreateSession(): void { const wsId = client.activeWorkspaceId.value; if (wsId) { client.openWorkspaceDraft(wsId); - focusComposerAfterDraft(); } else { - showNewSession.value = true; + client.clearActiveSession(); } + focusComposerAfterDraft(); } // Workspace-level "+ New" (sidebar group or mobile switcher): enter the draft @@ -854,14 +851,6 @@ function openPr(url: string): void { @close="showProviders = false" /> - - - - - - - - - - diff --git a/apps/kimi-web/src/components/settings/SettingsDialog.vue b/apps/kimi-web/src/components/settings/SettingsDialog.vue index c54207b859..61167e2767 100644 --- a/apps/kimi-web/src/components/settings/SettingsDialog.vue +++ b/apps/kimi-web/src/components/settings/SettingsDialog.vue @@ -174,7 +174,7 @@ function setTab(tab: SettingsTab): void {