Skip to content

Conversation

@emmadesilva
Copy link
Member

@emmadesilva emmadesilva 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.

@codecov
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.

@emmadesilva emmadesilva marked this pull request as ready for review February 29, 2024 09:28
@emmadesilva emmadesilva merged commit 12a22f8 into improved-navigation-internals Feb 29, 2024
@emmadesilva emmadesilva deleted the create-navigation-menu-priority-constants branch February 29, 2024 09:29
@emmadesilva emmadesilva 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.

2 participants