Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 1126 build status design #1154

Merged
merged 40 commits into from
Feb 24, 2025
Merged

Conversation

ehtabrizi
Copy link
Contributor

@ehtabrizi ehtabrizi commented Feb 10, 2025

Issue or RFC endorsed by the maintainers

Build tier design
#1126

Description of the change

FrontMatter paramaters:

status: "Archived" | Experimental" | "To be reviewed" | "Official"
statusMessage: "For example (Created: Feb 2025)"

Alternative designs

No alternative designs

Possible drawbacks

None suggested

Verification process

Tested via chrome, Safari & responsive view

Release notes

Added new tier macro to follow design

@ehtabrizi ehtabrizi requested a review from a team as a code owner February 10, 2025 10:59
Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

position: relative;
}
p {
@include govuk-font($size: 16, $line-height: 20px);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using govuk-font() will already output the media queries for you

Probably meant to use govuk-font-size() here?

But watch out, scale point 14 is deprecated:
https://design-system.service.gov.uk/get-started/new-type-scale/

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

@ehtabrizi ehtabrizi changed the title 1126 build tier design with variables feat: 1126 build tier design with variables Feb 13, 2025
Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Comment on lines 7 to 11
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %}
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}">
{{ title }}
</h1>

{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker for release, but could this be a pageTitle partial/macro? As its repeated several times

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Chris, noted for later iteration.

@@ -1,12 +1,14 @@
{% extends "./base.njk" %}

{% block content %}
{% import "./macros/status.njk" as macros %}
Copy link
Contributor

Choose a reason for hiding this comment

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

As there's only one macro in the file, would this be better as:

{% from "./macros/status.njk" import statusLabel %}

{% from "govuk/components/details/macro.njk" import govukDetails %}


{% macro statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth a little bit of inline documentation of these args?

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj


Learn how you can [help develop design system building blocks](/get-involved/suggest-a-change/).

## ‘Experimental’ status (for all community components) <span class="govuk-tag govuk-tag--blue" style="vertical-align:middle;" aria-hidden="true">Experimental</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a blocker, but shall we set a task to review this HTML?

We can probably extend Markdown to render the tag via the Nunjucks macro:

{{ govukTag({
  text: "completed",
  classes: "govuk-tag--blue",
  attributes: { style: "vertical-align: middle" }
}) }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Colin, noted for later iteration.

"Archived": "govuk-tag--grey"
}[status] or "" %}

<span class="govuk-tag status-tag {{ statusClass }}">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to trim the empty spaces off when statusClass isn't set?

Or follow the coding standards and use .app-status or .moj-status for our extended styles?

Suggested change
<span class="govuk-tag status-tag {{ statusClass }}">
<span class="govuk-tag app-tag--status{%- if statusClass %} {{ statusClass }}{% endif %}">

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Comment on lines 24 to 40
<span class="govuk-tag app-status-tag{%- if statusClass %} {{ statusClass }}{% endif %}">
<span class="govuk-visually-hidden">Status:</span> {{ status }}
</span>

{% if status == 'Experimental' or statusDate %}
<p class="app-status-message govuk-!-margin-bottom-2">
{{ statusData.statusMessage }}{% if status == 'Experimental' %} by{%- if creatorName and creatorTeam %}
{{ creatorName }} in {{ creatorTeam }}
{%- elif creatorName %}
{{ creatorName }}
{%- elif creatorTeam %}
someone in {{ creatorTeam }}
{%- else %}
someone in the community
{%- endif %}{% if statusDate %} in {{ statusDate }}{% endif %}.{% else %} in {{ statusDate }}.{% endif %}
</p>
{% endif %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about simplifying the logic here?

I've split out statusHtml and statusAttribution and used govukTag() via the macro:

{% from "govuk/components/tag/macro.njk" import govukTag %}
Suggested change
<span class="govuk-tag app-status-tag{%- if statusClass %} {{ statusClass }}{% endif %}">
<span class="govuk-visually-hidden">Status:</span> {{ status }}
</span>
{% if status == 'Experimental' or statusDate %}
<p class="app-status-message govuk-!-margin-bottom-2">
{{ statusData.statusMessage }}{% if status == 'Experimental' %} by{%- if creatorName and creatorTeam %}
{{ creatorName }} in {{ creatorTeam }}
{%- elif creatorName %}
{{ creatorName }}
{%- elif creatorTeam %}
someone in {{ creatorTeam }}
{%- else %}
someone in the community
{%- endif %}{% if statusDate %} in {{ statusDate }}{% endif %}.{% else %} in {{ statusDate }}.{% endif %}
</p>
{% endif %}
{% set statusHtml -%}
<span class="govuk-visually-hidden">Status:</span> {{ status }}
{%- endset %}
{% set statusAttribution -%}
{%- if status == "Experimental" %}
by {{ creatorName | default("someone") }} in {{ creatorTeam | default("the community") }}
{%- endif %}
{%- if statusDate %}
in {{ statusDate }}
{% endif %}.
{%- endset %}
{{ govukTag({
html: statusHtml,
classes: "govuk-!-font-weight-regular app-status-tag" ~ statusClass
}) }}
<p class="app-status-message govuk-!-margin-bottom-2">
{{ statusData.statusMessage }} {{ statusAttribution }}
</p>

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've added govuk-!-font-weight-regular to fix the bold weight coming from .app-prose

But might be better moving this into app-status-tag to fix it everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Colin, noted for later iteration.

Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

@ehtabrizi ehtabrizi changed the title feat: 1126 build status design docs: 1126 build status design Feb 21, 2025
Copy link

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-1126-build-tier-design-with-variables.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

@ehtabrizi ehtabrizi merged commit db90007 into main Feb 24, 2025
22 checks passed
@ehtabrizi ehtabrizi deleted the 1126-build-tier-design-with-variables branch February 24, 2025 09:02
@gregtyler
Copy link
Contributor

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants