fix: blank glass on restore-minimized via addPane withGlass flag#60
Merged
Conversation
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.
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.
Closes #61
What
BinaryWindow.addPanealways seeded a placeholderGlassbuilt from itsglassProps, 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) usedappend(notreplaceChildren), leaving twobw-glasschildren in the pane — empty placeholder first, restored glass second. A later detach readsquerySelector('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
withGlassflag toaddPane(defaults totrue). When false,addPaneallocates a bare pane without constructing a glass.glass/drag.jsandglass/action.js(the bring-your-own-glass callers) passwithGlass: falseandappendtheir own glass into the now-empty pane.detached-glass/action.attach.js, thedev/add-pane page) are unchanged —withGlassdefaults true, so the seeded glass and the react-bwinaddPanecontent workaround keep working.docs/TECH_DEBT.mdentry (per its "delete when fixed" convention).Notes
drag.jspreviously usedreplaceChildrento overwrite the placeholder; with no placeholder, a plainappendinto the fresh empty pane is equivalent and keeps fix: detached glass empty after edge-split drop #56 fixed.