web/elements: default @listen target to host element and add split-button Dropdown#21512
web/elements: default @listen target to host element and add split-button Dropdown#21512GirlBossRush merged 3 commits intomainfrom
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21512 +/- ##
==========================================
+ Coverage 92.21% 92.28% +0.06%
==========================================
Files 1032 1032
Lines 59658 59658
Branches 2537 2537
==========================================
+ Hits 55013 55053 +40
+ Misses 4580 4542 -38
+ Partials 65 63 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
kensternberg-authentik
left a comment
There was a problem hiding this comment.
Tsk! This could still have been two PRs (@listen and Dropdown), but it's small enough.
One thing I'm not clear on is what's different between the @listen listener and all the individual listeners? Also, one thing that I've learned recently is that if you have a listener on window that triggers a method in your component, that component will never be garbage collected if removed from the DOM until the listener is removed, since it has a hard reference to your component. If we need to track "clicks outside," we should probably look at how other people have done it and find a technique with weaker references.
| // }); | ||
| // } | ||
| for (const menuItemButton of menuItemButtons) { | ||
| menuItemButton.addEventListener("click", this.hide, { |
There was a problem hiding this comment.
All right, gonna be a butthead here and ask: why can't we do this as a top-level listener, get the event target and ask for an ID or some other referent? Then you could just build the click listener on construction, and not have to worry about abort controllers at all.
f90ce43 to
6613f37
Compare
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-a58d9fe938444647bedaa8284e0e02b23e1ec1cf
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-a58d9fe938444647bedaa8284e0e02b23e1ec1cfAfterwards, run the upgrade commands from the latest release notes. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ment Change the `@listen` decorator default target from `window` to `this` so listeners bind to the host element by default — the more common case for Lit components. Add explicit `target: window` to the five existing call sites that dispatch on the window (ak-interface-admin, APIDrawer, SidebarItem, FlowExecutor, and Dropdown's own refresh listener). Also add split-button support to the Dropdown component with `SplitButtonSelector` / `ToggleButtonSelector` statics and corresponding CSS padding variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d9c94c7 to
a58d9fe
Compare
* main: core: bump ruff from 0.15.9 to 0.15.10 (#21559) core: bump types-jwcrypto from 1.5.0.20260408 to 1.5.7.20260409 (#21561) core: bump lxml from 6.0.3 to 6.0.4 (#21560) ci: bump peter-evans/create-pull-request from 8.1.0 to 8.1.1 (#21566) ci: bump docker/build-push-action from 7.0.0 to 7.1.0 (#21563) ci: bump actions/upload-artifact from 7.0.0 to 7.0.1 (#21565) core: bump library/golang from `da39430` to `c0074c7` in /lifecycle/container (#21567) ci: bump taiki-e/install-action from 2.75.1 to 2.75.5 in /.github/actions/setup (#21569) web: bump mermaid from 11.13.0 to 11.14.0 in /web (#21527) core, web: update translations (#21552) web: bump basic-ftp from 5.2.1 to 5.2.2 in /web (#21543) web: User Wizard, Modal Revisions Merge Branch (#21336) web/elements: default @listen target to host element and add split-button Dropdown (#21512)
* main: web: build system had some legacy stuff that I found confusing while working on the CSS ordering (#20698) core: bump ruff from 0.15.9 to 0.15.10 (#21559) core: bump types-jwcrypto from 1.5.0.20260408 to 1.5.7.20260409 (#21561) core: bump lxml from 6.0.3 to 6.0.4 (#21560) ci: bump peter-evans/create-pull-request from 8.1.0 to 8.1.1 (#21566) ci: bump docker/build-push-action from 7.0.0 to 7.1.0 (#21563) ci: bump actions/upload-artifact from 7.0.0 to 7.0.1 (#21565) core: bump library/golang from `da39430` to `c0074c7` in /lifecycle/container (#21567) ci: bump taiki-e/install-action from 2.75.1 to 2.75.5 in /.github/actions/setup (#21569) web: bump mermaid from 11.13.0 to 11.14.0 in /web (#21527) core, web: update translations (#21552) web: bump basic-ftp from 5.2.1 to 5.2.2 in /web (#21543) web: User Wizard, Modal Revisions Merge Branch (#21336) web/elements: default @listen target to host element and add split-button Dropdown (#21512) ci: parallel tests (#21515) website/docs: add another sentence to First Steps about restricting access to apps (#21517) web/elements: add scrollbar helpers and apply to Interface (#21511) web/elements: add viewport helpers and extend intersection observer (#21508)
…tton Dropdown (goauthentik#21512) web/buttons: support split-button Dropdown and default @listen to element Change the `@listen` decorator default target from `window` to `this` so listeners bind to the host element by default — the more common case for Lit components. Add explicit `target: window` to the five existing call sites that dispatch on the window (ak-interface-admin, APIDrawer, SidebarItem, FlowExecutor, and Dropdown's own refresh listener). Also add split-button support to the Dropdown component with `SplitButtonSelector` / `ToggleButtonSelector` statics and corresponding CSS padding variables. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…tton Dropdown (goauthentik#21512) web/buttons: support split-button Dropdown and default @listen to element Change the `@listen` decorator default target from `window` to `this` so listeners bind to the host element by default — the more common case for Lit components. Add explicit `target: window` to the five existing call sites that dispatch on the window (ak-interface-admin, APIDrawer, SidebarItem, FlowExecutor, and Dropdown's own refresh listener). Also add split-button support to the Dropdown component with `SplitButtonSelector` / `ToggleButtonSelector` statics and corresponding CSS padding variables. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
@listendecorator default target fromwindowtothis— host-scoped listeners are the more common case for Lit componentstarget: windowto the five existing call sites that dispatch on the window (ak-interface-admin,APIDrawer,SidebarItem,FlowExecutor, and Dropdown's own refresh listener)SplitButtonSelector/ToggleButtonSelectorstatics and corresponding CSS padding variablesTest plan
Split from web/a11y: Modal revisions, behavior fixes #21206 to ease review.