Skip to content

refactor: extract shared facade-activation and iframe-registry composables - #21

Merged
sagar-kap merged 2 commits into
mainfrom
refactor/shared-embed-state
Aug 7, 2026
Merged

refactor: extract shared facade-activation and iframe-registry composables#21
sagar-kap merged 2 commits into
mainfrom
refactor/shared-embed-state

Conversation

@sagar-kap

Copy link
Copy Markdown
Member

Extracts the duplicated facade-activation and iframe park/restore lifecycle from the three platform carousels into two composables:

  • useFacadeActivation — Set-based facade↔iframe tracking shared by YouTube (id-keyed) and TikTok (index-keyed).
  • useFrameRegistry — per-key iframe bind-once + park/restore/parkAll/restoreAll (about:blank + dataset.savedSrc), used by all three carousels.

Adds test/embed-state.test.ts (happy-dom) covering both composables and the pure parkFrame/restoreFrame helpers. vue added as a devDependency so the composables' Vue imports resolve under Vitest.

Share the facade-holds-a-live-iframe tracking (useFacadeActivation) and the
per-key iframe bind-once/park/restore lifecycle (useFrameRegistry) across the
three platform carousels. Add a happy-dom unit test covering both composables
and the pure park/restore helpers; vue added as a devDependency so the
composables' Vue imports resolve under vitest.
@sagar-kap
sagar-kap force-pushed the refactor/shared-embed-state branch from 643e0d6 to ddfbbe2 Compare August 7, 2026 10:13
@sagar-kap
sagar-kap merged commit 4fe9471 into main Aug 7, 2026
1 check passed
@sagar-kap
sagar-kap deleted the refactor/shared-embed-state branch August 7, 2026 10:15
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