Skip to content

feat: detached glass#52

Merged
ohxyz merged 58 commits into
mainfrom
feat/detached-glass
Jun 9, 2026
Merged

feat: detached glass#52
ohxyz merged 58 commits into
mainfrom
feat/detached-glass

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

  • Detach / attach — pop a glass out of its pane into a floating panel, and re-attach it to its original sibling pane (falling back to the largest pane when the original is gone).
  • Move & resize — drag the floating panel to reposition; resize from a grab zone straddling the border.
  • Minimize / restore — collapse a detached glass to the sill and restore it. New sill items briefly flash their background to draw attention.
  • Cascade — new detached glasses cascade from the active one and stay within the viewport.
  • Default actions — detach/close/minimize/maximize wired up as built-in glass and detached-glass actions, with the detach button disabled when only one pane remains.
  • Theming — detached-glass box shadows, and the minimized-glass highlight color in the sill, tuned for both light and dark modes.

Structure

  • New 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.
  • New CSS: detached-glass.css, plus shadow/highlight vars and sill styling.

Testing

  • Added binary-window.test.js; vitest.config.js set up for the suite.
  • dev/ pages exercise detach, minimize/restore, theming, and performance manually.

@ohxyz ohxyz mentioned this pull request Jun 6, 2026
ohxyz and others added 12 commits June 6, 2026 22:00
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>
ohxyz and others added 26 commits June 7, 2026 14:53
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.
@ohxyz ohxyz changed the title wip: detached glass feat: detached glass Jun 9, 2026
@ohxyz ohxyz merged commit 8137b7e into main Jun 9, 2026
@ohxyz ohxyz deleted the feat/detached-glass branch June 9, 2026 05:00
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