+52
-44
lines changedFilter options
+52
-44
lines changed Original file line number Diff line number Diff line change
@@ -363,7 +363,6 @@
363
363
"core.chat.Speaking": "I'm Listening, Please Speak...",
364
364
"core.chat.Type a message": "Enter a Question, Press [Enter] to Send / Press [Ctrl(Alt/Shift) + Enter] for New Line",
365
365
"core.chat.Unpin": "Unpin",
366
-
"core.chat.You need to a chat app": "You Do Not Have an Available App",
367
366
"core.chat.error.Chat error": "Chat Error",
368
367
"core.chat.error.Messages empty": "API Content is Empty, Possibly Due to Text Being Too Long",
369
368
"core.chat.error.Select dataset empty": "You Have Not Selected a Dataset",
Original file line number Diff line number Diff line change
@@ -363,7 +363,6 @@
363
363
"core.chat.Speaking": "我在听,请说...",
364
364
"core.chat.Type a message": "输入问题,发送 [Enter]/换行 [Ctrl(Alt/Shift) + Enter]",
365
365
"core.chat.Unpin": "取消置顶",
366
-
"core.chat.You need to a chat app": "你没有可用的应用",
367
366
"core.chat.error.Chat error": "对话出现异常",
368
367
"core.chat.error.Messages empty": "接口内容为空,可能文本超长了~",
369
368
"core.chat.error.Select dataset empty": "你没有选择知识库",
Original file line number Diff line number Diff line change
@@ -363,7 +363,6 @@
363
363
"core.chat.Speaking": "我在聽,請說...",
364
364
"core.chat.Type a message": "輸入問題,按 [Enter] 傳送 / 按 [Ctrl(Alt/Shift) + Enter] 換行",
365
365
"core.chat.Unpin": "取消釘選",
366
-
"core.chat.You need to a chat app": "您沒有可用的應用程式",
367
366
"core.chat.error.Chat error": "對話發生錯誤",
368
367
"core.chat.error.Messages empty": "API 內容為空,可能是文字過長",
369
368
"core.chat.error.Select dataset empty": "您尚未選擇知識庫",
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ import type { StartChatFnProps } from '@/components/core/chat/ChatContainer/type
25
25
import { streamFetch } from '@/web/common/api/fetch';
26
26
import { getChatTitleFromChatMessage } from '@fastgpt/global/core/chat/utils';
27
27
import { GPTMessages2Chats } from '@fastgpt/global/core/chat/adapt';
28
-
import { useLocalStorageState, useMemoizedFn } from 'ahooks';
28
+
import { useLocalStorageState, useMemoizedFn, useMount } from 'ahooks';
29
29
import { useChatStore } from '@/web/core/chat/context/useChatStore';
30
30
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
31
31
import { getInitChatInfo } from '@/web/core/chat/api';
@@ -51,6 +51,7 @@ import { ChatRecordContext } from '@/web/core/chat/context/chatRecordContext';
51
51
import { HUGGING_FACE_ICON } from '@fastgpt/global/common/system/constants';
52
52
import { getModelFromList } from '@fastgpt/global/core/ai/model';
53
53
import MyPopover from '@fastgpt/web/components/common/MyPopover';
54
+
import { ChatSidebarPaneEnum } from '../constants';
54
55
55
56
type Props = {
56
57
myApps: AppListItemType[];
@@ -73,9 +74,11 @@ const HomeChatWindow = ({ myApps }: Props) => {
73
74
const { isPc } = useSystem();
74
75
75
76
const { userInfo } = useUserStore();
76
-
const { llmModelList, defaultModels } = useSystemStore();
77
+
const { llmModelList, defaultModels, feConfigs } = useSystemStore();
77
78
const { chatId, appId, outLinkAuthData } = useChatStore();
78
79
80
+
const onHomeClick = useContextSelector(ChatSettingContext, (v) => v.handlePaneChange);
81
+
79
82
const isOpenSlider = useContextSelector(ChatContext, (v) => v.isOpenSlider);
80
83
const forbidLoadChat = useContextSelector(ChatContext, (v) => v.forbidLoadChat);
81
84
const onCloseSlider = useContextSelector(ChatContext, (v) => v.onCloseSlider);
@@ -168,6 +171,12 @@ const HomeChatWindow = ({ myApps }: Props) => {
168
171
}
169
172
);
170
173
174
+
useMount(() => {
175
+
if (!feConfigs?.isPlus) {
176
+
onHomeClick(ChatSidebarPaneEnum.RECENTLY_USED_APPS);
177
+
}
178
+
});
179
+
171
180
// 使用类似AppChatWindow的对话逻辑
172
181
const onStartChat = useMemoizedFn(
173
182
async ({
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
-
import React, { useCallback, useState } from 'react';
1
+
import React, { useCallback } from 'react';
2
2
import type { BoxProps } from '@chakra-ui/react';
3
-
import { Flex, Box, HStack, Image, Skeleton } from '@chakra-ui/react';
3
+
import { Flex, Box, HStack, Image } from '@chakra-ui/react';
4
4
import { motion, AnimatePresence } from 'framer-motion';
5
5
import { useRouter } from 'next/router';
6
6
import { useTranslation } from 'next-i18next';
@@ -10,8 +10,6 @@ import MyDivider from '@fastgpt/web/components/common/MyDivider';
10
10
import { useUserStore } from '@/web/support/user/useUserStore';
11
11
import UserAvatarPopover from '@/pageComponents/chat/UserAvatarPopover';
12
12
import MyBox from '@fastgpt/web/components/common/MyBox';
13
-
import MyPopover from '@fastgpt/web/components/common/MyPopover';
14
-
import SelectOneResource from '@/components/common/folder/SelectOneResource';
15
13
import MyIcon from '@fastgpt/web/components/common/Icon';
16
14
import type {
17
15
GetResourceFolderListProps,
@@ -280,45 +278,49 @@ const NavigationSection = () => {
280
278
<AnimatePresence mode="wait">
281
279
{isCollapsed ? (
282
280
<AnimatedSection show={true}>
283
-
<Flex flexDir="column" gap={2}>
284
-
<ActionButton
285
-
icon="core/chat/sidebar/home"
286
-
isCollapsed={true}
287
-
isActive={isHomeActive}
288
-
onClick={() => onHomeClick(ChatSidebarPaneEnum.HOME)}
289
-
/>
290
-
291
-
<ActionButton
292
-
icon="common/app"
293
-
isCollapsed={true}
294
-
isActive={isTeamAppsActive}
295
-
onClick={() => onHomeClick(ChatSidebarPaneEnum.TEAM_APPS)}
296
-
/>
297
-
</Flex>
281
+
<ActionButton
282
+
icon="core/chat/sidebar/home"
283
+
isCollapsed={true}
284
+
isActive={isHomeActive}
285
+
onClick={() => onHomeClick(ChatSidebarPaneEnum.HOME)}
286
+
/>
298
287
</AnimatedSection>
299
288
) : (
300
289
<AnimatedSection show={true}>
301
-
<Flex flexDir="column" gap={2}>
302
-
<ActionButton
303
-
icon="core/chat/sidebar/home"
304
-
text={t('chat:sidebar.home')}
305
-
isCollapsed={false}
306
-
isActive={isHomeActive}
307
-
onClick={() => onHomeClick(ChatSidebarPaneEnum.HOME)}
308
-
/>
309
-
310
-
<ActionButton
311
-
icon="common/app"
312
-
text={t('chat:sidebar.team_apps')}
313
-
isCollapsed={false}
314
-
isActive={isTeamAppsActive}
315
-
onClick={() => onHomeClick(ChatSidebarPaneEnum.TEAM_APPS)}
316
-
/>
317
-
</Flex>
290
+
<ActionButton
291
+
icon="core/chat/sidebar/home"
292
+
text={t('chat:sidebar.home')}
293
+
isCollapsed={false}
294
+
isActive={isHomeActive}
295
+
onClick={() => onHomeClick(ChatSidebarPaneEnum.HOME)}
296
+
/>
318
297
</AnimatedSection>
319
298
)}
320
299
</AnimatePresence>
321
300
)}
301
+
302
+
<AnimatePresence mode="wait">
303
+
{isCollapsed ? (
304
+
<AnimatedSection show={true}>
305
+
<ActionButton
306
+
icon="common/app"
307
+
isCollapsed={true}
308
+
isActive={isTeamAppsActive}
309
+
onClick={() => onHomeClick(ChatSidebarPaneEnum.TEAM_APPS)}
310
+
/>
311
+
</AnimatedSection>
312
+
) : (
313
+
<AnimatedSection show={true}>
314
+
<ActionButton
315
+
icon="common/app"
316
+
text={t('chat:sidebar.team_apps')}
317
+
isCollapsed={false}
318
+
isActive={isTeamAppsActive}
319
+
onClick={() => onHomeClick(ChatSidebarPaneEnum.TEAM_APPS)}
320
+
/>
321
+
</AnimatedSection>
322
+
)}
323
+
</AnimatePresence>
322
324
</Flex>
323
325
);
324
326
};
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { create, createJSONStorage, devtools, persist, immer } from '@fastgpt/we
2
2
import { getNanoid } from '@fastgpt/global/common/string/tools';
3
3
import { type OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
4
4
import type { ChatSourceEnum } from '@fastgpt/global/core/chat/constants';
5
-
import { ChatSidebarPaneEnum } from '@/pageComponents/chat/constants';
5
+
import type { ChatSidebarPaneEnum } from '@/pageComponents/chat/constants';
6
6
7
7
type State = {
8
8
source?: `${ChatSourceEnum}`;
@@ -17,7 +17,7 @@ type State = {
17
17
chatId: string;
18
18
setChatId: (e?: string) => any;
19
19
20
-
lastPane: ChatSidebarPaneEnum;
20
+
lastPane?: ChatSidebarPaneEnum;
21
21
setLastPane: (e: ChatSidebarPaneEnum) => any;
22
22
23
23
outLinkAuthData: OutLinkChatAuthProps;
@@ -115,7 +115,7 @@ export const useChatStore = create<State>()(
115
115
state.lastChatAppId = e;
116
116
});
117
117
},
118
-
lastPane: ChatSidebarPaneEnum.HOME,
118
+
lastPane: undefined,
119
119
setLastPane(e) {
120
120
set((state) => {
121
121
state.lastPane = e;
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4