@@ -23,7 +23,7 @@ import { Container } from '../data/api';
2323import { ToastContext } from '../../generic/toast-context' ;
2424import TagCount from '../../generic/tag-count' ;
2525import { useLibraryRoutes } from '../routes' ;
26- import { SidebarActions , useSidebarContext } from '../common/context/SidebarContext' ;
26+ import { SidebarActions , SidebarBodyItemId , useSidebarContext } from '../common/context/SidebarContext' ;
2727import { useRunOnNextRender } from '../../utils' ;
2828import { ContainerMenu } from '../containers/ContainerCard' ;
2929
@@ -46,8 +46,7 @@ const ContainerRow = ({ containerKey, container, readOnly }: ContainerRowProps)
4646 const { showToast } = useContext ( ToastContext ) ;
4747 const updateMutation = useUpdateContainer ( container . originalId , containerKey ) ;
4848 const { showOnlyPublished } = useLibraryContext ( ) ;
49- const { navigateTo } = useLibraryRoutes ( ) ;
50- const { setSidebarAction } = useSidebarContext ( ) ;
49+ const { setSidebarAction, openItemSidebar } = useSidebarContext ( ) ;
5150
5251 const handleSaveDisplayName = async ( newDisplayName : string ) => {
5352 try {
@@ -67,10 +66,10 @@ const ContainerRow = ({ containerKey, container, readOnly }: ContainerRowProps)
6766 setTimeout ( ( ) => setSidebarAction ( SidebarActions . JumpToManageTags ) , 250 ) ;
6867 } ) ;
6968
70- const jumpToManageTags = ( ) => {
71- navigateTo ( { selectedItemId : container . originalId } ) ;
69+ const jumpToManageTags = useCallback ( ( ) => {
70+ openItemSidebar ( container . originalId , SidebarBodyItemId . ContainerInfo ) ;
7271 scheduleJumpToTags ( ) ;
73- } ;
72+ } , [ openItemSidebar , scheduleJumpToTags , container . originalId ] ) ;
7473
7574 return (
7675 < >
@@ -127,7 +126,7 @@ export const LibraryContainerChildren = ({ containerKey, readOnly }: LibraryCont
127126 const [ orderedChildren , setOrderedChildren ] = useState < LibraryContainerMetadataWithUniqueId [ ] > ( [ ] ) ;
128127 const { showOnlyPublished, readOnly : libReadOnly } = useLibraryContext ( ) ;
129128 const { navigateTo } = useLibraryRoutes ( ) ;
130- const { sidebarItemInfo } = useSidebarContext ( ) ;
129+ const { sidebarItemInfo, openItemSidebar } = useSidebarContext ( ) ;
131130 const [ activeDraggingId , setActiveDraggingId ] = useState < string | null > ( null ) ;
132131 const orderMutator = useUpdateContainerChildren ( containerKey ) ;
133132 const { showToast } = useContext ( ToastContext ) ;
@@ -169,11 +168,11 @@ export const LibraryContainerChildren = ({ containerKey, readOnly }: LibraryCont
169168 const handleChildClick = useCallback ( ( child : LibraryContainerMetadataWithUniqueId , numberOfClicks : number ) => {
170169 const doubleClicked = numberOfClicks > 1 ;
171170 if ( ! doubleClicked ) {
172- navigateTo ( { selectedItemId : child . originalId } ) ;
171+ openItemSidebar ( child . originalId , SidebarBodyItemId . ContainerInfo ) ;
173172 } else {
174173 navigateTo ( { containerId : child . originalId } ) ;
175174 }
176- } , [ navigateTo ] ) ;
175+ } , [ openItemSidebar , navigateTo ] ) ;
177176
178177 const getComponentStyle = useCallback ( ( childId : string ) => {
179178 const style : { marginBottom : string , borderRadius : string , outline ?: string } = {
0 commit comments