fix(extension): resync detected language on tab visibility#1282
fix(extension): resync detected language on tab visibility#1282frogGuaGuaGuaGua wants to merge 1 commit intomainfrom
Conversation
|
Contributor trust score40/100 — Moderate This score estimates contributor familiarity with Outcome
Score breakdown
Signals used
Policy
Updated automatically when the PR changes or when a maintainer reruns the workflow. |
Summary
detectedCodeinto shared storage when the tab becomes visible againFixes #1281.
Testing
pnpm exec wxt preparepnpm exec eslint src/entrypoints/host.content/runtime.tspnpm exec tsc --noEmit(currently fails in this checkout because of pre-existing unrelated type errors around Notebase / API contract types)Summary by cubic
Resync detected language only when a tab is visible and keep a per-tab last value in memory. Prevents background tabs from overwriting the active tab’s detected language, fixing #1281.
local:${DETECTED_CODE_STORAGE_KEY}unlessdocument.visibilityState === "visible".visibilitychangewhen the tab becomes visible; initialize withDEFAULT_DETECTED_CODE.syncDetectedCodeToStoragehelper and clean up the visibility listener on teardown.Written for commit 7cdd2eb. Summary will update on new commits.