Skip to content

Set sidebar location when no preference #288

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
8 changes: 7 additions & 1 deletion extensions/vscode/src/activation/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ export async function activateExtension(context: vscode.ExtensionContext) {

// Force PearAI view mode
try {
await vscode.workspace.getConfiguration().update('workbench.sideBar.location', 'left', true);
const sidebar = vscode.workspace.getConfiguration().inspect("workbench.sideBar.location");

// If the user has not set the sidebar location set it
if (!sidebar?.globalValue) {
Copy link

Choose a reason for hiding this comment

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

Consider checking both global and workspace values. Relying solely on globalValue can override a user’s workspace setting. For example, use if (!sidebar?.globalValue && !sidebar?.workspaceValue) to determine if no preference was set.

Suggested change
if (!sidebar?.globalValue) {
if (!sidebar?.globalValue && !sidebar?.workspaceValue) {

await vscode.workspace.getConfiguration().update("workbench.sideBar.location", "left", true);
}

// Get auxiliary bar visibility state
const pearAIVisible = vscode.workspace.getConfiguration().get('workbench.auxiliaryBar.visible');

Expand Down