@@ -67,11 +67,13 @@ export function activate(context: vscode.ExtensionContext) {
6767
6868 context . subscriptions . push (
6969 vscode . commands . registerCommand ( "hai.mcpButtonClicked" , ( webview : any ) => {
70- const openMcp = ( instance ?: WebviewProvider ) =>
70+ const openMcp = ( instance ?: WebviewProvider ) => {
71+ instance ?. controller . postStateToWebview ( )
7172 instance ?. controller . postMessageToWebview ( {
7273 type : "action" ,
7374 action : "mcpButtonClicked" ,
7475 } )
76+ }
7577 const isSidebar = ! webview
7678 if ( isSidebar ) {
7779 openMcp ( WebviewProvider . getSidebarInstance ( ) )
@@ -140,6 +142,7 @@ export function activate(context: vscode.ExtensionContext) {
140142 vscode . commands . registerCommand ( "hai.historyButtonClicked" , ( webview : any ) => {
141143 WebviewProvider . getAllInstances ( ) . forEach ( ( instance ) => {
142144 const openHistory = async ( instance ?: WebviewProvider ) => {
145+ await instance ?. controller . postStateToWebview ( )
143146 instance ?. controller . postMessageToWebview ( {
144147 type : "action" ,
145148 action : "historyButtonClicked" ,
@@ -159,6 +162,7 @@ export function activate(context: vscode.ExtensionContext) {
159162 vscode . commands . registerCommand ( "hai.accountButtonClicked" , ( webview : any ) => {
160163 WebviewProvider . getAllInstances ( ) . forEach ( ( instance ) => {
161164 const openAccount = async ( instance ?: WebviewProvider ) => {
165+ await instance ?. controller . postStateToWebview ( )
162166 instance ?. controller . postMessageToWebview ( {
163167 type : "action" ,
164168 action : "accountButtonClicked" ,
@@ -178,6 +182,7 @@ export function activate(context: vscode.ExtensionContext) {
178182 vscode . commands . registerCommand ( "hai.expertsButtonClicked" , ( webview : any ) => {
179183 WebviewProvider . getAllInstances ( ) . forEach ( ( instance ) => {
180184 const openExperts = async ( instance ?: WebviewProvider ) => {
185+ await instance ?. controller . postStateToWebview ( )
181186 instance ?. controller . postMessageToWebview ( {
182187 type : "action" ,
183188 action : "expertsButtonClicked" ,
@@ -267,6 +272,7 @@ export function activate(context: vscode.ExtensionContext) {
267272 vscode . commands . registerCommand ( "hai.haiBuildTaskListClicked" , ( webview : any ) => {
268273 WebviewProvider . getAllInstances ( ) . forEach ( ( instance ) => {
269274 const openHaiTaskList = async ( instance ?: WebviewProvider ) => {
275+ await instance ?. controller . postStateToWebview ( )
270276 await instance ?. controller . postMessageToWebview ( {
271277 type : "action" ,
272278 action : "haiBuildTaskListClicked" ,
0 commit comments