Skip to content

Show mini nav - #17075

Open
OlwenPearce wants to merge 27 commits into
mainfrom
show-mini-nav
Open

OlwenPearce wants to merge 27 commits into
mainfrom
show-mini-nav

Conversation

@OlwenPearce

@OlwenPearce OlwenPearce commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this change?

Renders a mini nav on a card, when provided and supported

This includes some general tweaks to support it:

  • make header padding configurable, in order to reduce it when there is a mini nav
  • make the whole menu scroll, and remove the scroll line, when a mini nav. (Note, we will likely roll this out to other navs later)

Why?

New feature

How has this change been tested?

Tests

Automated tests

Unit and Storybook tests added

Manual testing

I tested local running with local frontend and fonts tool. Steps were

  1. Update the client lib in all repos
  2. Edit a front in local facia-client to add the mini nav
  3. Generate the pressed file in frontend via the debug endpoint
  4. Upload it to the s3 bucket
  5. Run frontend and DCR locally
  6. View at http://localhost:3030/Front/http:localhost:9000/olwen

-->

Screenshots

Here it is deploying on a local run

image

I have indented it slightly to fix the below tab issue, and visually separate it from the title
US Midterms Key races mapped Live The Stakes

I've justified this by it being slightly indented on fimga, but this may not be intentional
image

In general I have made padding consisent with figma (to my eyes)
US politics Trump administration US Congress U
Russia Ukraine war Live updates Video Exp

It's worth looking on storybook because this does look different with different styles - e.g. the apperence here, which is overall fine but the section looks much smaller with the image underneath and no title
Trump administration US Congress US supreme court US elections 2024 US immigration

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🚀 Image pushed to AWS ECR

Image digest: sha256:c4f0a2b45267523592079170773588d96cc5764064f7f61e36543d74114d3a01

🐛 Run the image locally

The following can be used to run the image locally:

# Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:c4f0a2b45267523592079170773588d96cc5764064f7f61e36543d74114d3a01"

# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-show-mini-nav"

# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-33948"

# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"

IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/artifacts --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering/dotcom-rendering${IMAGE_IDENTIFIER}"

# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY

# Pull the image
docker pull $IMAGE

# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE

From guardian/actions-ecr.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

@OlwenPearce OlwenPearce added run_chromatic Runs chromatic when label is applied feature Departmental tracking: work on a new feature labels Oct 29, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
Instead of section colour
@OlwenPearce OlwenPearce added the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@OlwenPearce OlwenPearce added the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@OlwenPearce OlwenPearce added the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Oct 29, 2026
@OlwenPearce
OlwenPearce marked this pull request as ready for review November 6, 2026 09:11
@OlwenPearce OlwenPearce added the run_chromatic Runs chromatic when label is applied label Nov 6, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Nov 6, 2026
@OlwenPearce OlwenPearce added the run_chromatic Runs chromatic when label is applied label Nov 9, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Nov 9, 2026
Comment on lines +65 to +69
.video-container:not(
${isLoopAndInLoopClickTestVariant
? `.cinemagraph, .loop`
: `.cinemagraph`}
):hover,

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.

is the loop / cinemagraph hover behaviour part of this PR

customSubNav: CustomSubnav;
renderingPage: RenderingPage;
pageId: string;
pageId?: string;

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.

is there a reason this is now optional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The pageId is used on the subnav to bold the page the subnav is currently on. This doesn't make sense in the context of a card - the card doesn't have a page Id to pass in when calling this, and we don't need to display it either

* article min-height, otherwise the outer row remains taller than the
* inline list itself.
*/
min-height: 0;

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.

Would removing this min-height altogether work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did try to do it without this - the 0 here is an override of the article settings. Without it, my attempts to reduce the padding did nothing because it was inheriting the shared article minimum height and refusing to go below it. This is very much "I found a way to make it work" though - suggestions for other approaches are welcome

Comment on lines +105 to +108
const articleHeaderGapStyles = css`
margin-left: ${space[1]}px;
padding-left: ${space[1]}px;
`;

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.

How come we're using a mix of margin and padding?

Comment on lines +308 to +309
padding-left: 1px;
margin-left: 1px;

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.

should these be space values?

Comment on lines +73 to +89
<div
className="mini-nav"
css={css`
position: relative;
z-index: ${getZIndex('card-nested-link')};
min-width: 0;
--custom-subnav-header-text: ${palette(
trail.miniNavData.header.dotcomPath
? '--card-kicker-text'
: '--card-headline',
)};
--masthead-nav-link-text: ${palette('--card-headline')};
--masthead-nav-link-text-hover: ${palette(
'--card-headline',
)};
`}
>

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.

I wonder if this could be its own component MiniNav? Unsure how it relates to CustomSubNav – is it just a wrapper element?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants