Skip to content

feat: auto-open sidebar when UnifiedExtensionBridge starts a task #7025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,15 @@ export class ClineProvider
throw new OrganizationAllowListViolationError(t("common:errors.violated_organization_allowlist"))
}

// If task is being started via bridge (remote control enabled), ensure sidebar is visible
const enableTaskBridge = isRemoteControlEnabled(cloudUserInfo, remoteControlEnabled)
if (enableTaskBridge && !this.view?.visible) {
// Open the sidebar if it's not already visible
await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`)
// Wait briefly for the view to become visible
await delay(100)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this 100ms delay sufficient for all scenarios? The hardcoded value might work now, but could we make this configurable or at least define it as a constant with a descriptive name like SIDEBAR_VISIBILITY_DELAY_MS? This would make it easier to adjust if needed and improve code readability.

}

const task = new Task({
provider: this,
apiConfiguration,
Expand All @@ -738,7 +747,7 @@ export class ClineProvider
parentTask,
taskNumber: this.clineStack.length + 1,
onCreated: this.taskCreationCallback,
enableTaskBridge: isRemoteControlEnabled(cloudUserInfo, remoteControlEnabled),
enableTaskBridge,
...options,
})

Expand Down
Loading