diff --git a/.changeset/web-split-conversation-toc.md b/.changeset/web-split-conversation-toc.md new file mode 100644 index 000000000..b849e452b --- /dev/null +++ b/.changeset/web-split-conversation-toc.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Extract the beta conversation outline (table of contents) into its own component. diff --git a/apps/kimi-web/src/components/ConversationPane.vue b/apps/kimi-web/src/components/ConversationPane.vue index e303baba3..327613053 100644 --- a/apps/kimi-web/src/components/ConversationPane.vue +++ b/apps/kimi-web/src/components/ConversationPane.vue @@ -11,6 +11,7 @@ import ChatHeader from './ChatHeader.vue'; import Composer from './Composer.vue'; import SwarmCard from './SwarmCard.vue'; import ChatDock from './ChatDock.vue'; +import ConversationToc, { type ConversationTocItem } from './ConversationToc.vue'; import { getVisibleWorkspaces } from '../lib/workspacePicker'; import { safeRemove, STORAGE_KEYS } from '../lib/storage'; @@ -235,13 +236,6 @@ watch(hasDockWork, (hasWork) => { if (!hasWork) closeDockPanel(); }); -interface ConversationTocItem { - id: string; - role: ChatTurn['role']; - no: number; - title: string; -} - function tocTitle(turn: ChatTurn): string { if (turn.role === 'compaction') return t('conversation.compactedPlain'); if (turn.role === 'user') { @@ -304,11 +298,6 @@ const tocTotalHeight = computed(() => const activeTurnId = ref(null); const tocViewport = ref<{ top: number; height: number } | null>(null); -const tooltip = ref<{ visible: boolean; text: string; top: number }>({ - visible: false, - text: '', - top: 0, -}); function updateTocViewport(): void { const pane = panesRef.value; @@ -341,22 +330,6 @@ function updateTocViewport(): void { }; } -function showTooltip(text: string, event: MouseEvent): void { - const target = event.currentTarget as HTMLElement | null; - if (!target) return; - tooltip.value = { visible: true, text, top: target.offsetTop }; -} - -function hideTooltip(): void { - tooltip.value.visible = false; -} - -const showConversationToc = computed(() => - !props.mobile && - !props.sessionLoading && - conversationTocItems.value.length > 1, -); - // The first pending question (if any) const pendingQuestion = computed(() => props.questions && props.questions.length > 0 ? props.questions[0] : undefined, @@ -905,42 +878,16 @@ defineExpose({ loadComposerForEdit }); /> - +
+ + + + +