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

[MWPW-158932] - Add support for custom links through link group in parallel to large menu. #2942

Merged
merged 9 commits into from
Sep 26, 2024

Conversation

Deva309
Copy link
Contributor

@Deva309 Deva309 commented Sep 24, 2024

Adding support for adding custom links through Link Group already a existing block used in GNAV and these custom links will be shown as per the config pass through standalone GNAV. These links are in parallel to the large-menu so authoring would be same like how we author large menus.
Here is the screenshot how Link Group used in GNAV:
Screenshot 2024-09-23 at 8 53 40 PM
Example: GNAV docx

Github Discussion for more details: https://github.com/orgs/adobecom/discussions/2901

Resolves: MWPW-158932
Issues:
MWPW-159018

Test URLs:

QA
https://adobecom.github.io/nav-consumer/navigation.html?env=stage&navbranch=mwpw-158932&authoringpath=/federal/dev/devashish&customlinks=home

Copy link
Contributor

aem-code-sync bot commented Sep 24, 2024

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.97%. Comparing base (5d8d656) to head (fb117a0).
Report is 7 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2942      +/-   ##
==========================================
- Coverage   96.30%   95.97%   -0.34%     
==========================================
  Files         242      175      -67     
  Lines       54873    46888    -7985     
==========================================
- Hits        52845    45000    -7845     
+ Misses       2028     1888     -140     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Reminder to set the Ready for Stage label - to queue this to get merged to stage & production.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

@spadmasa
Copy link

Validation done on the given url in desktop and devices
https://adobecom.github.io/nav-consumer/navigation.html?env=stage&navbranch=mwpw-158932&authoringpath=/federal/dev/devashish&customlinks=home,apps,learn
do not see any links displayed in desktop
{616A544E-3A70-47E1-B80B-97E273E9AD1F}

Authoring done :

{E63B082D-F4D6-4B5F-95DF-7A9BB1284A17}

In devices
{26ACDA18-E83E-4E13-B401-4E0DACA98A6F}
{62773057-6658-4AB8-833A-BDBB04CE6225}
{E0B3FBAA-2455-4781-9B53-A3F24E4EB1A8}

detailed testing details are updated in substask of https://jira.corp.adobe.com/browse/MWPW-158932

@spadmasa spadmasa added verified PR has been E2E tested by a reviewer Ready for Stage labels Sep 26, 2024
@milo-pr-merge
Copy link
Contributor

milo-pr-merge bot commented Sep 26, 2024

Skipped merging 2942: [MWPW-158932] - Add support for custom links through link group in parallel to large menu. due to failing checks

@@ -696,7 +702,7 @@ class Gnav {
this.elements.mainNav.style.removeProperty('padding-bottom');
} else {
const offset = Math.ceil(this.elements.topnavWrapper.getBoundingClientRect().bottom);
this.elements.mainNav.style.setProperty('padding-bottom', `${offset}px`);
this.elements.mainNav.style.setProperty('padding-bottom', `${2 * offset}px`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? The purpose of this was to ensure content that would risk flowing outside of the page when the menu is too long remains accessible. This change, along with https://github.com/adobecom/milo/pull/2942/files#diff-af209f212893e015b3b74f7891e85e68f79801c7f98e760f8d56887deea3e4b3R64, make the experience and code more convoluted with no obvious benefit.

With the CSS changes, it might be that this piece of logic is no longer needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This issue occurs specifically on iPhone devices when there are multiple links in that section and scrolling becomes necessary. I understand that a CSS fix would eliminate the need for extra spacing below. However, the fix we applied is for iPhones using Chrome and Safari browsers:

Case 1: When the URL is loaded and the menu is opened via the hamburger icon, some links become hidden due to the presence of back/forward arrows for navigation in the lower section. See the screenshot for reference:

Case 2: When the page is scrolled slightly, the bottom section disappears, allowing all the links to become visible.

To resolve Case 1, we increased the padding size. We can move this padding-bottom adjustment to CSS instead of using JavaScript, and remove that functionality from the global navigation.

Comment on lines +846 to +849
const mainNavItem = this.decorateMainNavItem(item, index);
if (mainNavItem) {
this.elements.mainNav.appendChild(mainNavItem);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the use case in which an element wouldn't be returned? Looking at

, an element is always returned. Most decoration methods should either return an element or '' (not null). So the methods should handle this, not the places where they're used.

@mokimo mokimo merged commit 05ebf1f into adobecom:stage Sep 26, 2024
20 of 22 checks passed
@mokimo mokimo mentioned this pull request Sep 26, 2024
@overmyheadandbody
Copy link
Contributor

Spoke with @mokimo that this was promised to be merged, but it still wouldn't hurt to have a look over the comments and integrate whatever is deemed valuable in another iteration. CC: @Deva309, @salonijain3

jenssingler pushed a commit to jenssingler/milo that referenced this pull request Oct 7, 2024
…rallel to large menu. (adobecom#2942)

* Add support for custom links through link group in parallet to large menu

* Added UT for the changes

* lint fixes

* Bug fix mwpw-159018

* Bug fix mwpw-159018

* Bug fix mwpw-159018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants