Skip to content

web/elements: extract mermaid runtime, modernize <ak-diagram> - #22980

Merged
GirlBossRush merged 5 commits into
mainfrom
web/extract-mermaid-runtime
Jun 11, 2026
Merged

GirlBossRush merged 5 commits into
mainfrom
web/extract-mermaid-runtime

Conversation

@GirlBossRush

Copy link
Copy Markdown
Contributor

Splits the first commit of #21949 into its own PR per @kensternberg-authentik's review. Same commit, rebased onto current main, with the two FlowDiagram follow-ups from the inline comments applied. #21949 gets rebased on top once this lands.

What this changes

  • Mermaid configuration moves from Diagram into a new #common/mermaid module. loadMermaid(uiTheme) lazy-loads the library on first call and reinitialises it when the active UI theme changes, so the whole app shares one mermaid instance instead of each <ak-diagram> constructor calling mermaid.initialize for itself.
  • <ak-diagram> switches to @listen(AKRefreshEvent, { target: window }) for its sync hook and renders through guard([diagram, activeTheme], () => until(this.renderMermaid(), loadingPlaceholder)). Inline styles move out to Diagram.css, and the SVG host selector is renamed from mermaid-svg- to diagram to match the new mermaid render id.
  • FlowDiagram and OAuthSourceDiagram adopt the renamed syncDiagramContent hook from the parent.

Review feedback addressed

Two inline comments on FlowDiagram.ts from the #21949 review:

  • The requestUpdate()-inside-a-guarded-method dance is replaced with pfe-core's @observes("flowSlug"). The decorator wires up a PropertyObserverController that fires the callback during hostUpdate, ahead of shouldUpdate, so setting flowSlug schedules the API fetch without any manual update plumbing.
  • API client construction switches from new FlowsApi(DEFAULT_CONFIG) to the aki(FlowsApi) helper that landed on main after web: MDX without React #21949 was cut.

Test plan

  • npm run lint-check: clean.
  • npm run lint:types: only error is OAuthSourceViewPage.ts(34,63), which is also present on plain upstream/main and unrelated to this change.
  • npm run build: production bundle builds cleanly.
  • No diagram-specific unit tests exist in the tree. The mermaid e2e coverage in web/test/browser/ak-mdx.test.ts belongs to the MDX commits of web: MDX without React #21949 and is deliberately not part of this PR.

Disclosure

Triaged and authored end-to-end by an agent running in a sandbox against goauthentik/authentik@main. Reviewed and shipped by @GirlBossRush.

@GirlBossRush
GirlBossRush requested a review from a team as a code owner June 10, 2026 19:01
@netlify

netlify Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit e7a9862
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a2a2c1fea66d00009c7f72f
😎 Deploy Preview https://deploy-preview-22980--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 Jun 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 312243f
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a2a2116cac20700070ff18c
😎 Deploy Preview https://deploy-preview-22980--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

codecov Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #22980   +/-   ##
=======================================
  Coverage   93.25%   93.25%           
=======================================
  Files        1032     1032           
  Lines       60164    60164           
  Branches      400      400           
=======================================
  Hits        56105    56105           
  Misses       4059     4059           
Flag Coverage Δ
conformance 36.53% <ø> (+<0.01%) ⬆️
e2e 41.79% <ø> (+<0.01%) ⬆️
integration 32.97% <ø> (+<0.01%) ⬆️
rust 0.00% <ø> (ø)
unit 92.20% <ø> (ø)
unit-migrate 92.22% <ø> (-0.01%) ⬇️

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

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

@github-actions

github-actions Bot commented Jun 10, 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-e7a98622bf6327a7bb4f07eaa0b0c97ecf8dbb65
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-e7a98622bf6327a7bb4f07eaa0b0c97ecf8dbb65

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

refreshHandler = (): void => {
this.diagram = undefined;
@observes("flowSlug")
protected refresh(): void {

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.

Pretty! :-)

@GirlBossRush
GirlBossRush force-pushed the web/extract-mermaid-runtime branch from ad9c5ac to ef0dc5b Compare June 10, 2026 19:56
@GirlBossRush
GirlBossRush force-pushed the web/extract-mermaid-runtime branch from 0c76d6e to 312243f Compare June 11, 2026 02:44
@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 0c76d6e
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a2a20f3883006000920a02a
😎 Deploy Preview https://deploy-preview-22980--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 Jun 11, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit e7a9862
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a2a2c1f6641fb00086a726e
😎 Deploy Preview https://deploy-preview-22980--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
GirlBossRush enabled auto-merge (squash) June 11, 2026 03:34
@GirlBossRush
GirlBossRush merged commit 269a897 into main Jun 11, 2026
109 checks passed
@GirlBossRush
GirlBossRush deleted the web/extract-mermaid-runtime branch June 11, 2026 04:10
kensternberg-authentik added a commit that referenced this pull request Jun 12, 2026
* main: (68 commits)
  root: bump pyo3 (#23036)
  websites/integrations: specify redirect uri of type authorization or post logout (#22981)
  website/integrations: Update nextcloud to support post logout redirect uri (#22989)
  stages/captcha: add Cap and JSON verification support (#22373)
  web: bump @goauthentik/tsconfig from 1.0.9 to 2.0.0 in /web/packages/core in the goauthentik group across 1 directory (#22996)
  website/integrations: add kavita (#23000)
  website/integrations: add post logout to audiobookshelf (#22999)
  website/docs: additional scim provider docs (#22135)
  translate: Updates for project authentik and language fr_FR (#22986)
  translate: Updates for project authentik and language hu_HU (#22987)
  translate: Updates for project authentik and language no_NO (#22988)
  lifecycle/aws: bump aws-cdk from 2.1125.0 to 2.1126.0 in /lifecycle/aws (#22990)
  core: bump astral-sh/uv from 0.11.19 to 0.11.20 in /lifecycle/container (#22991)
  core: bump goauthentik/fips-python from `ede0a00` to `94d8805` in /lifecycle/container (#22992)
  core: bump uvicorn[standard] from 0.48.0 to 0.49.0 (#22993)
  core: bump which from 8.0.2 to 8.0.3 (#22994)
  ci: bump taiki-e/install-action from 2.81.7 to 2.81.8 in /.github/actions/setup (#22995)
  web/elements: extract mermaid runtime, modernize `<ak-diagram>` (#22980)
  core, web: update translations (#22983)
  website/integrations: dokuwiki: add post logout and logout urls (#22984)
  ...
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