From 9c89863acf443144d565e0203efe323a58c34cbb Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Wed, 12 Nov 2025 10:33:46 -0600 Subject: [PATCH] fix(askai): add Explorer product mapping for Ask AI widget - Add influxdb3_explorer mapping to getCurrentProductData() - Add explorer context to getContext() function - Ensures Explorer pages use correct ai_sample_questions from products.yml - Reorder Explorer questions with 'install and run' first This fixes the issue where Explorer Ask AI widget was showing wrong example questions by properly loading the influxdb3_explorer config. --- assets/js/page-context.js | 9 ++++++++- data/products.yml | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/js/page-context.js b/assets/js/page-context.js index 6779fbca2..5566f2f04 100644 --- a/assets/js/page-context.js +++ b/assets/js/page-context.js @@ -37,6 +37,11 @@ function getCurrentProductData() { product: products.influxdb3_clustered, urls: influxdbUrls.clustered, }, + { + pattern: /\/influxdb3\/explorer/, + product: products.influxdb3_explorer, + urls: influxdbUrls.core, + }, { pattern: /\/enterprise_v1\//, product: products.enterprise_influxdb, @@ -83,7 +88,7 @@ function getCurrentProductData() { } // Return the page context -// (cloud, serverless, oss/enterprise, dedicated, clustered, other) +// (cloud, serverless, oss/enterprise, dedicated, clustered, explorer, other) function getContext() { if (/\/influxdb\/cloud\//.test(window.location.pathname)) { return 'cloud'; @@ -97,6 +102,8 @@ function getContext() { return 'dedicated'; } else if (/\/influxdb3\/clustered/.test(window.location.pathname)) { return 'clustered'; + } else if (/\/influxdb3\/explorer/.test(window.location.pathname)) { + return 'explorer'; } else if ( /\/(enterprise_|influxdb).*\/v[1-2]\//.test(window.location.pathname) ) { diff --git a/data/products.yml b/data/products.yml index 1636ee915..ada6a8072 100644 --- a/data/products.yml +++ b/data/products.yml @@ -68,9 +68,10 @@ influxdb3_explorer: latest_patch: 1.4.0 placeholder_host: localhost:8888 ai_sample_questions: + - How do I install and run? - How do I query data? - How do I visualize data? - - How do I install and run? + ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262" influxdb3_cloud_serverless: