Skip to content

fix(translate): inline lead-in dup + dark-mode FAB + sidebar i18n (v3.5.38)#155

Merged
heznpc merged 1 commit into
mainfrom
fix/translate-inline-dup-darkmode-v3.5.38
Jun 1, 2026
Merged

fix(translate): inline lead-in dup + dark-mode FAB + sidebar i18n (v3.5.38)#155
heznpc merged 1 commit into
mainfrom
fix/translate-inline-dup-darkmode-v3.5.38

Conversation

@heznpc

@heznpc heznpc commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Live debugging pass on anthropic.skilljar.com (extension loaded unpacked) surfaced five issues. All fixed; v3.5.37 → v3.5.38.

Fixed

  1. Inline lead-in translation duplication (high impact) — a paragraph such as <strong>Estimated time:</strong> 15 minutes rendered as "Estimated time:예상 시간: 15분" (English original + translation side by side). safeReplaceText only rewrote direct-child text nodes, leaving text inside inline children (<strong>, <a>, <em>) untranslated next to the full-element translation. Any bold/linked lead-in hit this. It now writes the translation into the first meaningful descendant text node and blanks every other one — code/pre preserved, inline elements kept so links stay clickable. — src/content/content.js
  2. Dark-mode FAB invisible — the AI Tutor launcher was #1a1a1a on a near-black page and disappeared; lightened accent + white icon + soft ring. — src/content/content.css
  3. "Course roadmap" widget untranslated / un-themed.crm-title / .crm-card-h were outside the translatable selector set; the .crm wrapper also stayed bright cream in dark mode. Both addressed. — src/content/content.js, src/content/content.css
  4. Uncaught "Extension context invalidated"resume.js touched chrome.storage.local unguarded, throwing after an extension reload/update while a tab was open. Now guarded + lastError-cleared. — src/content/resume.js
  5. Stale sidebar labels after language switchupdateLocalizedLabels did not re-localize the Tools button, tools-menu items or example-question chips, so a post-build language switch froze them. Now re-applied (via DOM nodes, no innerHTML). — src/content/sidebar-chat.js

Tests / verification

  • New tests/safe-replace-text.test.js — 5 cases incl. the exact bug repro, link preservation, code preservation.
  • 488/488 jest pass; ESLint, Prettier, selector health, dict/i18n/glossary/bg-sync checks, docs-sync (idempotent), Firefox + bundle builds all clean locally.

Note (#1) was confirmed against the live DOM; the false "English-restore broken" lead from the debugging session was a measurement race and is not a real bug — restore works.

….5.38)

Live debugging pass on anthropic.skilljar.com surfaced five issues:

- safeReplaceText duplicated text on inline lead-ins: a block like
  `<strong>Estimated time:</strong> 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 <strong>/<a> 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.
@heznpc heznpc merged commit 5a5b236 into main Jun 1, 2026
9 checks passed
@heznpc heznpc deleted the fix/translate-inline-dup-darkmode-v3.5.38 branch June 1, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant