Skip to content

feat: list-placement glass actions as a popover dropdown#86

Merged
ohxyz merged 11 commits into
mainfrom
feat/action-list
Jun 21, 2026
Merged

feat: list-placement glass actions as a popover dropdown#86
ohxyz merged 11 commits into
mainfrom
feat/action-list

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a popover-dropdown placement for glass actions and open/close animations, plus supporting refactors.

What changed

  • List-placement action menu — glass actions can collapse into a bw-action-menu popover opened from a single trigger, as an alternative to the inline action bar. Dismisses on pointerdown elsewhere.
  • Enter/exit animations — detached glass animates on open/close; the action menu popover animates via the platform's discrete-element support (@starting-style + transition-behavior: allow-discrete).
  • Sill/pot refactor — minimized-glass buttons renamed to .bw-pot (bw-plant="glass"); restore-from-minimized extracted into a new sill.js module wired by enableSillFeatures(). BinaryWindow.assemble() now takes a sillModule.
  • Action button styling — tokenized sizing (--bw-action-button-*), renamed --bw-glass-action-bg-color-hover--bw-action-button-bg-color-hover, and unified .bw-action / .bw-action-menu-trigger base rules. The menu trigger uses a font-size press effect instead of a scale transform to avoid shifting the popover anchor.
  • Custom actions now transfer correctly across detach/attach.
  • DocsARCHITECTURE.md, TECH_DEBT.md, conventions.md updated (new animation + bw--attribute/expando conventions). New dev pages exercise the action menu and popover behavior.

ohxyz added 10 commits June 18, 2026 20:28
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
@ohxyz ohxyz changed the title feat: list-placement glass actions as a popover dropdown WIP feat: list-placement glass actions as a popover dropdown Jun 21, 2026
- .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
@ohxyz ohxyz changed the title WIP feat: list-placement glass actions as a popover dropdown WIP list-placement glass actions as a popover dropdown Jun 21, 2026
@ohxyz ohxyz changed the title WIP list-placement glass actions as a popover dropdown Work in progress: list-placement glass actions as a popover dropdown Jun 21, 2026
@ohxyz ohxyz changed the title Work in progress: list-placement glass actions as a popover dropdown WIP: list-placement glass actions as a popover dropdown Jun 21, 2026
@ohxyz ohxyz changed the title WIP: list-placement glass actions as a popover dropdown feat: list-placement glass actions as a popover dropdown Jun 21, 2026
@ohxyz ohxyz merged commit f65bb7f into main Jun 21, 2026
@ohxyz ohxyz deleted the feat/action-list branch June 21, 2026 04:56
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