fix(ui): apply PageHeader logo size constraints to nested elements#1762
Merged
Conversation
The logo container used the direct-child variant (jn:*:), so size constraints did not apply when consumers passed a wrapped logo (e.g. an anchor containing an SVG). Switch to the universal-descendant variant (jn:**:) so the constraints reach the actual logo element regardless of nesting depth, ensuring it fits the fixed-height header. Signed-off-by: Esther Schmitz <esther.schmitz@sap.com>
🦋 Changeset detectedLatest commit: b2718d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PageHeader logo sizing when consumers pass a wrapped logo (e.g. <a><svg/></a>), by switching the logo container constraints from applying only to direct children to applying to all descendants, and documents the behavior via Storybook.
Changes:
- Update
PageHeaderlogo container Tailwind selectors fromjn:*:tojn:**:so constraints reach nested logo elements. - Add a
WithWrappedLogoStorybook story showcasing a logo wrapped in a link. - Add a changeset for a patch release of
@cloudoperators/juno-ui-components.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/ui-components/src/components/PageHeader/PageHeader.component.tsx | Apply logo sizing constraints to all descendants so wrapped logos are constrained correctly. |
| packages/ui-components/src/components/PageHeader/PageHeader.stories.tsx | Add a Storybook story demonstrating/validating wrapped logo behavior. |
| .changeset/fix-pageheader-wrapped-logo.md | Record patch release note for the wrapped-logo sizing fix. |
Contributor
|
…ader logo Address review feedback: - Add aria-label to the wrapped-logo story's anchor so it has an accessible name (previously the link had only an SVG with empty alt). - Add a Vitest test that renders a wrapped logo and asserts the descendant size constraints (jn:**:) are applied to the logo container, guarding against regressions of the selector variant. Signed-off-by: Esther Schmitz <esther.schmitz@sap.com>
ArtieReus
approved these changes
Jun 16, 2026
taymoor89
approved these changes
Jun 16, 2026
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.
Summary
PageHeader's logo container from the direct-child variant (jn:*:) to the universal-descendant variant (jn:**:), so size constraints reach the actual logo element regardless of nesting depth (e.g. a logo SVG wrapped in an anchor).WithWrappedLogoStorybook story documenting and verifying the behavior with a logo nested inside a link.Closes #1761
Test plan
Layout/PageHeader→WithWrappedLogo, verify the wrapped logo respects the header's fixed heightPageHeaderstories still render unchangedpnpm --filter @cloudoperators/juno-ui-components testpassespnpm lintandpnpm typecheckpass