refactor(web): extract ConversationToc from ConversationPane#1010
Merged
Conversation
Move the beta conversation outline (proportional bubbles, viewport indicator, hover tooltip) into a dedicated ConversationToc component. The child owns the nav markup, the tooltip hover state, and its own visibility (mobile / session-loading / single-turn), while the metric derivation and scroll-driven viewport/active-turn tracking stay in the pane because they are coupled to the scroll container. ConversationPane.vue: 1613 -> 1422 lines. No behavior change.
🦋 Changeset detectedLatest commit: a685d42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Part of the
apps/kimi-webgod-component split tracked inweb-refactor-plan.md(follows #998 Sidebar→WorkspaceGroup and #1001 ChatPane helpers). No standalone issue.Problem
ConversationPane.vuehad grown to 1613 lines. The beta conversation outline (the right-edge proportional-bubble table of contents with a viewport indicator and hover tooltip) is a self-contained piece of UI that lived inline in the pane: its own markup, its own tooltip hover state, and a sizable block of scoped CSS. Extracting it makes the pane easier to read and gives the outline a clear, testable boundary.What changed
apps/kimi-web/src/components/ConversationToc.vue:<nav class="conversation-toc">markup, the tooltip hover state (showTooltip/hideTooltip), and the TOC scoped CSS (moved verbatim).betaTocfeature flag.ConversationTocItemview type (mirroring howMentionMenu.vueexportsFileItem), so the pane imports the type instead of redefining it.ConversationPane.vue:<ConversationToc :items :metrics :active-turn-id :viewport :mobile :session-loading @select="scrollToTurn" />.conversationTocItems,tocMetrics,tocTotalHeight,activeTurnId,tocViewport,updateTocViewport(), andscrollToTurn()— these are coupled to the scroll container (panesRef) and feed both the outline and the auto-scroll/follow logic, so they belong in the pane.showTooltip/hideTooltip, theshowConversationToccomputed, and the moved CSS block.No user-visible behavior change. The DOM structure, class names, and scoped styles are preserved byte-for-byte.
Verification
pnpm --filter @moonshot-ai/kimi-web typecheck— pass (vue-tsc --noEmit)pnpm --filter @moonshot-ai/kimi-web test— 40 passedpnpm --filter @moonshot-ai/kimi-web build— passoxlint --type-awareon the two changed files — 0 warnings, 0 errorsChecklist
vue-tsc --noEmitis the safety net, plus manual verification.)gen-changesetsskill, or this PR needs no changeset. (Added.changeset/web-split-conversation-toc.md,patchon@moonshot-ai/kimi-code.)gen-docsskill, or this PR needs no doc update. (No user-facing change.)