From 83fc9e6478151d0b440ee6440dec5b5e9eda162c Mon Sep 17 00:00:00 2001 From: heznpc Date: Mon, 1 Jun 2026 22:17:06 +0900 Subject: [PATCH] fix(translate): inline lead-in dup + dark-mode FAB + sidebar i18n (v3.5.38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Live debugging pass on anthropic.skilljar.com surfaced five issues: - safeReplaceText duplicated text on inline lead-ins: a block like `Estimated time: 15 minutes` rendered as "Estimated time:예상 시간: 15분". It only rewrote direct child text nodes, leaving text inside inline children untranslated next to the full-element translation. Now writes the translation into the first meaningful descendant text node and blanks the rest (code/pre kept; inline / preserved so links stay clickable). Unit-tested. - Dark-mode FAB was #1a1a1a on a near-black page and disappeared; now a lightened accent with a white icon and a soft ring. - "Course roadmap" widget (.crm-title / .crm-card-h) was outside the translatable selector set and its .crm wrapper stayed cream in dark mode; both addressed. - resume.js touched chrome.storage with no guard, throwing an uncaught "Extension context invalidated" after an extension reload/update; now guarded + lastError-cleared. - updateLocalizedLabels did not re-localize the Tools button, tools-menu items or example-question chips, so a post-build language switch left them frozen; now re-applied. Adds tests/safe-replace-text.test.js (5 cases incl. the exact bug repro). 488/488 jest pass, lint/prettier/selectors/docs-sync clean. --- CHANGELOG.md | 9 ++++ README.md | 2 +- docs/index.html | 4 +- manifest.json | 2 +- package.json | 2 +- src/content/content.css | 28 ++++++++--- src/content/content.js | 61 ++++++++++++++++-------- src/content/resume.js | 50 ++++++++++++++++++-- src/content/sidebar-chat.js | 43 +++++++++++++++++ src/data/de.json | 2 +- src/data/es.json | 2 +- src/data/fr.json | 2 +- src/data/it.json | 2 +- src/data/ja.json | 2 +- src/data/ko.json | 2 +- src/data/pt-BR.json | 2 +- src/data/ru.json | 2 +- src/data/vi.json | 2 +- src/data/zh-CN.json | 2 +- src/data/zh-TW.json | 2 +- tests/safe-replace-text.test.js | 83 +++++++++++++++++++++++++++++++++ 21 files changed, 261 insertions(+), 45 deletions(-) create mode 100644 tests/safe-replace-text.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e962b0c..d4e33c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +## [3.5.38] - 2026-06-01 + +### Fixed — translation rendering & dark-mode polish (from a live debugging pass on anthropic.skilljar.com) +- **No more duplicated text on inline lead-ins** — a paragraph like `Estimated time: 15 minutes` rendered as "Estimated time:예상 시간: 15분" (English original + translation side by side). `safeReplaceText` now writes the translation into the first descendant text node and clears every other one (code/pre preserved, inline elements like ``/`` kept so links stay clickable), so any block with a bold/linked lead-in translates cleanly. +- **Dark-mode floating button is visible again** — the AI Tutor launcher was `#1a1a1a` on a near-black page and effectively disappeared; it now uses a lightened accent with a white icon and a soft ring. +- **"Course roadmap" widget translates** — the embedded `.crm-title` / `.crm-card-h` blocks were not in the translatable selector set (heading and step cards stayed English); they are now covered, and the `.crm` wrapper is re-skinned in dark mode instead of staying bright cream. +- **No uncaught exception after an extension update** — `resume.js` now guards its `chrome.storage.local` calls against an invalidated context ("Extension context invalidated"), which previously surfaced as an uncaught error when a visit was recorded right after a reload/update. +- **Language switch re-localizes the whole sidebar** — switching language after the Tutor sidebar was built left the Tools button, the tools-menu items and the example-question chips frozen at their build-time language; `updateLocalizedLabels` now re-applies all of them. + ## [3.5.37] - 2026-06-01 ### Fixed — learning-companion robustness (from code review) diff --git a/README.md b/README.md index 3168658..aab7229 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SkillBridge -# SkillBridge — AI Course Translator v3.5.37 +# SkillBridge — AI Course Translator v3.5.38 > Available in multiple languages at the [project landing page](https://heznpc.github.io/skillBridge/). diff --git a/docs/index.html b/docs/index.html index 0a6e66e..e23c88b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ SkillBridge — AI Course Translator for <!-- LANG_COUNT_START -->32+<!-- LANG_COUNT_END --> Languages - +