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

Redesign menu link ordering system #112

Closed
Allcharles opened this issue Feb 21, 2020 · 2 comments
Closed

Redesign menu link ordering system #112

Allcharles opened this issue Feb 21, 2020 · 2 comments
Assignees
Labels
architecture Architectural changes to the software enhancement New feature or request triage:medium Medium priority issue or pull request

Comments

@Allcharles
Copy link
Contributor

Order Calculation

  1. their default order is the order they're inserted in array
    • i.e. if order is not given (e.g. undefined then order is floor(previous item's order) + 1 )
  2. they can be given an explicit order (any valid number)
    • if two order numbers are equal, correct order is insertion order
  3. all menu items are flat. Any notion of a hierarchy is purely aesthetic
    • e.g. indentation is calculated from parent depth but the menu items are still just one flat list
  4. if a menu item has a parent
    • indentation = parent chain depth
    • order = parents order +( (supplied order OR previous items order + 1) / (10^(parent.depth) * items in list))
  5. the only difference between the two menus is that indentation is ignored for rendering action menu items

Examples:

Example 1

Items should be sorted according to order once list is built

  • secondary menu:

    • home (order: 0, actual order: 0)
    • annotations (order: 10, actual order: 1)
    • projects (order: 20, actual order: 2)
  • profile menu:

    • my profile (order: undefined, actual order: 0)
    • bookmarks (order: undefined, actual order: 1)
    • projects (order: undefined, actual order: 2)
    • sites (order: undefined, actual order: 3)
    • annotations (order: 10, actual order: 4)

Example 2

Undefined items remain in the order they were inserted into the array

  • secondary menu:

    • home (order: undefined, actual order: 0)
    • annotations (order: undefined, actual order: 1)
  • profile menu:

    • my profile (order: undefined, actual order: 0)
    • bookmarks (order: undefined, actual order: 1)
    • projects (order: undefined, actual order: 2)
    • sites (order: undefined, actual order: 3)
    • annotations (order: undefined, actual order: 4)

Example 3

  • a (order: 5)
    • b (order: undefined, actual order: 5.1)
      • c (order: undefined, actual order: 5.11)
  • b (order: 6)

Example 4

  • a (order: 5)
    • b (order: 7, actual order: 5.7)
      • c (order: undefined, actual order: 5.71)
  • b (order: 6)

Example 5

  • a (order: 5)
    • b (order: 7, actual order: 5.7)
      • c (order: 3, actual order: 5.73)
  • b (order: 6)
@Allcharles Allcharles self-assigned this Feb 21, 2020
@Allcharles Allcharles added the enhancement New feature or request label Feb 21, 2020
@Allcharles Allcharles added architecture Architectural changes to the software triage:medium Medium priority issue or pull request labels Feb 26, 2020
@Allcharles
Copy link
Contributor Author

This system should enable the use of sparse ranges. This would allow ordering to be between -Infinity to 0 to +Infinity

  • home might always be most important: 0

  • admin links should always be lower: 1000. 1001, 1002, etc

  • projects should always come before sites: 100, 101

  • then regions: 200,201...

  • sites: 300

  • new links should always be higher than edit links:

    • new project: 101
    • edit project: 102
    • new site: 201
    • edit site: 202
  • Infinity: must be at top

  • 0 neutral (or default value if order missing)

  • +Infinity: must be last

@hudson-newey
Copy link
Member

Superseded by #112

@hudson-newey hudson-newey closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Architectural changes to the software enhancement New feature or request triage:medium Medium priority issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants