mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 09:03:15 +00:00
feat: enhance agent sharing functionality and UI improvements
- Added shared agents state management in Navigation and AgentsList components. - Implemented fetching and displaying shared agents in the AgentsList. - Introduced functionality to hide shared agents with appropriate API integration. - Updated the SharedAgent component layout for better UI consistency. - Improved error handling in conversation fetching logic. - Added new API endpoint for hiding shared agents. - Updated Redux slice to manage shared agents state. - Refactored AgentCard and AgentSection components for better code organization and readability.
This commit is contained in:
@@ -25,6 +25,7 @@ export interface Preference {
|
||||
modalState: ActiveState;
|
||||
paginatedDocuments: Doc[] | null;
|
||||
agents: Agent[] | null;
|
||||
sharedAgents: Agent[] | null;
|
||||
selectedAgent: Agent | null;
|
||||
}
|
||||
|
||||
@@ -51,6 +52,7 @@ const initialState: Preference = {
|
||||
modalState: 'INACTIVE',
|
||||
paginatedDocuments: null,
|
||||
agents: null,
|
||||
sharedAgents: null,
|
||||
selectedAgent: null,
|
||||
};
|
||||
|
||||
@@ -91,6 +93,9 @@ export const prefSlice = createSlice({
|
||||
setAgents: (state, action) => {
|
||||
state.agents = action.payload;
|
||||
},
|
||||
setSharedAgents: (state, action) => {
|
||||
state.sharedAgents = action.payload;
|
||||
},
|
||||
setSelectedAgent: (state, action) => {
|
||||
state.selectedAgent = action.payload;
|
||||
},
|
||||
@@ -109,6 +114,7 @@ export const {
|
||||
setModalStateDeleteConv,
|
||||
setPaginatedDocuments,
|
||||
setAgents,
|
||||
setSharedAgents,
|
||||
setSelectedAgent,
|
||||
} = prefSlice.actions;
|
||||
export default prefSlice.reducer;
|
||||
@@ -185,5 +191,7 @@ export const selectTokenLimit = (state: RootState) =>
|
||||
export const selectPaginatedDocuments = (state: RootState) =>
|
||||
state.preference.paginatedDocuments;
|
||||
export const selectAgents = (state: RootState) => state.preference.agents;
|
||||
export const selectSharedAgents = (state: RootState) =>
|
||||
state.preference.sharedAgents;
|
||||
export const selectSelectedAgent = (state: RootState) =>
|
||||
state.preference.selectedAgent;
|
||||
|
||||
Reference in New Issue
Block a user