Skip to content

web/flow: extract lifecycle events peripheral to stage management into their own controllers - #20898

Merged
kensternberg-authentik merged 19 commits into
mainfrom
web/flow/declutter-controllers
Mar 30, 2026
Merged

kensternberg-authentik merged 19 commits into
mainfrom
web/flow/declutter-controllers

Conversation

@kensternberg-authentik

Copy link
Copy Markdown
Contributor

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.

  • The code has been formatted (make web)

…o 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.
@netlify

netlify Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit d034032
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/69cab273cf7ae00008298db8
😎 Deploy Preview https://deploy-preview-20898--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.

@netlify

netlify Bot commented Mar 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit b1dbb3c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69b4a6b9ab5eac0008d172d9
😎 Deploy Preview https://deploy-preview-20898--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.

@netlify

netlify Bot commented Mar 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

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

@netlify

netlify Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 19f9352
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69cab05bc550510008573630
😎 Deploy Preview https://deploy-preview-20898--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.

return html`<slot name="placeholder"></slot>`;
}

protected renderFrameBackground(): SlottedTemplateResult {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This method is not called from anywhere. An analysis of the ./dist folder shows that it's so unused that the tree-shaker deletes it from the deployment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This not being used doesn't sit right, this should be used somewhere, ref #19527

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@kensternberg-authentik
kensternberg-authentik marked this pull request as ready for review March 14, 2026 00:11
@kensternberg-authentik
kensternberg-authentik requested a review from a team as a code owner March 14, 2026 00:11
@codecov

codecov Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.83%. Comparing base (0b1ba60) to head (d034032).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20898      +/-   ##
==========================================
+ Coverage   92.81%   92.83%   +0.01%     
==========================================
  Files        1004     1004              
  Lines       57012    57012              
  Branches      425      425              
==========================================
+ Hits        52917    52926       +9     
+ Misses       4095     4086       -9     
Flag Coverage Δ
conformance 37.19% <ø> (+<0.01%) ⬆️
e2e 42.67% <ø> (+<0.01%) ⬆️
integration 22.12% <ø> (+<0.01%) ⬆️
rust 0.23% <ø> (ø)
unit 91.83% <ø> (ø)
unit-migrate 91.90% <ø> (+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.

@github-actions

github-actions Bot commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@kensternberg-authentik kensternberg-authentik changed the title web/flow: extract lifecycle events peripheral to stage management into their won controllers web/flow: extract lifecycle events peripheral to stage management into their own controllers Mar 16, 2026
* dev: (54 commits)
  website/docs: use full path for sysd on windows (#20951)
  web/flow: separate out independent behavior tracks from IdentificationStage (autoredirect, webauthn, captcha, rememberme) (#20578)
  web: bump the storybook group across 1 directory with 5 updates (#20944)
  web: bump chromedriver from 146.0.3 to 146.0.4 in /web (#20945)
  outposts: only dispatch logout task if any outpost exists (#20920)
  core: bump goauthentik/fips-debian from `2517845` to `e06f0fe` in /lifecycle/container (#20852)
  website: bump @goauthentik/docusaurus-config from 2.4.0 to 2.5.1 in /website in the docusaurus group (#20907)
  web: bump knip from 5.86.0 to 5.87.0 in /web (#20948)
  core: bump library/nginx from `d0913a1` to `bc45d24` in /website (#20853)
  website: bump openapi-to-postmanv2 from 5.8.0 to 6.0.0 in /website (#20910)
  core: bump library/node from `d025db2` to `407d745` in /website (#20943)
  web: bump @formatjs/intl-listformat from 8.2.2 to 8.2.3 in /web (#20946)
  web: bump core-js from 3.48.0 to 3.49.0 in /web (#20947)
  packages/django-dramatiq-postgres: scheduler: only dispatch tasks if they're not running yet (#20921)
  core, web: update translations (#20935)
  core: bump uvicorn[standard] from 0.41.0 to 0.42.0 (#20936)
  core: bump library/golang from `ab8c494` to `9c51d8b` in /lifecycle/container (#20937)
  core: bump astral-sh/uv from 0.10.10 to 0.10.11 in /lifecycle/container (#20938)
  ci: bump svenstaro/upload-release-action from 2.11.4 to 2.11.5 (#20939)
  ci: bump astral-sh/setup-uv from 7.5.0 to 7.6.0 in /.github/actions/setup (#20941)
  ...
@netlify

netlify Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

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

Comment on lines +24 to +26
* Third-party assistants in the authentication process, notably CAPTCHAs, are loaded in iframes.
* This controller listens for iframe boundary-crossing events and, if appropriate, forwards them to
* the FlowExecutor.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dont think this comment is correct, this is for stages like gdtc that submit to the host from a frame

return;
}

document.title = "continued";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
document.title = "continued";

This is a debugging leftover, cant believe it's still in the code 🙈

kensternberg-authentik and others added 12 commits March 17, 2026 08:30
* main: (21 commits)
  providers/oauth2: evaluate property mappings in client credentials JWT flow (#20979)
  core: bump ujson from 5.11.0 to 5.12.0 (#20980)
  website: bump the build group in /website with 3 updates (#20963)
  core: bump goauthentik.io/api/v3 to 3.2026.5.0-rc1-1773774443 (#20955)
  ci: bump calibreapp/image-actions from d9c8ee5c3dc52ae4622c82ead88d658f4b16b65f to 03c976c29803442fc4040a9de5509669e7759b81 (#20970)
  core: bump library/golang from `9c51d8b` to `96b2878` in /lifecycle/container (#20972)
  core: bump library/node from `407d745` to `394048f` in /website (#20973)
  core: bump library/nginx from `bc45d24` to `dec7a90` in /website (#20974)
  core: bump github.com/go-ldap/ldap/v3 from 3.4.12 to 3.4.13 (#20962)
  core: bump google-api-python-client from 2.192.0 to 2.193.0 (#20964)
  web: bump @sentry/browser from 10.43.0 to 10.44.0 in /web in the sentry group across 1 directory (#20965)
  core: bump django-tenants from 3.10.0 to 3.10.1 (#20966)
  core: bump coverage[toml] from 7.13.4 to 7.13.5 (#20967)
  core: bump goauthentik/fips-debian from `e06f0fe` to `a613b75` in /lifecycle/container (#20968)
  core: bump sentry-sdk from 2.54.0 to 2.55.0 (#20969)
  core: bump goauthentik/fips-python from `08bc05d` to `ec5c4cd` in /lifecycle/container (#20971)
  web: Fix admin table horizontal scrolling (#20960)
  core: bump pyasn1 from 0.6.2 to 0.6.3 (#20956)
  tasks: fix workers API URL missing trailing / (#20954)
  web: Supply our font and color choices to rapidoc. (#20775)
  ...
…controllers' into web/flow/declutter-controllers

* refs/remotes/origin/web/flow/declutter-controllers:
* main:
  website/docs: fix notification transport etc (#20982)
  web/admin: fix missing OSM referrerPolicy header (#20984)
  ci: avoid installing unnecessary dependencies for lint (#20981)
* main:
  web: link file picker to docs (#20995)
  web/flow: reset stale authenticator selection between consecutive validate stages (#20802)
  ci: bump actions/cache from 5.0.3 to 5.0.4 (#21002)
  root: init rust workspace (#20983)
  website/docs: fix swapped sidebar label (#21011)
  core: bump goauthentik/fips-python from `ec5c4cd` to `859ad57` in /lifecycle/container (#21003)
  core: bump goauthentik/fips-debian from `a613b75` to `7baeeaa` in /lifecycle/container (#21001)
  core: bump djangorestframework from 3.16.1 to 3.17.0 (#21000)
  lifecycle/aws: bump aws-cdk from 2.1111.0 to 2.1112.0 in /lifecycle/aws (#20999)
  ci: bump codecov/codecov-action from 5.5.2 to 5.5.3 in /.github/actions/test-results (#21004)
  web: bump the storybook group across 1 directory with 5 updates (#21005)
  web: bump knip from 5.87.0 to 5.88.0 in /web (#21006)
  web: bump @formatjs/intl-listformat from 8.2.3 to 8.3.1 in /web (#21007)
  website/docs: update kubernetes install guide for Gateway API (#20961)
* main: (41 commits)
  ci: rotate GH App private key (#21085)
  internal/web: remove authentication for metrics (#21077)
  lib/config: explicit some defaults (#21079)
  internal: remove unix sockets on shutdown (#21081)
  ci: fix escaping in cherry-pick action (#21082)
  lib/config: support printing multiple values (#21080)
  root: fix rust setup (#21078)
  core: bump types-docker from 7.1.0.20260109 to 7.1.0.20260322 (#21062)
  policies: remove BufferedPolicyAccessView leftovers (#21057)
  core: bump axllent/mailpit from v1.29.3 to v1.29.4 in /tests/e2e (#21061)
  core: bump types-channels from 4.3.0.20250822 to 4.3.0.20260321 (#21063)
  core: bump github.com/jackc/pgx/v5 from 5.8.0 to 5.9.1 (#21059)
  translate: Updates for project authentik and language fr_FR (#21056)
  ci: bump taiki-e/install-action from 2.69.2 to 2.69.6 in /.github/actions/setup (#21068)
  web: bump the storybook group across 1 directory with 5 updates (#21031)
  web: bump knip from 5.88.0 to 5.88.1 in /web (#21033)
  web: bump type-fest from 5.4.4 to 5.5.0 in /web (#21032)
  events: prevent exception when events contains incompatible unicode (#21048)
  web/admin: handle non-string values in formatUUID to prevent Event Log crash (#20804)
  events: avoid implicitly setting context from login_failed event (#21045)
  ...
* 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)
  ...
* main:
  web/flow: provide layout url as needed (#20991)
Signed-off-by: Jens Langhammer <[email protected]>

# Conflicts:
#	web/src/flow/FlowExecutor.ts
* .

* .

* .

* .

* .

* .

* 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.
@kensternberg-authentik
kensternberg-authentik requested a review from a team as a code owner March 26, 2026 16:13
@kensternberg-authentik
kensternberg-authentik merged commit 86f1692 into main Mar 30, 2026
200 of 205 checks passed
@kensternberg-authentik
kensternberg-authentik deleted the web/flow/declutter-controllers branch March 30, 2026 22:46
kensternberg-authentik added a commit that referenced this pull request Apr 8, 2026
* main:
  translate: Updates for project authentik and language fr_FR (#21285)
  packages/django-postgres-cache: rework to use ORM (#17771)
  providers/saml: Fix redirect for saml slo (#21258)
  core: fix provider not nullable (#21275)
  website/docs: ad source: add note about ldap signing (#21274)
  website/api: update API clients doc (#21202)
  ci: bump taiki-e/install-action from 2.70.2 to 2.70.3 in /.github/actions/setup (#21267)
  lifecycle/aws: bump aws-cdk from 2.1114.1 to 2.1115.0 in /lifecycle/aws (#21265)
  core, web: update translations (#21264)
  packages/ak-lib: init (#21257)
  website/docs: document group_uuid as a property for group object (#20865)
  web/flow: extract lifecycle events peripheral to stage management into their own controllers (#20898)
  core: bump pygments from 2.19.2 to 2.20.0 (#21260)
  website/docs: add grafana dashboard (#21254)
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