Skip to content

User/mattwar/treeviewbug#104

Merged
mattwar merged 4 commits into
mainfrom
user/mattwar/treeviewbug
May 6, 2026
Merged

User/mattwar/treeviewbug#104
mattwar merged 4 commits into
mainfrom
user/mattwar/treeviewbug

Conversation

@mattwar

@mattwar mattwar commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Fix problem with connection panel aggressively taking focus when other activity side bars are in use.
Add fallback connection authentication through vscode when kusto primary authentication path fails.

Copilot AI review requested due to automatic review settings May 6, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses two related UX/runtime issues in the VS Code extension: (1) prevents Kusto Explorer’s tree selection updates from forcibly revealing the view while it’s hidden (stealing focus), and (2) introduces a host-bridged AAD token acquisition fallback so the language server can authenticate via VS Code’s Microsoft account UI when Kusto.Data’s native flow fails in non-interactive environments.

Changes:

  • Add an IAuthenticationProvider bridge and fallback auth path (server requests token from client; connection retries once after native auth failure).
  • Add client-side token acquisition using VS Code’s built-in microsoft authentication provider, with caching.
  • Avoid TreeView.reveal() when the connections tree view is hidden; re-sync selection when the view becomes visible again.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Server/Connections/IAuthenticationProvider.cs Introduces an abstraction for acquiring AAD access tokens (typically via host UI).
src/Server/Connections/ConnectionManager.cs Adds fallback-auth builder creation, cluster-level fallback promotion, and retry-on-auth-failure execution path.
src/Server/Server.cs Implements IAuthenticationProvider by sending an LSP request to the client to acquire tokens; wires provider when launched with vscode arg.
src/Client/features/server.ts Registers an LSP handler to service server token requests via the client authentication bridge.
src/Client/features/authentication.ts Implements scope derivation and Microsoft-auth-provider token acquisition with caching.
src/Client/features/connectionsPanel.ts Prevents hidden tree reveals and re-applies selection when the view becomes visible.
src/ServerTests/Features/ConnectionManagerTests.cs Adds tests validating primary vs fallback builder behavior and provider invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Server/Connections/ConnectionManager.cs
Comment thread src/ServerTests/Features/ConnectionManagerTests.cs Outdated
Comment thread src/Client/features/authentication.ts
Comment thread src/Client/features/authentication.ts
Comment thread src/Server/Server.cs Outdated
mattwar and others added 2 commits May 6, 2026 12:56
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 20:07
@mattwar mattwar merged commit 653ce25 into main May 6, 2026
7 checks passed
@mattwar mattwar deleted the user/mattwar/treeviewbug branch May 6, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { describe, it, expect } from 'vitest';
import {
acquireMicrosoftAuthenticationToken,
GetAuthenticationTokenParams,
GetAuthenticationTokenResult,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants