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

[2.x] Create positioning priority constants in the navigation menu class #1598

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Feb 29, 2024

Extracts constants for the default priorities used for navigation menu design.

NavigationMenu::DEFAULT = 500
NavigationMenu::LAST = 999

For example, the following is not very clear: (What does 999 mean and why do we use it?

$priority ?? 999

But here, with the constant it's clear that we are falling back to putting the item last in the menu.

$priority ?? NavigationMenu::LAST

It also makes things like this clearer

$priority = NavigationMenu::LAST + 1

And a good IDE also shows the underlying integer values of the constants.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (cb580ed) to head (aaa17a0).

❗ Current head aaa17a0 differs from pull request most recent head 59175a3. Consider uploading reports for the commit 59175a3 to get more accurate results

Additional details and impacted files
@@                       Coverage Diff                        @@
##             improved-navigation-internals    #1598   +/-   ##
================================================================
  Coverage                            99.95%   99.95%           
  Complexity                            1776     1776           
================================================================
  Files                                  183      183           
  Lines                                 4800     4800           
================================================================
  Hits                                  4798     4798           
  Misses                                   2        2           

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

@caendesilva caendesilva marked this pull request as ready for review February 29, 2024 09:28
@caendesilva caendesilva merged commit 12a22f8 into improved-navigation-internals Feb 29, 2024
6 checks passed
@caendesilva caendesilva deleted the create-navigation-menu-priority-constants branch February 29, 2024 09:29
@caendesilva caendesilva mentioned this pull request Jun 27, 2024
74 tasks
@caendesilva caendesilva added this to the v2 milestone Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant