@@ -45,19 +45,12 @@ export interface WelcomeSuggestion {
4545}
4646
4747interface ThreadProps {
48- // 错误信息
4948 errorMessage ?: string ;
50- // 是否显示设置操作按钮
5149 showSettingsAction ?: boolean ;
52- // 清除错误的回调函数
5350 onClearError ?: ( ) => void ;
54- // AI 生成的后续问题建议
5551 suggestions ?: string [ ] ;
56- // 是否正在加载建议
5752 isLoadingSuggestions ?: boolean ;
58- // AI 生成的欢迎问题建议
5953 welcomeSuggestions ?: WelcomeSuggestion [ ] ;
60- // 是否正在加载欢迎建议
6154 isLoadingWelcome ?: boolean ;
6255}
6356
@@ -70,7 +63,6 @@ export const Thread: FC<ThreadProps> = ({
7063 welcomeSuggestions,
7164 isLoadingWelcome,
7265} ) => {
73- // 控制设置对话框是否打开的状态
7466 const [ isSettingsOpen , setIsSettingsOpen ] = useState ( false ) ;
7567
7668 const handleSettingsChange = useCallback (
@@ -83,7 +75,6 @@ export const Thread: FC<ThreadProps> = ({
8375 [ onClearError ] ,
8476 ) ;
8577
86- // 打开设置对话框的处理函数
8778 const handleOpenSettings = useCallback ( ( ) => {
8879 handleSettingsChange ( true ) ;
8980 } , [ handleSettingsChange ] ) ;
@@ -206,7 +197,6 @@ const ThreadScrollToBottom: FC = () => {
206197 ) ;
207198} ;
208199
209- // 欢迎界面组件
210200const ThreadWelcome : FC = ( ) => {
211201 return (
212202 < ThreadPrimitive . Empty >
@@ -237,7 +227,6 @@ const ThreadWelcome: FC = () => {
237227 ) ;
238228} ;
239229
240- // 欢迎页面的初始建议组件
241230interface ThreadWelcomeSuggestionsProps {
242231 suggestions ?: WelcomeSuggestion [ ] ;
243232 isLoading ?: boolean ;
@@ -330,14 +319,12 @@ const ThreadWelcomeSuggestions: FC<ThreadWelcomeSuggestionsProps> = ({
330319 ) ;
331320} ;
332321
333- // 输入框组件 Props
334322interface ComposerProps {
335323 isSettingsOpen : boolean ;
336324 onOpenChange : ( open : boolean ) => void ;
337325 onClearError ?: ( ) => void ;
338326}
339327
340- // 输入框组件,负责处理用户输入和发送消息
341328const Composer : FC < ComposerProps > = ( {
342329 isSettingsOpen,
343330 onOpenChange,
@@ -366,7 +353,6 @@ const Composer: FC<ComposerProps> = ({
366353 return (
367354 < div className = "aui-composer-wrapper sticky bottom-0 mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible bg-[var(--background)] pb-4 md:pb-6 pt-2 border-t border-[var(--foreground)]" >
368355 < ThreadScrollToBottom />
369- { /* 当没有消息时,显示空状态内容(现已经移到上面的Viewport内以统一滑动,这里可以置空或保留其它用途)*/ }
370356 < ComposerPrimitive . Root
371357 className = "aui-composer-root relative flex w-full flex-col rounded-none border border-[var(--foreground)] bg-[var(--background)] px-1 pt-2 shadow-none"
372358 aria-disabled = { ! hasActiveKey }
@@ -418,7 +404,6 @@ interface ComposerActionProps {
418404 onClearError ?: ( ) => void ;
419405}
420406
421- // 输入框操作按钮组件(发送、设置、取消)
422407const ComposerAction : FC < ComposerActionProps > = ( {
423408 canSend,
424409 isSettingsOpen,
@@ -660,7 +645,6 @@ const EditComposer: FC = () => {
660645 ) ;
661646} ;
662647
663- // 分支切换组件(用于在多次生成的回复之间切换)
664648const BranchPicker : FC < BranchPickerPrimitive . Root . Props > = ( {
665649 className,
666650 ...rest
@@ -691,13 +675,11 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
691675 ) ;
692676} ;
693677
694- // 后续问题建议组件 Props
695678interface ThreadFollowupSuggestionsProps {
696679 suggestions ?: string [ ] ;
697680 isLoading ?: boolean ;
698681}
699682
700- // 后续问题建议组件,显示 AI 生成的建议问题
701683const ThreadFollowupSuggestions : FC < ThreadFollowupSuggestionsProps > = ( {
702684 suggestions,
703685 isLoading,
0 commit comments