Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-ai-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0c67f369
authored
May 08, 2025
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
重新生成
1 parent
e948cb6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
33 deletions
app/components/base/chat/chat/answer/index.tsx
app/components/base/chat/chat/answer/operation.tsx
app/components/base/chat/chat/index.tsx
app/components/base/chat/chat/answer/index.tsx
View file @
0c67f36
...
...
@@ -24,6 +24,7 @@ type AnswerProps = {
config?: ChatConfig;
answerIcon?: ReactNode;
responding?: boolean;
isLast?: boolean;
showPromptLog?: boolean;
chatAnswerContainerInner?: string;
hideProcessDetail?: boolean;
...
...
@@ -39,6 +40,7 @@ const Answer: FC<AnswerProps> = ({
answerIcon,
responding,
showPromptLog,
isLast,
chatAnswerContainerInner,
hideProcessDetail,
appData,
...
...
@@ -119,6 +121,7 @@ const Answer: FC<AnswerProps> = ({
maxSize={containerWidth - contentWidth - 4}
contentWidth={contentWidth}
item={item}
isLast={isLast}
question={question}
index={index}
showPromptLog={showPromptLog}
...
...
@@ -188,37 +191,6 @@ const Answer: FC<AnswerProps> = ({
showHitInfo={config?.supportCitationHitInfo}
/>
)}
{item.siblingCount &&
item.siblingCount > 1 &&
item.siblingIndex !== undefined && (
<div className="flex items-center justify-center pt-3.5 text-sm">
<button
className={`${
item.prevSibling ? "opacity-100" : "opacity-30"
}`}
disabled={!item.prevSibling}
onClick={() =>
item.prevSibling && switchSibling?.(item.prevSibling)
}
>
<ChevronRight className="h-[14px] w-[14px] rotate-180 text-text-primary" />
</button>
<span className="px-2 text-xs text-text-primary">
{item.siblingIndex + 1} / {item.siblingCount}
</span>
<button
className={`${
item.nextSibling ? "opacity-100" : "opacity-30"
}`}
disabled={!item.nextSibling}
onClick={() =>
item.nextSibling && switchSibling?.(item.nextSibling)
}
>
<ChevronRight className="h-[14px] w-[14px] text-text-primary" />
</button>
</div>
)}
</div>
</div>
<More more={more} />
...
...
app/components/base/chat/chat/answer/operation.tsx
View file @
0c67f36
...
...
@@ -26,12 +26,14 @@ type OperationProps = {
index: number;
showPromptLog?: boolean;
maxSize: number;
isLast?: boolean;
contentWidth: number;
hasWorkflowProcess: boolean;
noChatInput?: boolean;
};
const Operation: FC<OperationProps> = ({
item,
isLast,
question,
index,
showPromptLog,
...
...
@@ -75,6 +77,10 @@ const Operation: FC<OperationProps> = ({
await onFeedback?.(id, { rating });
setLocalFeedback({ rating });
Toast.notify({
type: "success",
message: "成功",
});
};
const operationWidth = useMemo(() => {
...
...
@@ -151,13 +157,13 @@ const Operation: FC<OperationProps> = ({
copy(content);
Toast.notify({
type: "success",
message:
t("common.actionMsg.copySuccessfully")
,
message:
"复制成功"
,
});
}}
>
<RiClipboardLine className="h-4 w-4" />
</ActionButton>
{!noChatInput && (
{!noChatInput &&
isLast&&
(
<ActionButton onClick={() => onRegenerate?.(item)}>
<RiResetLeftLine className="h-4 w-4" />
</ActionButton>
...
...
app/components/base/chat/chat/index.tsx
View file @
0c67f36
...
...
@@ -271,6 +271,7 @@ const Chat: FC<ChatProps> = ({
{chatList.map((item, index) => {
if (item.isAnswer) {
const isLast = item.id === chatList[chatList.length - 1]?.id;
return (
<Answer
appData={appData}
...
...
@@ -280,6 +281,7 @@ const Chat: FC<ChatProps> = ({
index={index}
config={config}
answerIcon={answerIcon}
isLast={isLast}
responding={isLast && isResponding}
showPromptLog={showPromptLog}
chatAnswerContainerInner={chatAnswerContainerInner}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment