Skip to content

Add menu sample with navigation pane - #78

Open
asalloum5 wants to merge 2 commits into
mainfrom
CEXT-6563
Open

Add menu sample with navigation pane#78
asalloum5 wants to merge 2 commits into
mainfrom
CEXT-6563

Conversation

@asalloum5

@asalloum5 asalloum5 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a new Admin UI SDK V2 sample, admin-ui-sdk/v2/menu/custom-menu-with-navigation, demonstrating a single V2 menu extension point whose iframe page renders a left-hand navigation pane instead of relying on multiple Admin menu entries.

  • app.commerce.config.ts declares a single adminUi.menu entry nested under MENU_CONTENT via parentMenu.
  • The page renders vertical Tabs (@react-spectrum/s2) as the nav pane, switching client-side between three views: Overview (reads IMS context via useIms()), Settings, and About.
  • Includes a README covering setup, deploy, and how the navigation pane pattern works.

Related Issue

N/A

Motivation and Context

In V2, an app can register only a single Admin menu entry (adminUi.menu is one object, unlike V1's menuItems array). Existing samples only showed a basic single-page custom menu, with no reference for apps that need multiple sections. This sample fills that gap by showing the recommended pattern: an in-app navigation pane inside the one registered page, rather than trying to add more menu entries.

How Has This Been Tested?

Tested manually by deploying to an App Builder app and installing it on a Commerce instance via App Management, then verifying the menu entry appears under Content and the navigation pane correctly switches between the Overview, Settings, and About views inside the iframe.

Screenshots (if appropriate):

image image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@obarcelonap obarcelonap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the tsconfig thingy because it seems to me we're missing to commit some file(s).
Also, I'd recommend to add some simple tests (vitest) so we promote testing and we provide an example on how to write them.

"code:fix": "ultracite fix",
"postinstall": "npx aio-commerce-lib-app hooks postinstall",
"typecheck": "npm run typecheck:actions && npm run typecheck:web-src",
"typecheck:actions": "tsc --noEmit -p tsconfig.json",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any tsconfig.json in the root of the app, is this necessary?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, forgot to git add those files, you're absolutely right

"postinstall": "npx aio-commerce-lib-app hooks postinstall",
"typecheck": "npm run typecheck:actions && npm run typecheck:web-src",
"typecheck:actions": "tsc --noEmit -p tsconfig.json",
"typecheck:web-src": "tsc --noEmit -p src/commerce-backend-ui-2/web-src/tsconfig.json"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually tsconfig.json is also missing under this path, seems something is off

adminUi: {
menu: {
description: "App with Navigation Pane",
id: "CustomMenuNavigation::main",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefixing is not needed as the adminuisdk extension should be able to handle collisions, my proposal:

id: SampleAppWithNavigation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the same approach of other samples to keep it aligned

* only a single menu entry, this is how a multi-section app surfaces more
* than one view from it.
*/
export function NavigationPane() {

@obarcelonap obarcelonap Aug 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of simplicity I'd embed this into MainPage

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.

3 participants