Skip to content

web/elements: default @listen target to host element and add split-button Dropdown#21512

Merged
GirlBossRush merged 3 commits intomainfrom
web/listen-default-dropdown
Apr 11, 2026
Merged

web/elements: default @listen target to host element and add split-button Dropdown#21512
GirlBossRush merged 3 commits intomainfrom
web/listen-default-dropdown

Conversation

@GirlBossRush
Copy link
Copy Markdown
Contributor

@GirlBossRush GirlBossRush commented Apr 9, 2026

Summary

  • Change the @listen decorator default target from window to this — host-scoped listeners are 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)
  • Add split-button support to the Dropdown component with SplitButtonSelector / ToggleButtonSelector statics and corresponding CSS padding variables

Test plan

  • Verify admin drawer toggle, locale status, API drawer, sidebar hash navigation, and flow session authentication listeners still fire correctly
  • Verify dropdown menus open/close as before
  • Test split-button dropdown rendering (if any admin pages use it)
    Split from web/a11y: Modal revisions, behavior fixes #21206 to ease review.

@GirlBossRush GirlBossRush requested a review from a team as a code owner April 9, 2026 06:51
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit a58d9fe
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/69d9dae08e932f00089fcdbd
😎 Deploy Preview https://deploy-preview-21512--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.28%. Comparing base (2aa9906) to head (a58d9fe).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
conformance 37.03% <ø> (+<0.01%) ⬆️
e2e 42.96% <ø> (+1.04%) ⬆️
integration 33.96% <ø> (+<0.01%) ⬆️
rust 60.58% <ø> (+0.07%) ⬆️
unit 91.89% <ø> (+<0.01%) ⬆️
unit-migrate 91.98% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a58d9fe
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69d9dae0eec1870008d6415e
😎 Deploy Preview https://deploy-preview-21512--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@kensternberg-authentik kensternberg-authentik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@GirlBossRush GirlBossRush force-pushed the web/listen-default-dropdown branch from f90ce43 to 6613f37 Compare April 10, 2026 15:22
@GirlBossRush GirlBossRush enabled auto-merge (squash) April 10, 2026 15:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

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)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

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-a58d9fe938444647bedaa8284e0e02b23e1ec1cf

Afterwards, run the upgrade commands from the latest release notes.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 10, 2026

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit a58d9fe
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69d9dae01736db00087bc4f2
😎 Deploy Preview https://deploy-preview-21512--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

GirlBossRush and others added 3 commits April 11, 2026 07:23
…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>
@GirlBossRush GirlBossRush force-pushed the web/listen-default-dropdown branch from d9c94c7 to a58d9fe Compare April 11, 2026 05:23
@GirlBossRush GirlBossRush merged commit 1858125 into main Apr 11, 2026
111 checks passed
@GirlBossRush GirlBossRush deleted the web/listen-default-dropdown branch April 11, 2026 05:47
kensternberg-authentik added a commit that referenced this pull request Apr 13, 2026
* 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)
kensternberg-authentik added a commit that referenced this pull request Apr 13, 2026
* 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)
davepgreene pushed a commit to davepgreene/authentik that referenced this pull request Apr 13, 2026
…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>
davepgreene pushed a commit to davepgreene/authentik that referenced this pull request Apr 13, 2026
…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>
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.

2 participants