Skip to content

Add documentation inset links#273

Open
FilisLiu wants to merge 9 commits into
mainfrom
feature/rejig-previews
Open

Add documentation inset links#273
FilisLiu wants to merge 9 commits into
mainfrom
feature/rejig-previews

Conversation

@FilisLiu
Copy link
Copy Markdown
Contributor

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)

image

Anything Else?

No

@FilisLiu FilisLiu changed the title Feature/rejig previews Add documentation inset links May 19, 2026
@FilisLiu FilisLiu requested a review from timgentry May 19, 2026 09:17
Comment thread test/dummy/app/helpers/application_helper.rb Outdated
Comment thread test/dummy/app/helpers/application_helper.rb Outdated
@FilisLiu FilisLiu requested a review from timgentry May 19, 2026 11:13
Copy link
Copy Markdown
Contributor

@timgentry timgentry left a comment

Choose a reason for hiding this comment

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

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.

@FilisLiu FilisLiu requested a review from timgentry May 19, 2026 13:36
# 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)
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.

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?)?

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