From c253daa878891515e7e9f756dc4a826ab737b48a Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Thu, 16 Jul 2026 14:04:03 -0700 Subject: [PATCH 1/6] Add Learn chatbot UI integration --- .../layouts/_default/baseof.html | 8 +++++++ .../partials/footer/script-includes.html | 7 +++++++ .../static/js/chat-ai-integration.js | 21 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js diff --git a/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html b/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html index ff3d5cac7d..a989816eb3 100644 --- a/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html +++ b/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html @@ -27,6 +27,14 @@ {{partial "footer/footer.html" .}} + + {{partial "footer/script-includes.html" .}} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html index 4715342856..d1828c7893 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html @@ -45,9 +45,16 @@ + + diff --git a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js new file mode 100644 index 0000000000..0ecfbf448d --- /dev/null +++ b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js @@ -0,0 +1,21 @@ +(async () => { + const chatAi = document.getElementById("chat-ai"); + if (!chatAi) return; + + // Plain JavaScript equivalent of React's ref={chatAiRef}. + window.chatAiRef = chatAi; + + try { + await initAuth(); + + const account = getAccount(); + const claims = await getIdTokenClaimsForAccount(account); + const email = getEmailClaimValue(claims); + + if (email) { + chatAi.setAttribute("login-hint", email); + } + } catch (error) { + console.warn("Unable to set the chatbot login hint:", error); + } +})(); From bca4adefbf1b7c0bfc840c1a2f12a341ee9c843c Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Tue, 28 Jul 2026 14:27:26 -0700 Subject: [PATCH 2/6] Load chat widget only after Arm ID auth --- .../layouts/_default/baseof.html | 8 -------- .../static/js/chat-ai-integration.js | 20 ++++++++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html b/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html index a989816eb3..ff3d5cac7d 100644 --- a/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html +++ b/themes/arm-design-system-hugo-theme/layouts/_default/baseof.html @@ -27,14 +27,6 @@ {{partial "footer/footer.html" .}} - - {{partial "footer/script-includes.html" .}} diff --git a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js index 0ecfbf448d..bdbc7ecf45 100644 --- a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js +++ b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js @@ -1,10 +1,4 @@ (async () => { - const chatAi = document.getElementById("chat-ai"); - if (!chatAi) return; - - // Plain JavaScript equivalent of React's ref={chatAiRef}. - window.chatAiRef = chatAi; - try { await initAuth(); @@ -13,9 +7,21 @@ const email = getEmailClaimValue(claims); if (email) { + // Create and append chat-ai element only after successful auth + const chatAi = document.createElement("chat-ai"); + chatAi.id = "chat-ai"; + chatAi.setAttribute("app-name", "IPExplorer"); + chatAi.setAttribute("api-url", "http://localhost:5001"); + chatAi.setAttribute("tnc-url", "https://ipuser.dev.bespin.arm.com/vfae-terms-and-conditions"); + chatAi.setAttribute("login-on-load", "true"); + chatAi.setAttribute("stream", "false"); chatAi.setAttribute("login-hint", email); + chatAi.setAttribute("redirect-url", window.location.origin + "/"); + + document.body.appendChild(chatAi); + window.chatAiRef = chatAi; } } catch (error) { - console.warn("Unable to set the chatbot login hint:", error); + console.warn("Unable to authenticate:", error); } })(); From 16448accedbc1b4e1ffc61c916c37b087b4ecf81 Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Tue, 28 Jul 2026 14:28:44 -0700 Subject: [PATCH 3/6] Remove redundant chat redirect inline script --- .../layouts/partials/footer/script-includes.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html index d1828c7893..d6d6e3d1b2 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html @@ -45,12 +45,6 @@ - From ff31421952be7d8a2928a5e1dc2144725e8c99a8 Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Mon, 3 Aug 2026 15:29:17 -0700 Subject: [PATCH 4/6] Set Virtual FAE chatbot theme to dark --- .../static/js/chat-ai-integration.js | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js index bdbc7ecf45..f1744cee59 100644 --- a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js +++ b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js @@ -10,6 +10,7 @@ // Create and append chat-ai element only after successful auth const chatAi = document.createElement("chat-ai"); chatAi.id = "chat-ai"; + chatAi.setAttribute("theme", "dark"); chatAi.setAttribute("app-name", "IPExplorer"); chatAi.setAttribute("api-url", "http://localhost:5001"); chatAi.setAttribute("tnc-url", "https://ipuser.dev.bespin.arm.com/vfae-terms-and-conditions"); From 6af43b3334573a908900eb5f2aea01ed57e228ce Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Mon, 10 Aug 2026 13:42:53 -0700 Subject: [PATCH 5/6] Configure chatbot API from deployment secret --- .github/workflows/deploy.yml | 3 +++ .github/workflows/main.yml | 1 + .github/workflows/production.yml | 1 + .../layouts/partials/footer/script-includes.html | 5 +++++ .../static/js/chat-ai-integration.js | 11 ++++++++--- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4edfe52dce..fb473a76a0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,8 @@ on: required: true HUGO_PHI_ONNX_LLM_API: required: true + HUGO_CHATBOT_API: + required: true HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: required: true HUGO_FORM_ID_FOR_PROGRAM_SIGNUP: @@ -74,6 +76,7 @@ jobs: HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }} HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }} HUGO_PHI_ONNX_LLM_API: ${{ secrets.HUGO_PHI_ONNX_LLM_API }} + HUGO_CHATBOT_API: ${{ secrets.HUGO_CHATBOT_API }} HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }} HUGO_FORM_ID_FOR_PROGRAM_SIGNUP: ${{ secrets.HUGO_FORM_ID_FOR_PROGRAM_SIGNUP }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81505b2eb0..830982e62e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,5 +27,6 @@ jobs: HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }} HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }} HUGO_PHI_ONNX_LLM_API: ${{ secrets.HUGO_PHI_ONNX_LLM_API }} + HUGO_CHATBOT_API: ${{ secrets.HUGO_CHATBOT_API }} HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }} HUGO_FORM_ID_FOR_PROGRAM_SIGNUP: ${{ secrets.HUGO_FORM_ID_FOR_PROGRAM_SIGNUP }} diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 67dee55cb4..a6e7f9ead0 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -26,5 +26,6 @@ jobs: HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }} HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }} HUGO_PHI_ONNX_LLM_API: ${{ secrets.HUGO_PHI_ONNX_LLM_API }} + HUGO_CHATBOT_API: ${{ secrets.HUGO_CHATBOT_API }} HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }} HUGO_FORM_ID_FOR_PROGRAM_SIGNUP: ${{ secrets.HUGO_FORM_ID_FOR_PROGRAM_SIGNUP }} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html index d6d6e3d1b2..59f6445cc2 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html @@ -45,9 +45,14 @@ + + diff --git a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js index f1744cee59..416621b735 100644 --- a/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js +++ b/themes/arm-design-system-hugo-theme/static/js/chat-ai-integration.js @@ -5,19 +5,24 @@ const account = getAccount(); const claims = await getIdTokenClaimsForAccount(account); const email = getEmailClaimValue(claims); + const chatbotApiUrl = atob(window.chatbotApiUrlEncoded || ""); + + if (!chatbotApiUrl) { + throw new Error("HUGO_CHATBOT_API is not configured"); + } if (email) { // Create and append chat-ai element only after successful auth const chatAi = document.createElement("chat-ai"); chatAi.id = "chat-ai"; chatAi.setAttribute("theme", "dark"); - chatAi.setAttribute("app-name", "IPExplorer"); - chatAi.setAttribute("api-url", "http://localhost:5001"); + chatAi.setAttribute("app-name", "learning-paths"); + chatAi.setAttribute("api-url", chatbotApiUrl); chatAi.setAttribute("tnc-url", "https://ipuser.dev.bespin.arm.com/vfae-terms-and-conditions"); - chatAi.setAttribute("login-on-load", "true"); chatAi.setAttribute("stream", "false"); chatAi.setAttribute("login-hint", email); chatAi.setAttribute("redirect-url", window.location.origin + "/"); + chatAi.setAttribute("login-on-load", "true"); document.body.appendChild(chatAi); window.chatAiRef = chatAi; From 2d2177c970bcccc9a08758d84b36edf0f59412c3 Mon Sep 17 00:00:00 2001 From: Jaidev Singh Chadha Date: Tue, 11 Aug 2026 14:15:36 -0700 Subject: [PATCH 6/6] Use production Learning Paths chatbot script --- .../layouts/partials/footer/script-includes.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html index 59f6445cc2..297e08f352 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html @@ -45,8 +45,8 @@ - - + +