@@ -70,21 +70,28 @@ export class SidePanel extends AbstractPanel {
70
70
}
71
71
72
72
async pinView ( profile ) {
73
+ const active = this . currentFocus ( )
73
74
await this . call ( 'pinnedPanel' , 'pinView' , profile , this . plugins [ profile . name ] ?. view )
74
- if ( this . plugins [ profile . name ] . active ) this . call ( 'menuicons' , 'select' , 'filePanel' )
75
+ if ( this . plugins [ profile . name ] . active ) {
76
+ this . call ( 'menuicons' , 'select' , 'filePanel' )
77
+ }
78
+ if ( active === profile . name ) this . call ( 'menuicons' , 'select' , active . length > 1 ? active : 'filePanel' )
75
79
super . remove ( profile . name )
76
80
this . renderComponent ( )
77
81
}
78
82
79
83
async unPinView ( profile , view ) {
80
84
const activePlugin = this . currentFocus ( )
81
-
82
85
if ( activePlugin === profile . name ) throw new Error ( `Plugin ${ profile . name } already unpinned` )
83
86
this . loggedState = await this . call ( 'pluginStateLogger' , 'getPluginState' , profile . name )
84
87
super . addView ( profile , view )
85
88
this . plugins [ activePlugin ] . active = false
86
89
this . plugins [ profile . name ] . active = true
87
- this . showContent ( profile . name )
90
+ if ( profile . name !== 'remixaiassistant' ) {
91
+ this . showContent ( profile . name )
92
+ }
93
+ this . emit ( 'focusChanged' , profile . name )
94
+ // this.showContent(profile.name)
88
95
}
89
96
90
97
/**
@@ -93,8 +100,9 @@ export class SidePanel extends AbstractPanel {
93
100
*/
94
101
async showContent ( name ) {
95
102
super . showContent ( name )
96
- if ( name === 'remixaiassistant' ) { // TODO: should this be a plugin feature?
97
- this . pinView ( this . plugins [ name ] . profile )
103
+ if ( name === 'remixaiassistant' ) {
104
+ await this . call ( 'sidePanel' , 'pinView' , this . plugins [ name ] . profile )
105
+ return
98
106
}
99
107
this . emit ( 'focusChanged' , name )
100
108
this . renderComponent ( )
0 commit comments