Skip to content

Show query CodeLens only for active query#125

Open
danield137 wants to merge 2 commits into
mainfrom
user/danieldror/lens_on_active_query_only
Open

Show query CodeLens only for active query#125
danield137 wants to merge 2 commits into
mainfrom
user/danieldror/lens_on_active_query_only

Conversation

@danield137

Copy link
Copy Markdown
Contributor

Summary

  • Show query action CodeLens entries only for the active query block
  • Keep the running indicator visible when focus moves away from a running query
  • Disable query separators by default and make opt-in separators more subtle
  • Add range-scope unit tests for cursor, selection, multi-selection, reversed selection, and boundary cases

Validation

  • npm run compile
  • npm test
  • npx eslint features\queryEditor.ts features\queryRangeScope.ts --max-warnings 0

Notes

  • npm run type-check currently fails in node_modules/fast-xml-parser/lib/fxp.d.cts with TS1435
  • npm run lint currently fails in src/Client/features/authentication.ts with @typescript-eslint/no-floating-promises

Scope query action CodeLens entries to the active cursor or selection and keep running indicators visible when focus moves away. Disable bulky query separators by default and make opt-in separators subtle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 23:20

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 refines the Kusto query editor UX by limiting query CodeLens actions to the currently active query block while keeping “Running” visibility for in-flight queries, and it makes query separators opt-in and visually subtler.

Changes:

  • Filter query CodeLens actions to only show for the active (in-scope) query range, while still showing a “Running” indicator for running queries even when focus moves away.
  • Add a small range-scope utility (isQueryRangeInScope) plus unit tests covering cursor/selection/multi-selection/reversed selection and boundary behavior.
  • Make query separators disabled by default and reduce their visual prominence when enabled.

Reviewed changes

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

File Description
src/Client/features/queryEditor.ts Refresh CodeLens on editor/selection changes; filter CodeLens output by active selection scope; keep running indicator visible; make separators subtler + default-off.
src/Client/features/queryRangeScope.ts Add range/selection-scope helper to decide whether a query range is “active”.
src/Client/tests/unit/queryRangeScope.test.ts Add unit coverage for selection normalization and intersection/boundary cases.
src/Client/package.json Change msKustoExplorer.editor.showQuerySeparators default to false and update setting description.

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

Comment thread src/Client/features/queryEditor.ts
Comment thread src/Client/features/queryEditor.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattwar

mattwar commented May 28, 2026

Copy link
Copy Markdown
Collaborator

This means you will have to put the caret into the text of a specific query before the code lens will appear at the top of that query? Why do you believe this experience is better?

@danield137

Copy link
Copy Markdown
Contributor Author

Because I hate notebooks and love how our existing KE/KWE handle themselves.
The main problem with the current state is that it makes the scratchpad feel blocky, taking up a lot of screen space for control you'll likely won't need

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.

3 participants