Skip to content

feat: add JS level system for component preview notices#393

Merged
alexluckett merged 6 commits into
mainfrom
docs/component-previews-clean
May 13, 2026
Merged

feat: add JS level system for component preview notices#393
alexluckett merged 6 commits into
mainfrom
docs/component-previews-clean

Conversation

@alexluckett
Copy link
Copy Markdown
Contributor

Proposed change

Introduces the the concept of a "javascript level" on fixtures to classify the component's dependency on client-side Javascript.

  • Level 1: hard JS requirement, shows a GOV.UK notification banner only
  • Level 2: progressively enhanced, shows a notice + static preview
  • Level 3: no meaningful JS dependency beyond GOV.UK Frontend's basics

This PR visually documents the different levels in the plugin documentation for each component.

Examples

Level 1 (no viable non-JS route)

image

Level 2 (progressive enhancement)

image

Level 3 (standard components)

image

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

Introduces jsLevel (1/2/3) on fixtures to classify JavaScript dependency:
- Level 1: hard JS requirement, shows a GOV.UK notification banner only
- Level 2: progressively enhanced, shows a notice + static preview
- Level 3: no meaningful JS dependency beyond GOV.UK Frontend, static preview only

Adds buildJsNotice helper, wires notices into generateComponentMd, and
documents the jsLevel/jsNotice/previewSuffix fixture properties.
@alexluckett alexluckett enabled auto-merge May 13, 2026 11:18
@sonarqubecloud
Copy link
Copy Markdown

@alexluckett alexluckett merged commit 3ddb572 into main May 13, 2026
23 checks passed
@alexluckett alexluckett deleted the docs/component-previews-clean branch May 13, 2026 13:01
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