Skip to content

refactor: make detachedGlassManager the single point for detached-glass lifecycle#92

Merged
ohxyz merged 1 commit into
mainfrom
refactor/detached-glass-manager
Jun 23, 2026
Merged

refactor: make detachedGlassManager the single point for detached-glass lifecycle#92
ohxyz merged 1 commit into
mainfrom
refactor/detached-glass-manager

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Centralizes the detached-glass lifecycle behind detachedGlassManager, the single entry point for add/remove/update across both in-window and windowless glasses.

  • addDetachedGlass(options) — builds the DetachedGlass, registers + brings to front, plays the open animation; returns the glass element (callers own only the DOM append).
  • removeDetachedGlass(id, { animateClose }) — owns the full teardown: unregister and remove the DOM node + modal backdrop.
  • updateDetachedGlass(id, options) — tentative stub (throws).
  • Guards against duplicate ids in the stack; adds getDetachedGlassById.
  • Migrates crud.js / binary-window.js / action.close.js / action.detach.js; adds manager.test.js.

Also fixes a latent missing-import bug in removeWindowlessGlass.

⚠️ Public API change: addDetachedGlass / addWindowlessGlass now return the glass element rather than the DetachedGlass instance — downstream react-bwin may need updating.

Test plan

  • npm test — 48 passing (6 files), incl. new manager.test.js (18 cases).
  • npm run build — clean.

…ss lifecycle

- addDetachedGlass builds the DetachedGlass, registers + brings to front, plays
  the open animation, and returns the glass element (callers own only the DOM
  append).
- removeDetachedGlass owns the full teardown (unregister + remove node/backdrop)
  and takes an { animateClose } options object.
- updateDetachedGlass added as a tentative stub.
- Guard against duplicate ids in the stack; add getDetachedGlassById.
- Migrate crud/binary-window/action callers; add manager.test.js.
@ohxyz ohxyz mentioned this pull request Jun 23, 2026
@ohxyz ohxyz merged commit 51e3ea5 into main Jun 23, 2026
@ohxyz ohxyz deleted the refactor/detached-glass-manager branch June 23, 2026 01:36
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