mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-09 15:58:30 +00:00
feat(sidebar): add isPlaygroundSidebarOpen prop for improved sidebar state management
- Introduced isPlaygroundSidebarOpen prop to Sidebar component for better control of sidebar visibility. - Updated LayoutShell to manage playground sidebar state, enhancing user experience and navigation consistency.
This commit is contained in:
parent
2fa8b76b56
commit
33e685c6ed
2 changed files with 6 additions and 1 deletions
|
|
@ -352,6 +352,9 @@ export function LayoutShell({
|
|||
onPlaygroundItemClick={
|
||||
playgroundSidebar ? handlePlaygroundSidebarToggle : undefined
|
||||
}
|
||||
isPlaygroundSidebarOpen={
|
||||
playgroundSidebar ? !isPlaygroundSidebarCollapsed : undefined
|
||||
}
|
||||
chats={chats}
|
||||
activeChatId={activeChatId}
|
||||
onNewChat={onNewChat}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ interface SidebarProps {
|
|||
navItems: NavItem[];
|
||||
onNavItemClick?: (item: NavItem) => void;
|
||||
onPlaygroundItemClick?: (item: NavItem) => void;
|
||||
isPlaygroundSidebarOpen?: boolean;
|
||||
chats: ChatItem[];
|
||||
activeChatId?: number | null;
|
||||
onNewChat: () => void;
|
||||
|
|
@ -91,6 +92,7 @@ export function Sidebar({
|
|||
navItems,
|
||||
onNavItemClick,
|
||||
onPlaygroundItemClick,
|
||||
isPlaygroundSidebarOpen,
|
||||
chats,
|
||||
activeChatId,
|
||||
onNewChat,
|
||||
|
|
@ -246,7 +248,7 @@ export function Sidebar({
|
|||
label={playgroundItem.title}
|
||||
onClick={() => (onPlaygroundItemClick ?? onNavItemClick)?.(playgroundItem)}
|
||||
isCollapsed={isCollapsed}
|
||||
isActive={playgroundItem.isActive}
|
||||
isActive={isPlaygroundSidebarOpen ?? playgroundItem.isActive}
|
||||
badge={<SidebarButtonBadge>New</SidebarButtonBadge>}
|
||||
tooltipContent={isCollapsed ? playgroundItem.title : undefined}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue