Skip to content

[ENHANCEMENT] Explore: select the default explorer without a state-syncing effect - #344

Merged
Gladorme merged 1 commit into
perses:mainfrom
Gladorme:enhancement/explore-default-explorer
Oct 2, 2026
Merged

Gladorme merged 1 commit into
perses:mainfrom
Gladorme:enhancement/explore-default-explorer

Conversation

@Gladorme

@Gladorme Gladorme commented Oct 2, 2026

Copy link
Copy Markdown
Member

Description

Split out of #319 to ease review (independent from the other split PRs, based on main).

Replace the useEffect that wrote the first explorer plugin into the store with a derived default.

  • ViewExploreApp derives the default explorer from the sorted plugin list and passes it as the new optional defaultExplorer prop of ExplorerManagerProvider / ExplorerManagerProviderWithQueryParams. It is used while the store has no explorer selected and committed to the store on the first state change.
  • New exported helpers getExplorerKey(plugin) and useSortedExplorerPlugins() (shared by the tabs and the default selection, so the default always matches the first tab).
  • Avoids an extra render + URL update on first load of the Explore page.
  • Added tests for ExploreManager and ExplorerManagerProvider.

Validation on this branch: npm run lint, npm run format:check, npm run type-check and npm run test all pass.

Screenshots

No visual change.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

…ncing effect

Derive the default explorer from the sorted plugin list in ViewExploreApp and pass it to the explorer manager provider.

Signed-off-by: Guillaume LADORME <gladorme@gmail.com>
@Gladorme
Gladorme merged commit 585fb2b into perses:main Oct 2, 2026
13 checks passed
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