Skip to content

fix(menu-service): sort extensions by priority first, append shortcuts after#78

Merged
roncodes merged 2 commits intomainfrom
fix/header-menu-shortcuts-sort-order
Mar 26, 2026
Merged

fix(menu-service): sort extensions by priority first, append shortcuts after#78
roncodes merged 2 commits intomainfrom
fix/header-menu-shortcuts-sort-order

Conversation

@roncodes
Copy link
Copy Markdown
Member

Problem

getHeaderMenuItems() was using a flat sortBy('priority') across all items, including shortcuts. Shortcuts are assigned priority = parentPriority + 1, so a Fleet-Ops shortcut (priority 2) would sort between Fleet-Ops (priority 1) and Pallet (priority 2), interleaving shortcuts with real extensions.

The smart-nav-menu component builds the default pinned bar by slicing the first maxVisible (5) items from this list, so the bar ended up showing Fleet-Ops + its 4 shortcuts instead of the first 5 extensions.

Fix

Filter items into two groups before sorting — extensions sort by priority as before, shortcuts are appended at the end in registration order:

const extensions = A(items).filter((i) => !i._isShortcut).sortBy('priority');
const shortcuts = A(items).filter((i) => i._isShortcut);
return A([...extensions, ...shortcuts]);

This guarantees shortcuts never displace real extensions from the default bar, regardless of what priority values extensions choose.

Ronald A Richardson added 2 commits March 26, 2026 03:49
…s after

getHeaderMenuItems() was using a flat sortBy('priority') across all items,
including shortcuts.  Shortcuts are assigned priority = parentPriority + 1,
so a Fleet-Ops shortcut (priority 2) would sort between Fleet-Ops (priority 1)
and Pallet (priority 2), interleaving shortcuts with real extensions.

The smart-nav-menu component builds the default pinned bar by slicing the
first maxVisible (5) items from this list, so the bar ended up showing
Fleet-Ops + its 4 shortcuts instead of the first 5 extensions.

Fix: filter items into two groups before sorting — extensions sort by priority
as before, shortcuts are appended at the end in registration order.  This
guarantees shortcuts never displace real extensions from the default bar,
regardless of what priority values extensions choose.
@roncodes roncodes merged commit d5c0abd into main Mar 26, 2026
6 checks passed
@roncodes roncodes deleted the fix/header-menu-shortcuts-sort-order branch March 26, 2026 07:57
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