File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function focusPanel(
1717 if ( ! panel ) {
1818 // If no panel is open, open the sidebar
1919 await vscode . commands . executeCommand ( `workbench.view.extension.${ Package . name } -ActivityBar` )
20- } else if ( panel === tabPanel ) {
20+ } else if ( panel === tabPanel && ! panel . active ) {
2121 // For tab panels, use reveal to focus
2222 panel . reveal ( vscode . ViewColumn . Active , false )
2323 } else if ( panel === sidebarPanel ) {
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const App = () => {
4343 experiments,
4444 cloudUserInfo,
4545 cloudIsAuthenticated,
46+ renderContext,
4647 } = useExtensionState ( )
4748
4849 // Create a persistent state manager
@@ -136,11 +137,14 @@ const App = () => {
136137 // Tell the extension that we are ready to receive messages.
137138 useEffect ( ( ) => vscode . postMessage ( { type : "webviewDidLaunch" } ) , [ ] )
138139
139- // Focus the WebView when non-interactive content is clicked
140+ // Focus the WebView when non-interactive content is clicked (only in editor/tab mode)
140141 useAddNonInteractiveClickListener (
141142 useCallback ( ( ) => {
142- vscode . postMessage ( { type : "focusPanelRequest" } )
143- } , [ ] ) ,
143+ // Only send focus request if we're in editor (tab) mode, not sidebar
144+ if ( renderContext === "editor" ) {
145+ vscode . postMessage ( { type : "focusPanelRequest" } )
146+ }
147+ } , [ renderContext ] ) ,
144148 )
145149
146150 if ( ! didHydrateState ) {
You can’t perform that action at this time.
0 commit comments