[FEATURE] Add a query playground to the Query Viewer - #227
Open
gangadhar-res wants to merge 1 commit into
Open
Conversation
Queries in the Query Viewer dialog are now editable and can be run on the fly against a live preview of the panel. All edits are local to the dialog and dropped when it closes, so nothing is ever persisted. Part of perses/perses#4333 Signed-off-by: Gangadhar Chalapaka <gangadhar@resolve.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the query playground requested in perses/perses#4333: the Query Viewer dialog now lets users edit the panel's queries and assess the result on the fly, instead of only showing them read-only.
How it works:
QueryViewerDialogaccepts a new optionalpanelDefinitionprop. When provided, it renders the newQueryPlaygroundcomponent; when omitted, the previous read-only rendering is kept, so the public API stays backward compatible.QueryPlaygroundcomposes existing building blocks:MultiQueryEditorfor editing (same editor as the panel drawer, including Run Query),PanelPreviewinside aDataQueriesProviderfor the live chart, andPanelEditorProviderso the suggested step is computed from the real preview width. Draft queries drive the editors and only become part of the preview when run, mirroringPanelQueriesSharedControls.GridItemContentpasses the panel definition through, which enables the playground for the existing "open query view" panel action.Since the panel preview is reused as the chart, this works for any panel/query plugin combination, not just time series.
A follow-up PR in perses/perses will cover the e2e test and close the issue once this is released.
Screenshots
(will add after running locally against the perses app)