fixup! ♻️(frontend) replace side panel context with valtio store

This commit is contained in:
Cyril
2026-01-29 11:42:05 +01:00
parent daa3d6bcc6
commit c803bd9170
2 changed files with 24 additions and 0 deletions
@@ -110,6 +110,15 @@ export const useSidePanel = () => {
layoutStore.activePanelId = PanelId.TOOLS
}
const closeSidePanel = () => {
if (isSubPanelOpen) {
layoutStore.activeSubPanelId = null
layoutStore.activePanelId = null
return
}
layoutStore.activePanelId = null
}
useEffect(() => {
const handleKeyDown = () => {
lastInteractionRef.current = 'keyboard'
@@ -160,6 +169,7 @@ export const useSidePanel = () => {
toggleInfo,
openTranscript,
openScreenRecording,
closeSidePanel,
isSubPanelOpen,
isChatOpen,
isParticipantsOpen,
@@ -0,0 +1,14 @@
import { useCallback } from 'react'
import type { SidePanelTriggerKey } from '../types/sidePanelTypes'
import { useSidePanelTriggers } from './useSidePanelTriggers'
export const useSidePanelTriggerRef = (key: SidePanelTriggerKey) => {
const { setTrigger } = useSidePanelTriggers()
return useCallback(
(el: HTMLElement | null) => {
setTrigger(key, el)
},
[key, setTrigger]
)
}