@@ -171,6 +171,30 @@ export class RightSidePanel extends AbstractPanel {
171171 const activePlugin = this . currentFocus ( )
172172
173173 if ( activePlugin !== profile . name ) throw new Error ( `Plugin ${ profile . name } is not pinned` )
174+
175+ // If the panel is maximized, restore left and main panels but not terminal
176+ if ( this . isMaximized ) {
177+ const leftPanelHidden = await this . call ( 'sidePanel' , 'isPanelHidden' )
178+
179+ // Restore left panel if it was visible before maximizing
180+ if ( ! this . maximizedState . leftPanelHidden && leftPanelHidden ) {
181+ await this . call ( 'sidePanel' , 'togglePanel' )
182+ }
183+
184+ // Show main panel
185+ const mainPanel = document . querySelector ( '#main-panel' )
186+ mainPanel ?. classList . remove ( 'd-none' )
187+
188+ // Remove full width from right panel
189+ const rightPanel = document . querySelector ( '#right-side-panel' )
190+ rightPanel ?. classList . remove ( 'right-panel-maximized' )
191+
192+ this . isMaximized = false
193+ trackMatomoEvent ( this , { category : 'topbar' , action : 'rightSidePanel' , name : 'restoredOnUnpin' , isClick : false } )
194+ this . emit ( 'rightSidePanelRestored' )
195+ this . events . emit ( 'rightSidePanelRestored' )
196+ }
197+
174198 await this . call ( 'sidePanel' , 'unPinView' , profile , this . plugins [ profile . name ] . view )
175199 super . remove ( profile . name )
176200 // Clear hiddenPlugin and set panel to hidden state when no plugin is pinned
0 commit comments