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

[Fairground 🎡] Add expanded nav components #11572

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

frederickobrien
Copy link
Contributor

@frederickobrien frederickobrien commented Jun 6, 2024

This adds a new suite of TitlePieceExpandedNav components as part of the ongoing masthead work. After going down the wrong road for a while I've wound up replicating the old Nav components to amend and build on, rather than trying to rebuild the whole thing from scratch.

As part of making these new components (and Storybook stories) I've also created a /masthead directory for the various parts of Fairground's work to go. As a dev new to the repository I found it much easier to work in than a huge, flat approach.

Things not included in this PR but to be implemented in follow-ups:

  • Expanded nav alignment and styling
  • Veggie burger toggle for reactive behaviour and animations
  • Functioning search bar in desktop expanded nav A placeholder search bar with basic styling is included here but implementation will have to wait

Plus bugs we haven't had the pleasure of finding yet.

Screenshots

(There's not much to see here yet as the new components look much the same as the old ones. Updated designs are being implemented in #11691)

image

Copy link

github-actions bot commented Jun 6, 2024

Size Change: 0 B

Total Size: 866 kB

ℹ️ View Unchanged
Filename Size
dotcom-rendering/dist/1094.client.web.********************.js 6 kB
dotcom-rendering/dist/1225.client.web.********************.js 785 B
dotcom-rendering/dist/1299.client.web.********************.js 937 B
dotcom-rendering/dist/1445.client.web.********************.js 18.1 kB
dotcom-rendering/dist/1543.client.web.********************.js 3.28 kB
dotcom-rendering/dist/1692.client.web.********************.js 3.13 kB
dotcom-rendering/dist/1762.client.web.********************.js 3.39 kB
dotcom-rendering/dist/1889.client.web.********************.js 3.63 kB
dotcom-rendering/dist/2170.client.web.********************.js 6.77 kB
dotcom-rendering/dist/2207.client.web.********************.js 2.98 kB
dotcom-rendering/dist/226.client.web.********************.js 3.93 kB
dotcom-rendering/dist/2264.client.web.********************.js 2.66 kB
dotcom-rendering/dist/2342.client.web.********************.js 1.01 kB
dotcom-rendering/dist/2344.client.web.********************.js 3.37 kB
dotcom-rendering/dist/2373.client.web.********************.js 11.5 kB
dotcom-rendering/dist/2471.client.web.********************.js 723 B
dotcom-rendering/dist/2638.client.web.********************.js 3.37 kB
dotcom-rendering/dist/2692.client.web.********************.js 2.9 kB
dotcom-rendering/dist/2778.client.web.********************.js 858 B
dotcom-rendering/dist/2780.client.web.********************.js 6.42 kB
dotcom-rendering/dist/2920.client.web.********************.js 523 B
dotcom-rendering/dist/3000.client.web.********************.js 895 B
dotcom-rendering/dist/3114.client.web.********************.js 663 B
dotcom-rendering/dist/3118.client.web.********************.js 499 B
dotcom-rendering/dist/312.client.web.********************.js 2.93 kB
dotcom-rendering/dist/3255.client.web.********************.js 809 B
dotcom-rendering/dist/3336.client.web.********************.js 785 B
dotcom-rendering/dist/336.client.web.********************.js 13.4 kB
dotcom-rendering/dist/3371.client.web.********************.js 3.28 kB
dotcom-rendering/dist/3431.client.web.********************.js 5.53 kB
dotcom-rendering/dist/3494.client.web.********************.js 834 B
dotcom-rendering/dist/3523.client.web.********************.js 3.35 kB
dotcom-rendering/dist/3642.client.web.********************.js 791 B
dotcom-rendering/dist/3689.client.web.********************.js 4.3 kB
dotcom-rendering/dist/3787.client.web.********************.js 5.49 kB
dotcom-rendering/dist/3922.client.web.********************.js 731 B
dotcom-rendering/dist/393.client.web.********************.js 5.91 kB
dotcom-rendering/dist/3932.client.web.********************.js 790 B
dotcom-rendering/dist/4103.client.web.********************.js 22.6 kB
dotcom-rendering/dist/4129.client.web.********************.js 4.43 kB
dotcom-rendering/dist/424.client.web.********************.js 757 B
dotcom-rendering/dist/4442.client.web.********************.js 833 B
dotcom-rendering/dist/4639.client.web.********************.js 3 kB
dotcom-rendering/dist/4652.client.web.********************.js 3.59 kB
dotcom-rendering/dist/4666.client.web.********************.js 9.24 kB
dotcom-rendering/dist/4673.client.web.********************.js 731 B
dotcom-rendering/dist/4807.client.web.********************.js 4.3 kB
dotcom-rendering/dist/4811.client.web.********************.js 1.01 kB
dotcom-rendering/dist/5044.client.web.********************.js 811 B
dotcom-rendering/dist/5077.client.web.********************.js 441 B
dotcom-rendering/dist/5084.client.web.********************.js 759 B
dotcom-rendering/dist/5127.client.web.********************.js 4.39 kB
dotcom-rendering/dist/5247.client.web.********************.js 2.86 kB
dotcom-rendering/dist/5308.client.web.********************.js 2.69 kB
dotcom-rendering/dist/5353.client.web.********************.js 11.8 kB
dotcom-rendering/dist/5536.client.web.********************.js 3.89 kB
dotcom-rendering/dist/565.client.web.********************.js 675 B
dotcom-rendering/dist/5750.client.web.********************.js 3.21 kB
dotcom-rendering/dist/5817.client.web.********************.js 922 B
dotcom-rendering/dist/6002.client.web.********************.js 3.09 kB
dotcom-rendering/dist/606.client.web.********************.js 3.53 kB
dotcom-rendering/dist/6093.client.web.********************.js 758 B
dotcom-rendering/dist/6167.client.web.********************.js 646 B
dotcom-rendering/dist/6351.client.web.********************.js 5.38 kB
dotcom-rendering/dist/662.client.web.********************.js 2.67 kB
dotcom-rendering/dist/6640.client.web.********************.js 913 B
dotcom-rendering/dist/6793.client.web.********************.js 5.71 kB
dotcom-rendering/dist/6843.client.web.********************.js 7.29 kB
dotcom-rendering/dist/6908.client.web.********************.js 3.48 kB
dotcom-rendering/dist/6921.client.web.********************.js 2.99 kB
dotcom-rendering/dist/7062.client.web.********************.js 2.29 kB
dotcom-rendering/dist/7116.client.web.********************.js 23 kB
dotcom-rendering/dist/7196.client.web.********************.js 895 B
dotcom-rendering/dist/72.client.web.********************.js 966 B
dotcom-rendering/dist/7208.client.web.********************.js 2.41 kB
dotcom-rendering/dist/7265.client.web.********************.js 3.21 kB
dotcom-rendering/dist/7387.client.web.********************.js 961 B
dotcom-rendering/dist/7544.client.web.********************.js 3.07 kB
dotcom-rendering/dist/7660.client.web.********************.js 3.67 kB
dotcom-rendering/dist/7697.client.web.********************.js 620 B
dotcom-rendering/dist/7723.client.web.********************.js 925 B
dotcom-rendering/dist/8134.client.web.********************.js 601 B
dotcom-rendering/dist/8179.client.web.********************.js 834 B
dotcom-rendering/dist/8279.client.web.********************.js 43.1 kB
dotcom-rendering/dist/8363.client.web.********************.js 3.67 kB
dotcom-rendering/dist/8463.client.web.********************.js 156 B
dotcom-rendering/dist/8565.client.web.********************.js 653 B
dotcom-rendering/dist/8569.client.web.********************.js 3.58 kB
dotcom-rendering/dist/8791.client.web.********************.js 1.01 kB
dotcom-rendering/dist/8839.client.web.********************.js 3.37 kB
dotcom-rendering/dist/889.client.web.********************.js 860 B
dotcom-rendering/dist/8907.client.web.********************.js 792 B
dotcom-rendering/dist/9060.client.web.********************.js 886 B
dotcom-rendering/dist/9225.client.web.********************.js 583 B
dotcom-rendering/dist/9247.client.web.********************.js 3.83 kB
dotcom-rendering/dist/9287.client.web.********************.js 2.42 kB
dotcom-rendering/dist/9396.client.web.********************.js 691 B
dotcom-rendering/dist/9430.client.web.********************.js 510 B
dotcom-rendering/dist/9447.client.web.********************.js 3.06 kB
dotcom-rendering/dist/9604.client.web.********************.js 528 B
dotcom-rendering/dist/9789.client.web.********************.js 924 B
dotcom-rendering/dist/9826.client.web.********************.js 3.42 kB
dotcom-rendering/dist/9936.client.web.********************.js 1.84 kB
dotcom-rendering/dist/Accessibility-importable.client.web.********************.js 5.79 kB
dotcom-rendering/dist/AdBlockAsk-importable.client.web.********************.js 2.85 kB
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 3.84 kB
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 425 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 3.54 kB
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 3.64 kB
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 3.03 kB
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.47 kB
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 3.58 kB
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 2.57 kB
dotcom-rendering/dist/Branding-importable.client.web.********************.js 3.08 kB
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 37.2 kB
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 1.9 kB
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.73 kB
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.75 kB
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 4.91 kB
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 1.17 kB
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 6.63 kB
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 539 B
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 3.26 kB
dotcom-rendering/dist/DiscussionApps-importable.client.web.********************.js 1.81 kB
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 3.08 kB
dotcom-rendering/dist/DiscussionWeb-importable.client.web.********************.js 1.67 kB
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 3.55 kB
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 4.1 kB
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.02 kB
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 3.4 kB
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 5.21 kB
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 622 B
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 837 B
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 346 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.7 kB
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 4.53 kB
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 11.5 kB
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 7.88 kB
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.64 kB
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 16.7 kB
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 11.2 kB
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 3.02 kB
dotcom-rendering/dist/HeaderTopBar-importable.client.web.********************.js 7.07 kB
dotcom-rendering/dist/index.client.web.********************.js 45.9 kB
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 3.64 kB
dotcom-rendering/dist/InteractiveAtomMessenger-importable.client.web.********************.js 851 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 6.3 kB
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 4.68 kB
dotcom-rendering/dist/InteractiveSupportButton-importable.client.web.********************.js 3.47 kB
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 4.9 kB
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.5 kB
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 4.85 kB
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 435 B
dotcom-rendering/dist/LightboxLayout-importable.client.web.********************.js 6.46 kB
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.7 kB
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.97 kB
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 7.77 kB
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 5.76 kB
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.96 kB
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 5.94 kB
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 8.52 kB
dotcom-rendering/dist/MostViewedRightWithAd-importable.client.web.********************.js 5.14 kB
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 6.62 kB
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.63 kB
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 2.8 kB
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 3.04 kB
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 749 B
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 2.8 kB
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 469 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 1.92 kB
dotcom-rendering/dist/ReaderRevenueLinks-importable.client.web.********************.js 6.37 kB
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 2.47 kB
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 4.8 kB
dotcom-rendering/dist/SecureSignup-importable.client.web.********************.js 4.17 kB
dotcom-rendering/dist/SendAMessage-importable.client.web.********************.js 4.42 kB
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.15 kB
dotcom-rendering/dist/sentry.client.web.********************.js 764 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.81 kB
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 484 B
dotcom-rendering/dist/ShareButton-importable.client.web.********************.js 1.53 kB
dotcom-rendering/dist/shimport.client.web.********************.js 2.8 kB
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 713 B
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 4.04 kB
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 3.9 kB
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 3.93 kB
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 5.78 kB
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 4.15 kB
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 5.61 kB
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 6.02 kB
dotcom-rendering/dist/StickyLiveblogAskWrapper-importable.client.web.********************.js 9.31 kB
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 3.37 kB
dotcom-rendering/dist/SupportTheG-importable.client.web.********************.js 6.49 kB
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 3.2 kB
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 3.23 kB
dotcom-rendering/dist/TopBar-importable.client.web.********************.js 5.03 kB
dotcom-rendering/dist/TopBarSupport-importable.client.web.********************.js 2.76 kB
dotcom-rendering/dist/TweetBlockComponent-importable.client.web.********************.js 1.02 kB
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.client.web.********************.js 3.65 kB
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 5.77 kB
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 3.49 kB
dotcom-rendering/dist/WeatherWrapper-importable.client.web.********************.js 5.51 kB
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.3 kB

compressed-size-action

@frederickobrien frederickobrien changed the title [Fairground 🎡] Expanded nav and veggie burger for titlepiece [Fairground 🎡] Add expanded nav components Jun 19, 2024
@frederickobrien frederickobrien force-pushed the fairground/veggie-burger branch 4 times, most recently from 79f16ba to c58aa33 Compare June 20, 2024 09:15
@frederickobrien frederickobrien marked this pull request as ready for review June 20, 2024 09:22
@frederickobrien frederickobrien requested a review from a team as a code owner June 20, 2024 09:22
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@cemms1 cemms1 requested review from cemms1 and removed request for a team June 28, 2024 08:39
@cemms1 cemms1 changed the base branch from main to fairground/titlepiece-use-nav-object June 28, 2024 08:45
@cemms1 cemms1 requested review from a team as code owners June 28, 2024 08:45
@cemms1 cemms1 force-pushed the fairground/titlepiece-use-nav-object branch from 8fd783b to 095a8a4 Compare June 28, 2024 08:46
Comment on lines +15 to +42
// const wrapperMainMenuStyles = css`
// background-color: rgba(0, 0, 0, 0.5);
// ${getZIndex('expanded-veggie-menu-wrapper')}
// left: 0;
// top: 0;
// /*
// IMPORTANT NOTE:
// we need to specify the adjacent path to the a (current) tag
// to apply styles to the nested tabs due to the fact we use ~
// to support NoJS
// */
// /* stylelint-disable-next-line selector-type-no-unknown */
// ${`#${navInputCheckboxId}`}:checked ~ div & {
// ${from.desktop} {
// display: block;
// overflow: visible;
// }
// }

// /* refer to comment above */
// /* stylelint-disable */
// ${`#${navInputCheckboxId}`}:checked ~ div & {
// ${until.desktop} {
// transform: translateX(
// 0%
// ); /* when translateX is set to 0% it reapears on the screen */
// }
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick/one for next time: it makes it slightly easier to review if unused code/commented out code is removed from the PR changes 👍

Comment on lines +116 to +120
{/* <div
id="expanded-menu"
data-testid="expanded-menu"
css={wrapperMainMenuStyles}
> */}
Copy link
Contributor

Choose a reason for hiding this comment

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

One for next time - If leaving code commented out when putting up for review, it's helpful to leave another comment to say why it's there

Comment on lines 42 to 47
/**
* Typography preset styles should not be overridden.
* This has been done because the styles do not directly map to the new presets.
* Please speak to your team's designer and update this to use a more appropriate preset.
*/
line-height: 1.15;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: need to fix this

pillarUnderline,
isSelected && forceUnderline,
]}
style={{ '--pillar-underline': pillarColour }}
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to name all of these components with such long names now that they are within the ExpandedNav directory. We could call this file and component simply CollapseSectionButton for example

Copy link
Contributor

Choose a reason for hiding this comment

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

With that in mind, are any of these different to the original implementation? I'm wondering if we actually need this duplication here. Could we just import the originals?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed with 803f79e. Re: could we just import the originals, I don't think so. The differences play out more clearly in the follow up (#11691). Having a completely separate set for the new-look masthead ought to allow for smoother implementation, then hopefully we can just remove the old bunch when the time comes

Copy link
Contributor

@cemms1 cemms1 left a comment

Choose a reason for hiding this comment

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

Great work in persevering through this! I've left a few comments but don't think anything is major. The main point here is that it would be great to make sure the PRs are as small as possible 😅 - this one was a little too long, even for someone with relevant context.

Happy to merge so long as we're sure there's nothing linked up to PROD code and it's all sitting behind a switch / in components not actually used by layouts yet.

@cemms1 cemms1 force-pushed the fairground/titlepiece-use-nav-object branch from 095a8a4 to b7f5a8c Compare July 2, 2024 14:26
Base automatically changed from fairground/titlepiece-use-nav-object to main July 2, 2024 15:42
An error occurred while trying to automatically change base from fairground/titlepiece-use-nav-object to main July 2, 2024 15:42
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 2, 2024
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 2, 2024
@frederickobrien frederickobrien merged commit e0e5a2a into main Jul 2, 2024
34 checks passed
@frederickobrien frederickobrien deleted the fairground/veggie-burger branch July 2, 2024 16:24
@prout-bot
Copy link

Seen on PROD (merged by @frederickobrien 9 minutes and 49 seconds ago) Please check your changes!

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

Successfully merging this pull request may close these issues.

None yet

3 participants