fix(translate): inline lead-in dup + dark-mode FAB + sidebar i18n (v3.5.38)#155
Merged
Merged
Conversation
….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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Live debugging pass on
anthropic.skilljar.com(extension loaded unpacked) surfaced five issues. All fixed; v3.5.37 → v3.5.38.Fixed
<strong>Estimated time:</strong> 15 minutesrendered as "Estimated time:예상 시간: 15분" (English original + translation side by side).safeReplaceTextonly 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/prepreserved, inline elements kept so links stay clickable. —src/content/content.js#1a1a1aon a near-black page and disappeared; lightened accent + white icon + soft ring. —src/content/content.css.crm-title/.crm-card-hwere outside the translatable selector set; the.crmwrapper also stayed bright cream in dark mode. Both addressed. —src/content/content.js,src/content/content.cssresume.jstouchedchrome.storage.localunguarded, throwing after an extension reload/update while a tab was open. Now guarded +lastError-cleared. —src/content/resume.jsupdateLocalizedLabelsdid 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, noinnerHTML). —src/content/sidebar-chat.jsTests / verification
tests/safe-replace-text.test.js— 5 cases incl. the exact bug repro, link preservation, code preservation.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.