feat: detached glass#52
Merged
Merged
Conversation
…ound to sash tree
… same shape of detached glass
Closed
Mirror the detached-glass structure: break the monolithic glass/module.js into glass/action.js (minimize/restore/disabled-state) and glass/drag.js (moved from the top-level draggable.js, since drag is a glass concern). module.js is now a thin aggregator exposing enableGlassFeature(), and binary-window collapses enableDrag()+enableActions() into that one call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the detached-glass change: merge glass/module.js's aggregator into glass/index.js and delete module.js. Move activeDragGlassEl/activeDragGlassPaneCanDrop to module-level let in drag.js so they no longer leak onto the BinaryWindow instance. They can't be closure-local like move/resize state because onPaneDrop (a droppable hook override) reads them from outside enableGlassDrag; a native drag is one document-global gesture, so a module-level singleton is the right scope. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename BUILTIN_ACTIONS/BUILTIN_ACTIONS_2 to DEFAULT_GLASS_ACTIONS/ DEFAULT_DETACHED_GLASS_ACTIONS, keeping deprecated aliases for compat. Add detached-glass attach action and tweak action icons.
- add Sash.getRelativeSize() to recover a pane's fractional size - add removeDetachedGlass() and rename manager methods to *ById/*ByElement - detach action records sibling sash id, position, and relative size - attach action re-adds the pane to its original sibling and removes the glass
addChild never set the child's parent back-pointer, so panes created via addPane (the re-attach path) had parent=null and threw on the next detach. Set parent in addChild, and re-parent siblings hoisted up in removePane.
- add Sash.getLargestLeaf() to find the biggest-area pane - attach action targets the largest leaf, splitting along its longer side (right if flat, bottom if tall) when the original sibling no longer exists - dev feature: nested left split to exercise the fallback
- rename VITE_DEFAULT_DEBUG to VITE_DEBUG in .env.production to match the VITE_DEBUG key read in frame.js - CLAUDE.md: print the commit message when asked to commit
…ivate - add.js -> crud.js now that it holds both add and remove - getCascadedPlacement becomes a module-private function taking the window element, no longer mixed into the BinaryWindow instance
Passing the bw-glass-content element as content made Glass wrap it in a second bw-glass-content. Extract its child nodes into a fragment instead, via new extractChildNodes util.
Replace the Toggle BG button with Toggle Theme, which adds/removes theme="dark" on all bw-window elements in the iframe.
Rephrase rules as imperatives, shorten headings, and add a working cross-reference from the dev/ commit rule to the Dev pages section.
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.
Summary
Adds detached glass — floating, OS-window-like panels that can be popped out of the tiled layout, moved/resized freely, minimized to the sill, and re-attached.
Features
Structure
src/binary-window/detached-glass/module split into feature submodules (crud, drag, move, resize, minimize/restore, attach/close actions, manager).src/binary-window/glass/reorganized so glass and its actions/drag live together.detached-glass.css, plus shadow/highlight vars and sill styling.Testing
binary-window.test.js;vitest.config.jsset up for the suite.dev/pages exercise detach, minimize/restore, theming, and performance manually.