Skip to content

Web/elements/drawer - #21149

Merged
kensternberg-authentik merged 12 commits into
web/flow/declutter-controllersfrom
web/elements/drawer
Mar 26, 2026
Merged

kensternberg-authentik merged 12 commits into
web/flow/declutter-controllersfrom
web/elements/drawer

Conversation

@kensternberg-authentik

@kensternberg-authentik kensternberg-authentik commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Componentize the drawer. (4 files: Component, Styles, Barrel, and the template where it's used). Adjust the FlowInspector to understand what's happened to it (2 files).

Remove unused CSS. (3 files: The Drawer, the Flow, and the global stylesheet)

Provide a better mechanism for manipulating classes than “classMap” (1 file).

Why

The drawer

The drawer was the only thing that we load “native” into the UI, since everything else goes under a shadow. I hope to change that, but in the meantime this gives me a chance to clean up some CSS at the top level. This effort is “the stupidest thing that could work,” just pasting @BeryJu’s drawer pattern into a component and giving it some component reactivity. It’s an excellent start to P5 the thing, however.

The two portions of the drawer, the “content” and the “panel”, are slots; the content is the anonymous slot. This mirrors my philosophy that components are for layout and control, but the look and feel of their content should be driven by the content, not the component.

Remove unused CSS

I literally could not find a reason why any of these were in the top-level CSS; they don’t set CSS Custom Properties not accessible within the components that use them, they don’t affect the visuals of the components that are present within the top-level DOM, and they were just filling up space.

class-list

ClassMap always bothered me as an especially clunky solution to what is essentially a problem in set theory: the element.classlist needs to be adjusted to match “the set of all classes currently active on this component.” ClassList is my solution: a directive that takes a list of classes and does the same set-theoretic comparisons as ClassMap, but with a cleaner API. Anything in the list that is a non-empty string is valid: like ClassMap, it will be left or added to ClassList; everything else (false, "", null, undefined) will be removed. (Symbols, numbers, and objects are technically possible and will be reject as “not part of the classList set”, but Typescript won’t allow you to pass those in.)

This allows us to say things like:

const open = (this.open && "pf-m-expanded") || "pf-m-collapsed"
...
class="pf-c-drawer ${classList(open)}"

… which I think is cleaner than:

const open = {
   "pf-m-expanded": this.open,
   "pf-m-collapsed": !this.open
};
...
class="pf-c-drawer ${classMap(open)}"
  • [🦤] The code has been formatted (make web)

* main: (42 commits)
  endpoints/connectors: fix enabled flag not respected (#21144)
  web: bump vite from 7.3.1 to 8.0.2 in /web (#21109)
  website/docs: add a single page about our user interface, document Consent stage (#20533)
  website: bump the build group across 1 directory with 9 updates (#21127)
  web: bump knip from 5.88.1 to 6.0.5 in /web (#21129)
  core: bump drf-spectacular from 0.28.0 to 0.29.0 (#19420)
  packages/client-go: init (#21139)
  providers/proxy: Add a default maxResponseBodySize to Traefik Middleware (#21111)
  core: bump library/nginx from `dec7a90` to `7150b3a` in /website (#21137)
  core: bump gunicorn from 25.1.0 to 25.2.0 (#21134)
  core: bump github.com/getsentry/sentry-go from 0.43.0 to 0.44.1 (#21122)
  core: bump astral-sh/uv from 0.11.0 to 0.11.1 in /lifecycle/container (#21135)
  ci: bump taiki-e/install-action from 2.69.8 to 2.69.9 in /.github/actions/setup (#21136)
  web/a11y: Modals, Command Palette (Merge branch) (#17812)
  website/docs: document file picker values (#20994)
  packages/client-rust: init (#21117)
  core: bump sentry-sdk from 2.55.0 to 2.56.0 (#21124)
  events: add helper to log deprecation configuration_warning message (#21115)
  core: bump djangorestframework from 3.17.0 to 3.17.1 (#21126)
  core: bump twilio from 9.10.3 to 9.10.4 (#21123)
  ...
* web/flow/declutter-controllers:
  web/flow: provide layout url as needed (#20991)
* web/flow/declutter-controllers:
  Prettier and its opinions.
Componentize the drawer.

Remove unused CSS.

Provide a better mechanism for manipulating classes than “classMap”;

## Why

### The drawer

The drawer was the last thing that we loaded “native” into the UI. This is “the stupidest thing that could work,” just pasting @BeryJu’s drawer pattern into a component and giving it some functionality. It’s an excellent start to P5 the thing, however.

The two portions of the drawer, the “content” and the “panel”, are slots; the content is from the anonymous slot. This mirrors my philosophy that components are for layout and control, but the look and feel of their content should be driven by the content, not the component.

### Remove unused CSS

I literally could not find a reason any of these were in the top-level CSS; they don’t set CSS Custom Properties not accessible within the components that use them, they don’t affect the visuals of the components that are present within the top-level DOM, and they were just filling up space.

### class-list

ClassMap always bothered me as an especially clunky solution to what is essentially a problem in set theory: the `element.classlist` needs to be adjusted to match “the set of all classes currently active on this component.” ClassList is my solution: a directive that takes a *list* of classes and does the same set-theoretic comparisons as ClassMap, but with a cleaner API. Anything in the list that is a non-empty string is valid: like ClassMap, it will be left or added to ClassList; everything else (`false`, `""`, `null`, `undefined`) will be removed. (Symbols, numbers, and objects are technically possible and will be reject as “not part of the classList set”, but Typescript won’t allow you to pass those in.)

This allows us to say things like:

    const open = (this.open && "pf-m-expanded") || "pf-m-collapsed"
    ...
    class="pf-c-drawer ${classList(open)}"

… which I think is cleaner than:

    const open = {
       "pf-m-expanded": this.open,
       "pf-m-collapsed": !this.open
    };
    ...
    class="pf-c-drawer ${classMap(open)}"

- \[🦤\] The code has been formatted (`make web`)
@netlify

netlify Bot commented Mar 25, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a35ba0a
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69c44519eeb53f0009a40e00
😎 Deploy Preview https://deploy-preview-21149--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.

@kensternberg-authentik
kensternberg-authentik marked this pull request as ready for review March 25, 2026 21:00
@kensternberg-authentik
kensternberg-authentik requested review from a team as code owners March 25, 2026 21:00
@kensternberg-authentik
kensternberg-authentik merged commit f2b9034 into web/flow/declutter-controllers Mar 26, 2026
7 checks passed
@kensternberg-authentik
kensternberg-authentik deleted the web/elements/drawer branch March 26, 2026 16:13
kensternberg-authentik added a commit that referenced this pull request Mar 30, 2026
…o their own controllers (#20898)

* web/flow: extract lifecycle events peripheral to stage management into their own controllers

## What

Three features embedded in FlowExecutor, Iframe message handling (from captchas), Multitab message handling, and Websocket message handling, have been extracted from the FlowExecutor and placed into their own controllers.

The `renderFrameBackground()` method has been removed.

# Why

The three features mentioned are all *peripheral* to the task of coordinating challenges. The Iframe message handling may result in a challenge being returned, but there’s a bit of set-up and tear down that doesn’t really correspond well to the central concern of the FlowExecutor; it’s more like a sub-stage of IdentificationStage. By being attached to the executor as Controllers they participate in the executor’s lifecycle and have access to it, but their own internal logic is separated out, making them easier to understand and maintain. As a result, all of the associated machinery– attaching to `window`, disconnecting the websocket client, and so on– can be removed from the FlowExecutor.

The `renderFrameBackground()` method is not used.

* Darn spelling errors.

* Removed debugging line; added some comments.

* Restore frame-based backgrounds to executor; fix comments in FlowIframeMessageController

* Fix comment.

* Prettier and its opinions.

* Web/elements/drawer (#21149)

* .

* .

* .

* .

* .

* .

* Prettier had opinions.

* ## What

Componentize the drawer.

Remove unused CSS.

Provide a better mechanism for manipulating classes than “classMap”;

## Why

### The drawer

The drawer was the last thing that we loaded “native” into the UI. This is “the stupidest thing that could work,” just pasting @BeryJu’s drawer pattern into a component and giving it some functionality. It’s an excellent start to P5 the thing, however.

The two portions of the drawer, the “content” and the “panel”, are slots; the content is from the anonymous slot. This mirrors my philosophy that components are for layout and control, but the look and feel of their content should be driven by the content, not the component.

### Remove unused CSS

I literally could not find a reason any of these were in the top-level CSS; they don’t set CSS Custom Properties not accessible within the components that use them, they don’t affect the visuals of the components that are present within the top-level DOM, and they were just filling up space.

### class-list

ClassMap always bothered me as an especially clunky solution to what is essentially a problem in set theory: the `element.classlist` needs to be adjusted to match “the set of all classes currently active on this component.” ClassList is my solution: a directive that takes a *list* of classes and does the same set-theoretic comparisons as ClassMap, but with a cleaner API. Anything in the list that is a non-empty string is valid: like ClassMap, it will be left or added to ClassList; everything else (`false`, `""`, `null`, `undefined`) will be removed. (Symbols, numbers, and objects are technically possible and will be reject as “not part of the classList set”, but Typescript won’t allow you to pass those in.)

This allows us to say things like:

    const open = (this.open && "pf-m-expanded") || "pf-m-collapsed"
    ...
    class="pf-c-drawer ${classList(open)}"

… which I think is cleaner than:

    const open = {
       "pf-m-expanded": this.open,
       "pf-m-collapsed": !this.open
    };
    ...
    class="pf-c-drawer ${classMap(open)}"

- \[🦤\] The code has been formatted (`make web`)

* Revised comments; changed a variable name.

* Update after merge.

---------

Co-authored-by: Jens Langhammer <[email protected]>
davepgreene pushed a commit to davepgreene/authentik that referenced this pull request Apr 13, 2026
…o their own controllers (goauthentik#20898)

* web/flow: extract lifecycle events peripheral to stage management into their own controllers

## What

Three features embedded in FlowExecutor, Iframe message handling (from captchas), Multitab message handling, and Websocket message handling, have been extracted from the FlowExecutor and placed into their own controllers.

The `renderFrameBackground()` method has been removed.

# Why

The three features mentioned are all *peripheral* to the task of coordinating challenges. The Iframe message handling may result in a challenge being returned, but there’s a bit of set-up and tear down that doesn’t really correspond well to the central concern of the FlowExecutor; it’s more like a sub-stage of IdentificationStage. By being attached to the executor as Controllers they participate in the executor’s lifecycle and have access to it, but their own internal logic is separated out, making them easier to understand and maintain. As a result, all of the associated machinery– attaching to `window`, disconnecting the websocket client, and so on– can be removed from the FlowExecutor.

The `renderFrameBackground()` method is not used.

* Darn spelling errors.

* Removed debugging line; added some comments.

* Restore frame-based backgrounds to executor; fix comments in FlowIframeMessageController

* Fix comment.

* Prettier and its opinions.

* Web/elements/drawer (goauthentik#21149)

* .

* .

* .

* .

* .

* .

* Prettier had opinions.

* ## What

Componentize the drawer.

Remove unused CSS.

Provide a better mechanism for manipulating classes than “classMap”;

## Why

### The drawer

The drawer was the last thing that we loaded “native” into the UI. This is “the stupidest thing that could work,” just pasting @BeryJu’s drawer pattern into a component and giving it some functionality. It’s an excellent start to P5 the thing, however.

The two portions of the drawer, the “content” and the “panel”, are slots; the content is from the anonymous slot. This mirrors my philosophy that components are for layout and control, but the look and feel of their content should be driven by the content, not the component.

### Remove unused CSS

I literally could not find a reason any of these were in the top-level CSS; they don’t set CSS Custom Properties not accessible within the components that use them, they don’t affect the visuals of the components that are present within the top-level DOM, and they were just filling up space.

### class-list

ClassMap always bothered me as an especially clunky solution to what is essentially a problem in set theory: the `element.classlist` needs to be adjusted to match “the set of all classes currently active on this component.” ClassList is my solution: a directive that takes a *list* of classes and does the same set-theoretic comparisons as ClassMap, but with a cleaner API. Anything in the list that is a non-empty string is valid: like ClassMap, it will be left or added to ClassList; everything else (`false`, `""`, `null`, `undefined`) will be removed. (Symbols, numbers, and objects are technically possible and will be reject as “not part of the classList set”, but Typescript won’t allow you to pass those in.)

This allows us to say things like:

    const open = (this.open && "pf-m-expanded") || "pf-m-collapsed"
    ...
    class="pf-c-drawer ${classList(open)}"

… which I think is cleaner than:

    const open = {
       "pf-m-expanded": this.open,
       "pf-m-collapsed": !this.open
    };
    ...
    class="pf-c-drawer ${classMap(open)}"

- \[🦤\] The code has been formatted (`make web`)

* Revised comments; changed a variable name.

* Update after merge.

---------

Co-authored-by: Jens Langhammer <[email protected]>
davepgreene pushed a commit to davepgreene/authentik that referenced this pull request Apr 13, 2026
…o their own controllers (goauthentik#20898)

* web/flow: extract lifecycle events peripheral to stage management into their own controllers

## What

Three features embedded in FlowExecutor, Iframe message handling (from captchas), Multitab message handling, and Websocket message handling, have been extracted from the FlowExecutor and placed into their own controllers.

The `renderFrameBackground()` method has been removed.

# Why

The three features mentioned are all *peripheral* to the task of coordinating challenges. The Iframe message handling may result in a challenge being returned, but there’s a bit of set-up and tear down that doesn’t really correspond well to the central concern of the FlowExecutor; it’s more like a sub-stage of IdentificationStage. By being attached to the executor as Controllers they participate in the executor’s lifecycle and have access to it, but their own internal logic is separated out, making them easier to understand and maintain. As a result, all of the associated machinery– attaching to `window`, disconnecting the websocket client, and so on– can be removed from the FlowExecutor.

The `renderFrameBackground()` method is not used.

* Darn spelling errors.

* Removed debugging line; added some comments.

* Restore frame-based backgrounds to executor; fix comments in FlowIframeMessageController

* Fix comment.

* Prettier and its opinions.

* Web/elements/drawer (goauthentik#21149)

* .

* .

* .

* .

* .

* .

* Prettier had opinions.

* ## What

Componentize the drawer.

Remove unused CSS.

Provide a better mechanism for manipulating classes than “classMap”;

## Why

### The drawer

The drawer was the last thing that we loaded “native” into the UI. This is “the stupidest thing that could work,” just pasting @BeryJu’s drawer pattern into a component and giving it some functionality. It’s an excellent start to P5 the thing, however.

The two portions of the drawer, the “content” and the “panel”, are slots; the content is from the anonymous slot. This mirrors my philosophy that components are for layout and control, but the look and feel of their content should be driven by the content, not the component.

### Remove unused CSS

I literally could not find a reason any of these were in the top-level CSS; they don’t set CSS Custom Properties not accessible within the components that use them, they don’t affect the visuals of the components that are present within the top-level DOM, and they were just filling up space.

### class-list

ClassMap always bothered me as an especially clunky solution to what is essentially a problem in set theory: the `element.classlist` needs to be adjusted to match “the set of all classes currently active on this component.” ClassList is my solution: a directive that takes a *list* of classes and does the same set-theoretic comparisons as ClassMap, but with a cleaner API. Anything in the list that is a non-empty string is valid: like ClassMap, it will be left or added to ClassList; everything else (`false`, `""`, `null`, `undefined`) will be removed. (Symbols, numbers, and objects are technically possible and will be reject as “not part of the classList set”, but Typescript won’t allow you to pass those in.)

This allows us to say things like:

    const open = (this.open && "pf-m-expanded") || "pf-m-collapsed"
    ...
    class="pf-c-drawer ${classList(open)}"

… which I think is cleaner than:

    const open = {
       "pf-m-expanded": this.open,
       "pf-m-collapsed": !this.open
    };
    ...
    class="pf-c-drawer ${classMap(open)}"

- \[🦤\] The code has been formatted (`make web`)

* Revised comments; changed a variable name.

* Update after merge.

---------

Co-authored-by: Jens Langhammer <[email protected]>
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