Commit 3b532497 by liimin

```

feat(chat): 调整聊天界面样式与头像配置支持自定义

- 修改聊天气泡间距与圆角样式,优化视觉效果
- 支持通过 URL 参数自定义 AI 和用户头像地址
- 更新移动端内边距及重启按钮尺寸
```
1 parent a7e01060
...@@ -22,12 +22,12 @@ const Answer: FC<AnswerProps> = ({ chatAnswerContainerInner }) => { ...@@ -22,12 +22,12 @@ const Answer: FC<AnswerProps> = ({ chatAnswerContainerInner }) => {
<AnswerIcon /> <AnswerIcon />
<LoadingAvatar /> <LoadingAvatar />
</div> </div>
<div className="chat-answer-container group ml-4 w-0 grow pb-2" ref={containerRef}> <div className="chat-answer-container group ml-2 w-0 grow pb-2" ref={containerRef}>
<div className={cn('group relative pr-14', chatAnswerContainerInner)}> <div className={cn('group relative pr-14', chatAnswerContainerInner)}>
<div <div
ref={contentRef} ref={contentRef}
className={cn( className={cn(
'body-lg-regular relative inline-block max-w-full rounded-2xl bg-chat-bubble-bg px-4 py-3 text-text-primary', 'body-lg-regular relative inline-block max-w-full rounded-2xl rounded-bl-none bg-chat-bubble-bg px-4 py-3 text-text-primary',
workflowProcess && 'w-full', workflowProcess && 'w-full',
)}> )}>
<Operation /> <Operation />
......
...@@ -38,7 +38,7 @@ const ReStart: FC = () => { ...@@ -38,7 +38,7 @@ const ReStart: FC = () => {
/> />
)} )}
<div className="absolute left-3"> <div className="absolute left-3">
<img onClick={handleRestart} src={CLEAR_BUTTON} className="size-6 hover:cursor-pointer" alt="icon" /> <img onClick={handleRestart} src={CLEAR_BUTTON} className="size-8 hover:cursor-pointer" alt="icon" />
</div> </div>
</> </>
) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: liimin 17653212@qq.com * @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:38 * @Date: 2025-04-16 18:17:38
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2025-07-23 20:01:19 * @LastEditTime: 2025-12-08 18:37:32
* @FilePath: \ai-assistant\app\components\base\chat\chat\index.tsx * @FilePath: \ai-assistant\app\components\base\chat\chat\index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -74,7 +74,7 @@ const Chat: FC<ChatProps> = () => { ...@@ -74,7 +74,7 @@ const Chat: FC<ChatProps> = () => {
<div <div
ref={chatContainerInnerRef} ref={chatContainerInnerRef}
className={cn('w-full', 'px-8', `mx-auto pt-6 w-full max-w-[800px]`, { className={cn('w-full', 'px-8', `mx-auto pt-6 w-full max-w-[800px]`, {
'px-4': isMobile, 'px-3': isMobile,
})}> })}>
<InitQuestions /> <InitQuestions />
<ChatBody /> <ChatBody />
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2025-06-23 15:19:04 * @Date: 2025-06-23 15:19:04
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2025-07-23 16:10:28 * @LastEditTime: 2025-12-08 19:06:24
* @FilePath: \ai-assistant\app\components\base\chat\chat\question\init-questions.tsx * @FilePath: \ai-assistant\app\components\base\chat\chat\question\init-questions.tsx
*/ */
import type { FC } from 'react' import type { FC } from 'react'
...@@ -26,11 +26,11 @@ const InitQuestions: FC = () => { ...@@ -26,11 +26,11 @@ const InitQuestions: FC = () => {
return ( return (
<div className="mb-2 flex last:mb-0"> <div className="mb-2 flex last:mb-0">
<div className="relative h-10 w-10 shrink-0">{<AnswerIcon />}</div> <div className="relative h-10 w-10 shrink-0">{<AnswerIcon />}</div>
<div className="chat-answer-container group ml-4 w-0 grow pb-2"> <div className="chat-answer-container group ml-2 w-0 grow pb-2">
<div className={cn('group relative pr-14')}> <div className={cn('group relative pr-14')}>
<div <div
className={cn( className={cn(
'body-lg-regular relative inline-block max-w-full rounded-2xl bg-chat-bubble-bg px-4 py-3 text-text-primary', 'body-lg-regular relative inline-block max-w-full rounded-2xl rounded-bl-none bg-chat-bubble-bg px-4 py-3 text-text-primary',
)}> )}>
{initial_message && <Markdown content={initial_message} />} {initial_message && <Markdown content={initial_message} />}
{suggestedQuestions.length > 0 && <InitSuggest suggestedQuestions={suggestedQuestions} />} {suggestedQuestions.length > 0 && <InitSuggest suggestedQuestions={suggestedQuestions} />}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2025-04-16 18:17:38 * @Date: 2025-04-16 18:17:38
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2025-07-21 16:36:40 * @LastEditTime: 2025-12-08 19:11:28
* @FilePath: \ai-assistant\app\components\base\chat\chat\question\question.tsx * @FilePath: \ai-assistant\app\components\base\chat\chat\question\question.tsx
*/ */
import type { FC } from 'react' import type { FC } from 'react'
...@@ -14,16 +14,17 @@ import { Markdown } from '@/app/components/base/markdown' ...@@ -14,16 +14,17 @@ import { Markdown } from '@/app/components/base/markdown'
import { useChatBodyContext } from '@/app/components/base/chat/chat/body/context' import { useChatBodyContext } from '@/app/components/base/chat/chat/body/context'
import { AVATAR_USER_URL } from '@/app/components/base/chat/constants' import { AVATAR_USER_URL } from '@/app/components/base/chat/constants'
import AnswerIcon from '@/app/components/base/answer-icon' import AnswerIcon from '@/app/components/base/answer-icon'
import cn from '@/utils/classnames'
const Question: FC = () => { const Question: FC = () => {
const { content, theme } = useChatBodyContext() const { content, theme } = useChatBodyContext()
return ( return (
<div className="mb-2 flex justify-end pl-14 last:mb-0"> <div className="mb-2 flex justify-end pl-14 last:mb-0">
<div className="group relative mr-4 max-w-full"> <div className={cn('group', 'relative', 'mr-2', 'max-w-full')}>
<div <div
className="rounded-2xl bg-[#D1E9FF]/50 px-4 py-3 text-sm text-gray-900" className="rounded-2xl rounded-br-none bg-[#3773F8] px-4 py-3 text-sm text-gray-900"
style={theme?.chatBubbleColorStyle ? CssTransform(theme?.chatBubbleColorStyle) : {}}> style={theme?.chatBubbleColorStyle ? CssTransform(theme?.chatBubbleColorStyle) : {}}>
{/* {!!message_files?.length && <FileList files={message_files} showDeleteAction={false} showDownloadAction={true} />} */} {/* {!!message_files?.length && <FileList files={message_files} showDeleteAction={false} showDownloadAction={true} />} */}
<Markdown content={content} /> <Markdown content={content} className='!text-white' />
</div> </div>
<div className="mt-1 h-[8px]" /> <div className="mt-1 h-[8px]" />
</div> </div>
......
...@@ -9,8 +9,12 @@ ...@@ -9,8 +9,12 @@
export const CONVERSATION_ID_INFO = 'conversationIdInfo' export const CONVERSATION_ID_INFO = 'conversationIdInfo'
export const UUID_NIL = '00000000-0000-0000-0000-000000000000' export const UUID_NIL = '00000000-0000-0000-0000-000000000000'
export const AVATAR_AI_URL = 'https://img01.glsx.com.cn/weapp/resource/saas/ai/ai-avatar.png' const __search = globalThis?.location?.search ?? ''
export const AVATAR_USER_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/ai/user-avatar.png' const __params = new URLSearchParams(__search)
const __DEFAULT_AI = 'https://img01.glsx.com.cn/weapp/resource/saas/ai/ai-avatar.png'
const __DEFAULT_USER = 'https://img02.glsx.com.cn/weapp/resource/saas/ai/user-avatar.png'
export const AVATAR_AI_URL = __params.get('avatar_ai') || __params.get('ai_avatar') || __DEFAULT_AI
export const AVATAR_USER_URL = __params.get('avatar_user') || __params.get('user_avatar') || __params.get('avatar') || __DEFAULT_USER
export const MAIN_TITLE = '广联AI集市' export const MAIN_TITLE = '广联AI集市'
// export const SELF_INPUT = '0' // export const SELF_INPUT = '0'
// export const AUTO_INPUT = '1' // export const AUTO_INPUT = '1'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!