Repository navigation
refactor(plugin-chatbot): move ChatbotEnhanced types, subcomponents and helpers into chat/ - #37799
Merged
Merged
Conversation
… and helpers into chat/ A move-only split with no behaviour change. ChatbotEnhanced.tsx keeps the component, formatMessageProps and the plain-surface constants, and re-exports by name every symbol it exported before. Claude-Session: https://claude.ai/code/session_01Q4EjjMaLacWen8f2akYQCJ Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Nov 27, 2026
os-zhuang
approved these changes
Nov 27, 2026
This was referenced Nov 27, 2026
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.
Requested by Jack · project thread
Fixes #37728
Clause-②: no
Metadata-protocol: none
维护者速读
ChatbotEnhanced.tsx里的类型、子组件和工具函数搬到src/chat/下 7 个文件,不改行为。What changes
A move-only split of
ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: 3335 → 1514 lines. The file keeps theChatbotEnhancedcomponent,formatMessagePropsand the twoPLAIN_SURFACE_*constants, and re-exports by name (export { … } from,export type { … } from, noexport *) every symbol it exported before. Every existing import path keeps working, soFloatingChatbot,chatMessageAdapter,mapMessages,renderer,toolResultParsers,useAiModels,useHitlInChatand the tests are untouched.New modules under
src/chat/, exactly as the card lists them:types.tsChatbotEnhancedMessage,ChatbotEnhancedToolInvocation,ChatChart,ChatSource,ChatbotLabels,ChatbotEnhancedProps,ChatbotProcessVisibility,ChatbotSurface,ChatbotModelOption,ToolDecisionState,TurnLivenessModelPicker.tsxModelPicker,drawnMultiplierOf,EXPENSIVE_MODEL_MULTIPLIER,OUTSIDE_MODELSliveness.tsxuseTurnLiveness,LivenessIndicator,LIVENESS_QUIET_AFTER_SECONDS,useIsOffline,formatElapsed,ThinkingDots,AssistantThinkingMessage,MessageAvatartoolSummary.tsxgetToolState,getToolStateRank,ToolSummaryState,ToolSummaryGroup,shouldRenderDetailedTool,summarizeTools,ToolPhaseSummary,ToolPhaseStep,foldToolPhaseSteps,isPlumbingTool,PLUMBING_TOOL_NAMES,ToolActivitySummary,ToolActivitySummaryLabels,ToolSummaryIcon,getToolSummaryStatus,ToolRunningTimer,usePhaseElapsed,phaseClock,SmartToolOutput,looksLikeJsonanswerLayout.tsxlayoutAnswer,AnswerBlock,AnswerCharts,isToolCallPlaceholdertoolRecordWrite.tswrittenRecordOf,formatRecordWriteValuecomposerNotices.tsxErrorBanner,ComposerNotice,SendErrorNotice,formatSizeLimit,useAiQuotaCopyEvery top-level declaration of the old file is named in the card, so no private helper had to be placed by judgement and none stayed behind.
phaseClock. The module-levelMapmoved withusePhaseElapsedintotoolSummary.tsx; there is no other copy.toolSummary → liveness(ToolRunningTimerreadsuseIsOfflineandformatElapsed), every module →types. No new module importsChatbotEnhanced.tsx, andtypes.tsreaches../mapMessageswithimport typeonly.plugin-chatbot/src/index.tsx,plugin-chatbot/src/core.tsandapp-shell/src/index.tshave an empty diff.The split was generated by a script that works from symbol names (TypeScript AST), not line numbers. It was first run on #37720's head and re-run on main after #37720 landed; the second run produced byte-identical files.
Why
Card #37728, split A of topic #37690. Upcoming chat changes (feedback, approval cards, a thinking timeline) all land in this file; split B (#37729) moves
renderToolDetailnext and builds ontoolRecordWrite.ts.Verification
The deleted lines and the added lines differ only in import/export lines: comparing the two multisets of the diff, what is not in both is import specifiers, the new re-export block,
exportadded in front of moved declarations, and each new file's license header and one-paragraph module comment. Nothing else changed.Readings on head
2ed21c64, against main6e8f6637:pnpm run type-checkinui/packages/plugin-chatbot(tsc --noEmitandtsc -p tsconfig.test.json): exit 0.pnpm run buildinui/packages/plugin-chatbot: exit 0.pnpm --dir ui exec vitest run packages/plugin-chatbot/ packages/core/src/utils/__tests__/column-identity.ratchet.test.ts: 70 files, 668 tests passed.ChatbotEnhanced.tsxandsrc/chat/: 0 errors, 9 warnings. Before the split the file had 2 warnings (onereact-refresh/only-export-components, onereact-hooks/set-state-in-effect). The 7 new ones are allreact-refresh/only-export-components: the card's layout puts components and helpers in the same modules (for exampleliveness.tsxexportsformatElapsedbesideThinkingDots). It is a fast-refresh hint, no gate counts warnings, and splitting further would leave the card's layout.pnpm --dir ui exec vitest run scripts/(which coversone-authority-per-exported-name-6273),check-adr-0087-registration --base origin/main,check-empty-changeset,check-changeset-no-majorandcheck:test-source-alias. Alsopnpm check:changeset-fixed,pnpm --dir ui check:new-line-citations(0 new) andcheck-platform-checklist --changed-from origin/main: exit 0.overlap-check: merges cleanly with main, no open PR shares a file.Changeset:
.changeset/37728-chatbot-enhanced-split-a.md,patchfor@object-ui/plugin-chatbot, with both declaration lines.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4EjjMaLacWen8f2akYQCJ