Skip to content

feat(menu-service): auto-register shortcuts as first-class header men…#75

Merged
roncodes merged 8 commits intomainfrom
feature/menu-item-shortcuts-description
Mar 1, 2026
Merged

feat(menu-service): auto-register shortcuts as first-class header men…#75
roncodes merged 8 commits intomainfrom
feature/menu-item-shortcuts-description

Conversation

@roncodes
Copy link
Member

@roncodes roncodes commented Mar 1, 2026

…u items

When a parent MenuItem with a shortcuts array is registered via registerHeaderMenuItem, each shortcut is now immediately registered as its own first-class header menu item with a dasherized id of the form {parentId}-sc-{shortcutTitle}.

This fixes three related issues:

  1. Shortcuts now appear in universe.headerMenuItems from boot, so the Customise Navigation panel's "All Extensions" column shows them.
  2. Pinned shortcuts can be found by id in allItems when rebuilding the bar, so they correctly appear in the "Pinned to Bar" column.
  3. The id is always dasherized (e.g. fleet-ops-sc-live-map) so lookups are consistent regardless of how the shortcut title is capitalised.

Fleetbase Dev and others added 8 commits March 1, 2026 00:28
…u items

When a parent MenuItem with a shortcuts array is registered via
registerHeaderMenuItem, each shortcut is now immediately registered as
its own first-class header menu item with a dasherized id of the form
`{parentId}-sc-{shortcutTitle}`.

This fixes three related issues:
1. Shortcuts now appear in universe.headerMenuItems from boot, so the
   Customise Navigation panel's "All Extensions" column shows them.
2. Pinned shortcuts can be found by id in allItems when rebuilding the
   bar, so they correctly appear in the "Pinned to Bar" column.
3. The id is always dasherized (e.g. fleet-ops-sc-live-map) so lookups
   are consistent regardless of how the shortcut title is capitalised.
MenuItem contract:
- Added `tags` property (String[] | null) to both constructor branches
  and toObject().  Accepts a single string or an array; normalised to an
  array internally.
- Added `withTags(tags)` builder method for the chaining pattern.

menu-service.js:
- Swapped native Array.isArray for Ember's isArray (imported from
  `@ember/array`) in the shortcut auto-registration loop.
- Shortcut scItems now inherit the parent's tags (or their own if
  defined) so they remain discoverable via the same search terms.
…fleetbase/ember-core into feature/menu-item-shortcuts-description
menu-item.js:
- Import isArray from `@ember/array` and replace all four
  Array.isArray calls (tags normalisation in constructor,
  withShortcuts, withTags, addShortcut guard).

menu-service.js:
- Expanded scItem builder to forward the complete MenuItem property
  surface for each shortcut: identity, routing, full icon properties
  (icon, iconPrefix, iconSize, iconClass, iconComponent,
  iconComponentOptions), metadata (description, tags), behaviour
  (onClick, disabled, type, buttonType), and styling (class,
  inlineClass, wrapperClass).
…fleetbase/ember-core into feature/menu-item-shortcuts-description
…fleetbase/ember-core into feature/menu-item-shortcuts-description
@roncodes roncodes merged commit 3ab00d1 into main Mar 1, 2026
6 checks passed
@roncodes roncodes deleted the feature/menu-item-shortcuts-description branch March 1, 2026 05:59
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