Files
738c568e6b Sidebar manager (#39795)
* sidebar-manager

* storage keys

* tests

* more ai spots

* test fix

* revert to default

* remove ref

* Update apps/studio/state/sidebar-manager-state.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix ts

* fix

* fux

* fux query param

* clean

* fix

* more

* mock local storage

* simplify

* remove provider test

* remve useopensidebar

* fix(new homepage): open ai assistant on advisor card button clicks

* Update apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/studio/state/sidebar-manager-state.tsx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* refine

* FIX

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-10-28 10:07:21 +10:00

33 lines
818 B
TypeScript

import { Fragment } from 'react'
import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'
import { ResizableHandle, ResizablePanel, cn } from 'ui'
export const LayoutSidebar = () => {
const { activeSidebar } = useSidebarManagerSnapshot()
if (!activeSidebar?.component) {
return null
}
return (
<Fragment>
<ResizableHandle withHandle />
<ResizablePanel
id="panel-side"
key={activeSidebar.id}
defaultSize={30}
minSize={30}
maxSize={50}
className={cn(
'border-l bg fixed z-40 right-0 top-0 bottom-0',
'w-screen h-[100dvh]',
'md:absolute md:h-auto md:w-3/4',
'xl:relative xl:border-l-0'
)}
>
{activeSidebar.component()}
</ResizablePanel>
</Fragment>
)
}