[FEATURE] Link the query viewer to the explorer - #250
Open
gangadhar-res wants to merge 1 commit into
Open
Conversation
The viewer stays read only. A "Go to Explorer" button opens the panel's queries in the explorer that owns them, built at click time so nothing is saved. Explorers read their starting queries from data.queries, and a query plugin ships in the same module as the explorer that opens it, so the first query's module picks the explorer. The button hides when that module has none. useExplorerQueryParams moved to plugin-system because explore depends on dashboards, where the viewer lives. It is re-exported from its old path. Signed-off-by: Gangadhar Chalapaka <gangadhar@resolve.ai>
gangadhar-res
force-pushed
the
feat/query-viewer-explore-link
branch
from
August 25, 2026 00:32
8d1cb27 to
2f32103
Compare
jgbernalp
reviewed
Aug 25, 2026
Author
|
@jgbernalp good news, that case already works. The button renders through react-router's Link via RouterComponent rather than building the URL itself, so the router's basename gets prepended. Perses sets that from api_prefix in Router.tsx. I ran it with basename="/perses" to be sure and the link came out as /perses/explore?explorer=... If you'd rather it didn't rely on that, I can take the route as a prop instead. |
Contributor
|
@gangadhar-res can you add some screenshots |
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
Closes perses/perses#4333.
Adds a "Go to Explorer" button to the query viewer, next to Close. The viewer stays read
only. Clicking the button opens the panel's queries in the explorer, and the queries ride
along in the link, so nothing gets saved and the dashboard isn't touched.
Picking the explorer: every explorer plugin already reads its starting queries from
data.queries, and a query plugin ships in the same module as the explorer that can openit. So the module behind the first query is what selects the explorer. That needs no new
plugin API. If that module doesn't ship an explorer, the button doesn't render.
One move was needed to get there.
useExplorerQueryParamslived inexplore, butexploredepends ondashboards, which is where the query viewer is, so importing itwould've been a cycle. It's now in
plugin-systemand re-exported from its old path, sonothing changes for anyone using it. It builds the query string with
URLSearchParamsnow instead of
qs, to avoid adding a dependency toplugin-system. That leavesqsunused in
exploreand I've left its package.json alone, happy to drop it if you want.Screenshots
TODO
Testing
Four tests on the button: the link it builds, and the three cases where it stays hidden
(module has no explorer, no queries, explorer belongs to a different module). I checked
each one fails when the matching logic is broken.
lint,type-check,format:check,test,buildandmake checklicenseall pass.No new lint warnings.