mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Fix menu breaking when Roo is moved between primary and secondary sidebars (#4045)
* Fix menu breaking when Roo is moved between primary and secondary sidebars Hello Roo Team! We changed this on the Kilo side and thought it might be useful to you! The menu buttons (Settings etc.) stop working when Roo is moved between the primary and secondary sidebars. This is because ClineProvider is prematurely disposed in that case This change prevents the ClineProvider from being disposed when hosted in a sidebar. It should still be disposed when hosted in a tab, because they have their own ClineProvider instance. Found while investigating https://github.com/Kilo-Org/kilocode/issues/502. * refactor: improve logging * fix: extra bracket --------- Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
This commit is contained in:
parent
2e5a1a8e1d
commit
57038b75a0
1 changed files with 8 additions and 2 deletions
|
|
@ -339,7 +339,8 @@ export class ClineProvider
|
|||
this.view = webviewView
|
||||
|
||||
// Set panel reference according to webview type
|
||||
if ("onDidChangeViewState" in webviewView) {
|
||||
const inTabMode = "onDidChangeViewState" in webviewView
|
||||
if (inTabMode) {
|
||||
// Tag page type
|
||||
setPanel(webviewView, "tab")
|
||||
} else if ("onDidChangeVisibility" in webviewView) {
|
||||
|
|
@ -441,7 +442,12 @@ export class ClineProvider
|
|||
// This happens when the user closes the view or when the view is closed programmatically
|
||||
webviewView.onDidDispose(
|
||||
async () => {
|
||||
await this.dispose()
|
||||
if (inTabMode) {
|
||||
this.log("Disposing ClineProvider instance for tab view")
|
||||
await this.dispose()
|
||||
} else {
|
||||
this.log("Preserving ClineProvider instance for sidebar view reuse")
|
||||
}
|
||||
},
|
||||
null,
|
||||
this.disposables,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue