Skip to content

web: Form Modal Independence: Part 1#19395

Merged
GirlBossRush merged 5 commits intomainfrom
modal-independence-part-1
Jan 23, 2026
Merged

web: Form Modal Independence: Part 1#19395
GirlBossRush merged 5 commits intomainfrom
modal-independence-part-1

Conversation

@GirlBossRush
Copy link
Contributor

Details

This PR allows modal-dependent forms to render in other contexts, the first step towards de-modalizing forms. The changes here cover two backwards-compatible refactors:

FormProxy replaced with StrictUnsafe

The FormProxy component allows API-driven components to dynamically render forms with previously registered tag names. For the most part, <ak-form-proxy> performs this task by side-stepping Lit's renderer, using document.createElement to create the form element, synchronously setting its properties, and appending it to the DOM. This approach has a few downsides:

  • Type safety is difficult as properties are set dynamically.
  • Dynamic form elements skip Lit's sanitation and rendering optimizations.
  • Form proxy adds an additional layer of indirection to ModalForm, ModelForm, etc.

StrictUnsafe is a new utility component that uses Lit's unsafeStatic directive to render dynamic tag names, preserving type safety and Lit's optimizations. StrictUnsafe is a more general-purpose utility that can be used in other contexts beyond forms. Ironically, our experiments in JSX-ification use a similar technique to applying properties and attributes in a type-safe manner.

Form decoupled from ModalForm

Previously, ModalForm expected a <span slot="header"> and <span slot="submit"> to determine the modal's title and submit button text, an arrangement that made it difficult to render fully-functional forms outside of modals. With this PR, ModalForm now queries its slotted form element for its heading and submitLabel properties, allowing the form to define these values itself.
ModalForm's ability to use slotted header and submit elements is left intact, allowing for backwards compatibility.

The opposite logic is also implemented. If a form element is rendered outside of an assigned slot, it will render the heading and submit elements itself, allowing it to render itself independently of a modal. This functionality is not yet used, but is available for future use.

What's Next

The next step is refactoring our ModalForm to include screen-reader support for modals. This is feature is tracked in #18916 and depends on this PR.

@GirlBossRush GirlBossRush requested a review from a team as a code owner January 14, 2026 07:11
@GirlBossRush GirlBossRush self-assigned this Jan 14, 2026
@GirlBossRush GirlBossRush added a11y Features or issues related to accessibility area:frontend Features or issues related to the browser, TypeScript, Node.js, etc labels Jan 14, 2026
@GirlBossRush GirlBossRush added this to the Release 2026.2 milestone Jan 14, 2026
@netlify
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 943aa5d
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6972cce8251ced00083f3c9e
😎 Deploy Preview https://deploy-preview-19395--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
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 48bf558
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69725de94886dc000817173e
😎 Deploy Preview https://deploy-preview-19395--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
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 48bf558
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69725de9f12414000930ce83
😎 Deploy Preview https://deploy-preview-19395--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.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (20bd928) to head (943aa5d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19395      +/-   ##
==========================================
+ Coverage   93.26%   93.27%   +0.01%     
==========================================
  Files         949      949              
  Lines       52187    52187              
==========================================
+ Hits        48671    48678       +7     
+ Misses       3516     3509       -7     
Flag Coverage Δ
conformance 38.25% <ø> (+<0.01%) ⬆️
e2e 44.09% <ø> (+<0.01%) ⬆️
integration 23.19% <ø> (+<0.01%) ⬆️
unit 91.51% <ø> (+0.02%) ⬆️
unit-migrate 91.55% <ø> (+0.03%) ⬆️

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.

Copy link
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.

The unsafe folder is full of fun.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in authentik Core Jan 21, 2026
@GirlBossRush GirlBossRush force-pushed the modal-independence-part-1 branch 2 times, most recently from 48bf558 to 475a784 Compare January 22, 2026 18:47
@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 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-943aa5d5b3526f0bf617a97d4355f51ef07efc4e
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-943aa5d5b3526f0bf617a97d4355f51ef07efc4e

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

@GirlBossRush GirlBossRush force-pushed the modal-independence-part-1 branch from 475a784 to 6ab05a6 Compare January 23, 2026 00:53
@GirlBossRush GirlBossRush enabled auto-merge (squash) January 23, 2026 00:55
@GirlBossRush GirlBossRush force-pushed the modal-independence-part-1 branch from 6ab05a6 to 943aa5d Compare January 23, 2026 01:20
@GirlBossRush GirlBossRush merged commit 7b0b787 into main Jan 23, 2026
100 checks passed
@GirlBossRush GirlBossRush deleted the modal-independence-part-1 branch January 23, 2026 01:51
@github-project-automation github-project-automation bot moved this from In Progress to Done in authentik Core Jan 23, 2026
kensternberg-authentik added a commit that referenced this pull request Jan 31, 2026
* main: (115 commits)
  internal: fix incorrect metric calculation (#19701)
  core, web: update translations (#19684)
  core: bump goauthentik.io/api/v3 from 3.2026020.12 to 3.2026020.14 (#19686)
  lifecycle/aws: bump aws-cdk from 2.1101.0 to 2.1102.0 in /lifecycle/aws (#19687)
  core: bump goauthentik/selenium from 143.0-ak-0.35.3 to 144.0-ak-0.35.7 in /tests/e2e (#19688)
  core: bump msgraph-sdk from 1.52.0 to 1.53.0 (#19689)
  core: bump ruff from 0.14.13 to 0.14.14 (#19690)
  core: bump twilio from 9.9.1 to 9.10.0 (#19691)
  core: bump gunicorn from 23.0.0 to 24.0.0 (#19692)
  web: bump the bundler group across 1 directory with 3 updates (#19693)
  web: bump unist-util-visit from 5.0.0 to 5.1.0 in /web (#19694)
  web: bump globals from 17.0.0 to 17.1.0 in /web (#19695)
  ci: bump actions/checkout from 6.0.1 to 6.0.2 (#19696)
  web: Form Modal Independence: Part 1 (#19395)
  web/common: add dev middleware to show warnings for consecutive identical requests (#19671)
  web/admin: fix file upload not preserving extension for custom names with dots (#19548)
  web/admin: fix brand form sending "undefined" string for blank default application (#19658)
  providers/proxy: Fix incorrect comparison of redirect URL and CookieDomain (#15686)
  core: add bulk session revocation (#18564)
  website/docs: endpoint devices: add serial number note (#19677)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Features or issues related to accessibility area:frontend Features or issues related to the browser, TypeScript, Node.js, etc

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants