feat(discover): register page context for AI chatbot in classic Disco…#12278
Merged
wanglam merged 1 commit intoJun 25, 2026
Merged
Conversation
Contributor
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 84d8d53.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
…ver page Signed-off-by: tq0905 <1352711780@qq.com>
018e369 to
84d8d53
Compare
wanglam
approved these changes
Jun 25, 2026
SuZhou-Joe
approved these changes
Jun 25, 2026
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
This change wires the
contextProviderplugin into the classic Discover page so theAI chatbot becomes aware of the user's current page state.
When Discover renders, it now registers a page context describing the current query,
query language, dataset, and time range. This brings classic Discover to parity with
the Explore experience, where the chatbot can already reason about the active query
context.
Implementation notes:
contextProvideris added as an optional plugin/dependency of Discover, so thefeature degrades gracefully when AI features are disabled. A NOOP fallback hook is
used when the plugin is unavailable, keeping the hook call unconditional (no
conditional-hook violations).
_q.query) compared to Explore(
_q), which theconvertmapping accounts for.Issues Resolved
N/A
Screenshot
N/A
Testing the changes
and time range.
contextProvider(AI features off) and confirm Discover still loads andfunctions normally (NOOP fallback path).
Check List