From c487f0e035e7d65f1a96ef67bb2e9674c0264e24 Mon Sep 17 00:00:00 2001 From: Fengqing Liu Date: Thu, 23 Oct 2025 22:50:31 +1100 Subject: [PATCH] Fix help tab content duplication on language change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Help tab content was growing/duplicating every time the language was changed because the code was trying to dynamically insert "How It Works" sections that couldn't be found after translation. Solution: Remove the dynamic content insertion logic for help sections. Now only updates existing header text instead of creating new elements. This prevents duplicate sections from appearing when switching languages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- web/static/app.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index 3bdb60d..b5dde07 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -1115,23 +1115,9 @@ function applyTranslations(t) { aboutP.textContent = t.help.about_text; } - // Add how it works section if it exists in translations - if (t.help.how_it_works_text) { - // Find or create the how it works section - let howItWorksH3 = Array.from(helpContent.querySelectorAll('h3')).find(h => h.textContent.includes('How It Works') || h.textContent === t.help.how_it_works); - if (!howItWorksH3) { - // Insert How It Works section after the first list - const firstList = helpContent.querySelector('ol'); - if (firstList) { - howItWorksH3 = document.createElement('h3'); - howItWorksH3.textContent = t.help.how_it_works; - const howItWorksP = document.createElement('p'); - howItWorksP.textContent = t.help.how_it_works_text; - firstList.parentNode.insertBefore(howItWorksP, firstList.nextSibling); - firstList.parentNode.insertBefore(howItWorksH3, howItWorksP); - } - } - } + // Note: "How It Works" section from translations is not shown + // to avoid dynamically inserting/removing content which causes duplication issues + // The static help content above is sufficient for the web UI } }