forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ refactor: migration the ChatList into Conversation (lobehub#916)
* ♻️ refactor: migration the ChatList into conversation * ♻️ refactor: refactor chat list * 🎨 chore: improve code * 🚚 refactor: refactor with hooks
- Loading branch information
Showing
74 changed files
with
485 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...nversation/ChatList/Actions/Assistant.tsx → ...atures/Conversation/Actions/Assistant.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...s/Conversation/ChatList/Actions/Error.tsx → src/features/Conversation/Actions/Error.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...onversation/ChatList/Actions/Fallback.tsx → ...eatures/Conversation/Actions/Fallback.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...onversation/ChatList/Actions/Function.tsx → ...eatures/Conversation/Actions/Function.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...es/Conversation/ChatList/Actions/User.tsx → src/features/Conversation/Actions/User.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...es/Conversation/ChatList/Actions/index.ts → src/features/Conversation/Actions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...onversation/ChatList/Error/OpenAPIKey.tsx → ...eatures/Conversation/Error/OpenAPIKey.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...rsation/ChatList/Error/OpenAiBizError.tsx → ...res/Conversation/Error/OpenAiBizError.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...ion/ChatList/Error/Plugin/PluginError.tsx → ...Conversation/Error/Plugin/PluginError.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...res/Conversation/ChatList/Error/index.tsx → src/features/Conversation/Error/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...res/Conversation/ChatList/Extras/index.ts → src/features/Conversation/Extras/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
src/features/Conversation/components/ChatList/ActionsBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ActionIconGroup, type ActionIconGroupProps } from '@lobehub/ui'; | ||
import { memo } from 'react'; | ||
|
||
import { useChatListActionsBar } from '../../hooks/useChatListActionsBar'; | ||
|
||
export interface ActionsBarProps extends ActionIconGroupProps { | ||
text?: { | ||
copy?: string; | ||
delete?: string; | ||
edit?: string; | ||
regenerate?: string; | ||
}; | ||
} | ||
|
||
const ActionsBar = memo<ActionsBarProps>(({ text, ...rest }) => { | ||
const { regenerate, edit, copy, divider, del } = useChatListActionsBar(text); | ||
return ( | ||
<ActionIconGroup | ||
dropdownMenu={[edit, copy, regenerate, divider, del]} | ||
items={[regenerate, edit]} | ||
type="ghost" | ||
{...rest} | ||
/> | ||
); | ||
}); | ||
|
||
export default ActionsBar; |
23 changes: 23 additions & 0 deletions
23
src/features/Conversation/components/ChatList/HistoryDivider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Icon, Tag } from '@lobehub/ui'; | ||
import { Divider } from 'antd'; | ||
import { Timer } from 'lucide-react'; | ||
import { memo } from 'react'; | ||
|
||
interface HistoryDividerProps { | ||
enable?: boolean; | ||
text?: string; | ||
} | ||
|
||
const HistoryDivider = memo<HistoryDividerProps>(({ enable, text }) => { | ||
if (!enable) return null; | ||
|
||
return ( | ||
<div style={{ padding: '0 20px' }}> | ||
<Divider> | ||
<Tag icon={<Icon icon={Timer} />}>{text || 'History Message'}</Tag> | ||
</Divider> | ||
</div> | ||
); | ||
}); | ||
|
||
export default HistoryDivider; |
Oops, something went wrong.