feat: 生成中禁用返回按钮
This commit is contained in:
parent
ced3b45569
commit
0028e142f7
|
|
@ -99,8 +99,8 @@ export default function ChatPage() {
|
||||||
onStart: (currentThreadId) => {
|
onStart: (currentThreadId) => {
|
||||||
setIsNewThread(false);
|
setIsNewThread(false);
|
||||||
// if (!shouldStayOnNewRoute) {
|
// if (!shouldStayOnNewRoute) {
|
||||||
// Keep /new in history so router.back() can return to it.
|
// Keep /new in history so router.back() can return to it.
|
||||||
router.replace(`/workspace/chats/${currentThreadId}?is_chatting=true`);
|
router.replace(`/workspace/chats/${currentThreadId}?is_chatting=true`);
|
||||||
// }
|
// }
|
||||||
// history.pushState(null, "", pathOfThread(currentThreadId));
|
// history.pushState(null, "", pathOfThread(currentThreadId));
|
||||||
},
|
},
|
||||||
|
|
@ -193,6 +193,7 @@ export default function ChatPage() {
|
||||||
|
|
||||||
const todoListCollapsed = true;
|
const todoListCollapsed = true;
|
||||||
const [showExitDialog, setShowExitDialog] = useState(false);
|
const [showExitDialog, setShowExitDialog] = useState(false);
|
||||||
|
const isStreaming = isUploading || thread.isLoading;
|
||||||
const handleSubmit = useCallback(
|
const handleSubmit = useCallback(
|
||||||
(message: Parameters<typeof sendMessage>[1]) => {
|
(message: Parameters<typeof sendMessage>[1]) => {
|
||||||
if (isSelectedSkillBootstrapping) {
|
if (isSelectedSkillBootstrapping) {
|
||||||
|
|
@ -225,7 +226,7 @@ export default function ChatPage() {
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThreadContext.Provider value={{ threadId,thread }}>
|
<ThreadContext.Provider value={{ threadId, thread }}>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"m-auto flex h-screen min-h-svh overflow-hidden rounded-t-[20px] transition-[width] duration-300 ease-in-out",
|
"m-auto flex h-screen min-h-svh overflow-hidden rounded-t-[20px] transition-[width] duration-300 ease-in-out",
|
||||||
|
|
@ -252,6 +253,7 @@ export default function ChatPage() {
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="px-[10px] py-[5px] text-sm font-medium text-[#150033] hover:text-[#150033]/80"
|
className="px-[10px] py-[5px] text-sm font-medium text-[#150033] hover:text-[#150033]/80"
|
||||||
|
disabled={isStreaming}
|
||||||
onClick={() => setShowExitDialog(true)}
|
onClick={() => setShowExitDialog(true)}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|
@ -354,6 +356,7 @@ export default function ChatPage() {
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"h-full w-full transition-transform duration-300 ease-in-out",
|
"h-full w-full transition-transform duration-300 ease-in-out",
|
||||||
|
showWelcomeStyle && !hasSubmitted ? "translate-x-0" : "",
|
||||||
artifactPanelOpen ? "translate-x-0" : "translate-x-full",
|
artifactPanelOpen ? "translate-x-0" : "translate-x-full",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
@ -475,7 +478,7 @@ export default function ChatPage() {
|
||||||
<DevDialogTitle>提示</DevDialogTitle>
|
<DevDialogTitle>提示</DevDialogTitle>
|
||||||
</DevDialogHeader>
|
</DevDialogHeader>
|
||||||
<p className="text-muted-foreground text-sm">
|
<p className="text-muted-foreground text-sm">
|
||||||
(测试中:计划销毁但是现在没有销毁) 退出后,当前会话结束并销毁,请先下载保存当前结果!
|
(测试中:计划销毁但是现在没有销毁) 退出后,当前会话结束并销毁,请先下载保存当前结果!
|
||||||
</p>
|
</p>
|
||||||
<DevDialogFooter>
|
<DevDialogFooter>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue