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

chore(1-3450): Place strategy names and titles on the same line (and fix list nesting issues) #9443

Merged
merged 14 commits into from
Mar 7, 2025

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Mar 7, 2025

Moves strategy titles and names onto the same line, as per the new designs.

In doing so, I've also updated the component to use a more semantic hgroup with the header being the strategy title if it exists or the strategy name if not.

The downside of being more semantically correct here is that we need to know what header level we want the strategy to use. In most cases, that's 3 (e.g. flag name > environment > strategy, release plan > milestone > strategy), but for plans on flag envs, it's 4 (flag name > env > milestone name > strategy).

I've also taken the opportunity to fix a little mistake I made earlier. ols can only have li children, and I'd forgotten to wrap a nested ol inside an li. The changes in EnvironmentAccordionBody all relate to that change. Because we now have several layers of lists nested within each other, dealing with styling and padding gets a little tricky, but CSS has the power do help us out here.

Rendered:
image

Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:21am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 7, 2025 11:21am

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@thomasheartman thomasheartman changed the title Chore(1 3449)/release plans in strategy env chore(1-3450): Place strategy names and titles on the same line Mar 7, 2025
const StyledHeaderContainer = styled('hgroup')(({ theme }) => ({
display: 'flex',
flexFlow: 'row',
columnGap: '1ch',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Approximates one space.

Comment on lines +255 to +258
<li>
{releasePlans.length > 0 ? (
<StrategySeparator />
) : null}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nest nested lists within list items and add the separator between release plans and strategies to this element instead of the first strategy.

Emetion complains that:
> The pseudo class :first-child is potentially unsafe when doing server-side rendering. Try changing it to :first-of-type.

First of type won't work, so use classes instead.
@thomasheartman thomasheartman marked this pull request as ready for review March 7, 2025 11:17
@thomasheartman thomasheartman changed the title chore(1-3450): Place strategy names and titles on the same line chore(1-3450): Place strategy names and titles on the same line (and fix list nesting issues) Mar 7, 2025
Comment on lines +44 to +56
'& > li': {
paddingBlock: theme.spacing(2.5),
position: 'relative',
},
'&:not(li > &) > li:first-of-type': {
// select first list elements in lists that are not directly nested
// within other lists.
paddingTop: theme.spacing(1),
},
'& > li:has(> ol)': {
// nested lists add their own padding to their list items, so we don't want to double it up.
paddingBlock: 0,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yay, CSS selectors 🥳 I moved all the li spacing and positioning up here so that it's colocated.

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LG!

@thomasheartman thomasheartman merged commit 2205500 into main Mar 7, 2025
14 of 15 checks passed
@thomasheartman thomasheartman deleted the chore(1-3449)/release-plans-in-strategy-env branch March 7, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants