Add documentation inset links#273
Open
FilisLiu wants to merge 9 commits into
Open
Conversation
timgentry
requested changes
May 19, 2026
timgentry
requested changes
May 19, 2026
Contributor
timgentry
left a comment
There was a problem hiding this comment.
Can't we just extend component_preview, so that if there is a brand specific reference URL in the locale, then it will add the component_reference. That would do away with if statements and make it have more automagical.
timgentry
requested changes
May 19, 2026
| # Helpers for the dummy app: component preview (ERB + rendered output). | ||
| module ApplicationHelper | ||
| def component_preview(heading: nil, level: 3, html: nil, component: nil, id: nil, &block) | ||
| def component_preview(heading: nil, level: 3, html: nil, component: nil, id: nil, reference_key: nil, &block) |
Contributor
There was a problem hiding this comment.
The signature is getting bloated and I'm surprised rubocop hasn't complained. Do we need a provide a canonical name, which the translations could use for the heading, reference key (and id?)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds a documentation inset link on dummy-app component and style preview pages, pointing to the NHS Service Manual or GOV.UK Design System for the active brand. Restores extra button preview examples.
Why?
Makes it easy to jump from our previews to official guidance. Link text is descriptive per brand; paths differ where the manuals do (e.g. buttons vs button).
How?
New component_reference helper in ApplicationHelper (inset + link, brand-specific base URL). Most pages call it once; divergent slugs use a small case brand in the view. Dummy app only — no gem API changes.
Testing?
Manually check a few component and style pages under NHS and GOV.UK brands; confirm link text and URLs. No new automated tests.
Screenshots (optional)
Anything Else?
No