feat: list-placement glass actions as a popover dropdown#86
Merged
Conversation
Add a 'list' action placement that renders actions in a popover menu triggered from the glass header, alongside the existing 'bar' actions. - Glass.createActionList builds a scoped popover (anchor-scope + Popover API via popoverTargetElement) so multiple glasses don't collide on anchor-name or id. - Split action styles into src/css/glass.action.css. - Add --bw-glass-action-list-menu-shadow var (default + dark theme). - Dev pages for the popover pattern and list actions.
transferGlass now also moves the action list popover and any custom (non- builtin) bar actions, so they survive detaching/attaching a glass. - Stamp action.type onto bar buttons via the bwActionType expando; transferGlass moves buttons whose type doesn't contain 'builtin'. - Tag all builtin actions with type + placement so they're excluded. - Document the bw-prefixed expando convention in conventions.md.
Close any open action list popover when pressing outside it (e.g. starting a muntin or header drag), which light-dismiss alone misses. - Implement dismissActionListMenuOnPointerDown and wire it into enableGlassActions. - Add the enableGlassStandaloneFeatures hook and call it from binary-window.js.
Remove the redundant bw-glass-action-list wrapper (anchor-scope now lives
on bw-glass-header) and collapse the verbose naming onto a short bw-action*
family:
- trigger -> .bw-action-menu-trigger
- menu element -> <bw-action-menu>
- bar element -> <bw-action-bar>
- menu items + bar buttons share one .bw-action base; menu-only tweaks are
scoped under bw-action-menu
- modifiers -> .bw-action--{minimize,detach,attach,maximize,close}
- anchor id -> --bw-action-menu; var --bw-action-menu-shadow
No behavior change. These names are not part of the react-bwin contract.
…l module - Rename the state-named .bw-minimized-glass / .bw-minimized-detached-glass sill buttons to a single <button class="bw-pot" bw-plant="glass|detached-glass">, giving the verb pair pot (minimize) / un-pot (restore). Breaking change vs the react-bwin contract (.bw-minimized-glass class + getMinimizedGlassElementBySashId); clean rename, no alias, downstream migrates in lockstep. - Move all sill restore logic into a new binary-window/sill.js module (enableSillFeatures / enableUnpotGlass / enableUnpotDetachedGlass / unpotGlass / getPotElementBySashId); delete detached-glass/restore.js and trim glass/action.js. Assemble sillModule onto BinaryWindow; enableFeatures() calls enableSillFeatures(). - CSS: merge the two sill-button rules into .bw-pot; rename keyframes/var to bw-pot. - Document the bw- attribute-prefix convention (native els get bw-; bwin custom els stay unprefixed) and reframe the assemble-module TECH_DEBT fix direction. No behavior change. Build + tests pass.
- Slide-down + fade-in on open via @starting-style; mirror fade/slide-up on close using transition-behavior: allow-discrete on display/overlay so the exit animation plays before the popover leaves the DOM. - Scale the trigger from bottom-left on :active so the popover anchor point stays put while the button shrinks. - Tweak sill pot highlight timing (2s ease-out -> 1.5s ease); add a third dropdown action to the bwin-actions dev page.
- Add an OS-style open animation (scale-up from 0.9 + fade-in, 0.18s) on insert, and a mirror close animation driven by a [closing] attribute. - removeDetachedGlassElement (utils) sets [closing] then removes the element + modal backdrop after a timeout matching the animation duration; CSS cannot animate a normal element out of the DOM. - Manager: add removeDetachedGlassByElement (unregister + animated removal); rename removeGlassById -> removeDetachedGlassById, addGlassByElement -> addDetachedGlassByElement, getActiveGlass -> getActiveDetachedGlass. - Route close action, removeDetachedGlass, and removeWindowlessGlass through the animated removal.
- rename --bw-glass-action-bg-color-hover to --bw-action-button-bg-color-hover - replace :active scale transform with font-size token (--bw-action-button-active-scale) - add --bw-action-button-min-width/min-height to keep size stable on :active - unify .bw-action and .bw-action-menu-trigger base rules
- .bw-action :active uses transform: scale() again (token now 95%) - .bw-action-menu-trigger :active resets scale and shrinks font-size instead, avoiding the popover anchor shift from button resizing
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 a popover-dropdown placement for glass actions and open/close animations, plus supporting refactors.
What changed
bw-action-menupopover opened from a single☰trigger, as an alternative to the inline action bar. Dismisses on pointerdown elsewhere.@starting-style+transition-behavior: allow-discrete)..bw-pot(bw-plant="glass"); restore-from-minimized extracted into a newsill.jsmodule wired byenableSillFeatures().BinaryWindow.assemble()now takes asillModule.--bw-action-button-*), renamed--bw-glass-action-bg-color-hover→--bw-action-button-bg-color-hover, and unified.bw-action/.bw-action-menu-triggerbase rules. The menu trigger uses a font-size press effect instead of a scale transform to avoid shifting the popover anchor.ARCHITECTURE.md,TECH_DEBT.md,conventions.mdupdated (new animation +bw--attribute/expando conventions). New dev pages exercise the action menu and popover behavior.