Skip to content

fix: blank glass on restore-minimized via addPane withGlass flag#60

Merged
ohxyz merged 1 commit into
mainfrom
fix/addpane-withglass-flag
Jun 12, 2026
Merged

fix: blank glass on restore-minimized via addPane withGlass flag#60
ohxyz merged 1 commit into
mainfrom
fix/addpane-withglass-flag

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #61

What

BinaryWindow.addPane always seeded a placeholder Glass built from its glassProps, even for callers that already hold a real glass element and only need the pane. This conflated two intents in one signature and forced those callers to defeat the placeholder.

The restore-minimized path (glass/action.js) used append (not replaceChildren), leaving two bw-glass children in the pane — empty placeholder first, restored glass second. A later detach reads querySelector('bw-glass-content'), which returns the first (empty) match → a blank glass (obvious when maximized). This is the same class of bug as #56 (edge-split drop).

Change

  • Add a withGlass flag to addPane (defaults to true). When false, addPane allocates a bare pane without constructing a glass.
  • glass/drag.js and glass/action.js (the bring-your-own-glass callers) pass withGlass: false and append their own glass into the now-empty pane.
  • Build-a-glass callers (detached-glass/action.attach.js, the dev/ add-pane page) are unchanged — withGlass defaults true, so the seeded glass and the react-bwin addPane content workaround keep working.
  • Removed the corresponding docs/TECH_DEBT.md entry (per its "delete when fixed" convention).

Notes

  • drag.js previously used replaceChildren to overwrite the placeholder; with no placeholder, a plain append into the fresh empty pane is equivalent and keeps fix: detached glass empty after edge-split drop #56 fixed.
  • Not yet verified live — recommend exercising drag-out → edge-drop → maximize and restore-minimized → detach.

addPane always seeded a placeholder glass, forcing bring-your-own-glass
callers to defeat it. The restore-minimized path used append (not
replaceChildren), leaving two glasses in the pane; a later detach read
the empty placeholder via querySelector, producing a blank glass.

Add a withGlass flag (default true) so drag and restore callers get a
bare pane without glass and mount their own. Build-a-glass callers
(attach, dev page) are unchanged.
@ohxyz ohxyz merged commit 0f2e6f7 into main Jun 12, 2026
@ohxyz ohxyz deleted the fix/addpane-withglass-flag branch June 12, 2026 04:37
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.

Restore a pane/glass from sill creates additional bw-glass element

1 participant