Description:
Allow the ChatbotConversationHistoryNav component to render a sort button next to the search input field.
This will allow users to sort conversations (e.g., A–Z, Z–A, newest–oldest, oldest–newest) depending on the supported sort types as shown below.
Proposed Solution:
Introduce a new prop to ChatbotConversationHistoryNav that accepts a fully-rendered UI element and renders it adjacent to the search input field. This could be any button, dropdown, or a custom component. The consuming application handles the logic and the state of the element.
Example:
export interface ChatbotConversationHistoryNavProps extends DrawerProps {
// Adds actions to the search bar
searchActions?: {
startAdornment?: React.ReactNode;
endAdornment?: React.ReactNode;
};
// ...other props
};
Open UX Question:
Should the sort icon visually change when switching between ascending and descending? If we're allowing any custom component here, the consuming application can manage that interaction.