22 <section
33 id =" right-drawer"
44 v-click-outside =" {handler: closeDrawer, exclude: ['right-drawer']}"
5- :class =" {open: rightDrawer.state, wider: rightDrawer.wider, fixed: rightDrawer.fixed, resizing: isResizing, 'manually-resized': hasManuallyResized, pinning: isPinning, opening: isOpening, closing: isClosing}"
5+ :class =" {open: rightDrawer.state, wider: rightDrawer.wider, fixed: rightDrawer.fixed, resizing: isResizing, 'manually-resized': hasManuallyResized, pinning: isPinning, opening: isOpening && !isPinning , closing: isClosing}"
66 :style =" drawerStyle"
77 data-el =" right-drawer"
88 >
4343
4444<script >
4545import { mapActions , mapState } from ' pinia'
46+ import { mapActions as mapVuexActions } from ' vuex'
4647
4748import { useUxDrawersStore } from ' @/stores/ux-drawers.js'
4849
@@ -105,10 +106,18 @@ export default {
105106 watch: {
106107 ' rightDrawer.state' : {
107108 handler (isOpen , wasOpen ) {
109+ let reopenExpert = false
110+ const isExpertDrawer = this .rightDrawer .component ? .name === ' ExpertDrawer'
111+ if (! isOpen && wasOpen && ! isExpertDrawer) {
112+ // non expert drawer is closing - check if we need to re-open expert drawer
113+ reopenExpert = this .rightDrawer .expertState .pinned && this .rightDrawer .expertState .open
114+ }
115+
108116 // Set opening flag when drawer opens
109117 if (isOpen && ! wasOpen) {
110118 this .isOpening = true
111119 this .isClosing = false
120+ this .isPinning = isExpertDrawer && this .rightDrawer .fixed // no animation if drawer is to open pinned
112121 // Clear opening flag after slide animation completes
113122 setTimeout (() => {
114123 this .isOpening = false
@@ -121,6 +130,10 @@ export default {
121130 // Clear closing flag after slide animation completes
122131 setTimeout (() => {
123132 this .isClosing = false
133+ // Re-open Expert drawer if needed after other drawer closes
134+ if (reopenExpert) {
135+ this .openAssistantDrawer ({ openPinned: true })
136+ }
124137 }, 350 )
125138 }
126139
@@ -166,6 +179,20 @@ export default {
166179 mounted () {
167180 // Add viewport resize listener
168181 window .addEventListener (' resize' , this .onViewportResize )
182+
183+ const openPinned = this .rightDrawer .expertState .open && this .rightDrawer .expertState .pinned
184+
185+ if (openPinned && this .shouldAllowPinning ) {
186+ this .isPinning = true
187+ setTimeout (() => {
188+ this .openAssistantDrawer ({ openPinned: true })
189+ setTimeout (() => {
190+ this .isPinning = false
191+ }, 200 )
192+ }, 25 )
193+ } else {
194+ this .isPinning = false
195+ }
169196 },
170197 beforeUnmount () {
171198 // Clean up resize listeners
@@ -177,6 +204,7 @@ export default {
177204 }
178205 },
179206 methods: {
207+ ... mapVuexActions (' product/expert' , [' openAssistantDrawer' ]),
180208 ... mapActions (useUxDrawersStore, [' closeRightDrawer' , ' togglePinDrawer' ]),
181209 closeDrawer () {
182210 if (this .rightDrawer .state && this .rightDrawer .closeOnClickOutside ) {
0 commit comments