Skip to content

feat: render side-loaded menu entries between Home and Account (#48)#70

Merged
andregoepel merged 1 commit into
mainfrom
feature/nav-menu-side-load-position
Jul 5, 2026
Merged

feat: render side-loaded menu entries between Home and Account (#48)#70
andregoepel merged 1 commit into
mainfrom
feature/nav-menu-side-load-position

Conversation

@andregoepel

Copy link
Copy Markdown
Owner

Closes #48.

What

The host-contributed nav component (Layout.AdminMenu <DynamicComponent>) was rendered inside the AuthorizeView Roles="Administrator" block, above the Administration group — so it only showed for admins, near the bottom. It now renders immediately after Home and before the Account group, for all users.

New order: Home → side-loaded entries → AccountAdministration.

The contributed component is responsible for gating any role-specific entries (e.g. with its own AuthorizeView), as noted in the updated XML doc.

Rename (per the issue's note)

Since the entries are no longer administrator-scoped, AppFoundationLayoutOptions.AdminMenu is renamed to Menu. To avoid breaking existing hosts (e.g. andregoepel.dev), AdminMenu is kept as an [Obsolete] forwarding alias:

public Type? Menu { get; set; }

[Obsolete("Renamed to Menu. …")]
public Type? AdminMenu { get => Menu; set => Menu = value; }

NavMenu reads Layout.Menu, so there's no obsolete-usage warning in the foundation; a consumer still setting AdminMenu compiles (with a deprecation warning) and behaves identically.

Tests

AppFoundationLayoutOptionsTests verifies the AdminMenuMenu forwarding both ways.

Verification

  • dotnet build -c Release — 0 errors, 0 warnings.
  • dotnet test -c Release — 88/88 (1 new).

Note

There's no bUnit test for NavMenu positioning (rendering it needs IQuerySession/SetupCompletion, IIdentityFeatureProvider, auth state, and JS interop — the repo doesn't test it today), so the ordering is verified by the markup change. Happy to add a heavier component test if you'd like coverage there.

Move the host-contributed nav component out of the Administrator-only block
so it renders immediately after Home and before the Account group, for all
users. Order is now: Home -> side-loaded -> Account -> Administration. The
contributed component gates its own role-specific entries.

Since the entries are no longer admin-scoped, rename the extension point
AppFoundationLayoutOptions.AdminMenu -> Menu, keeping AdminMenu as an
[Obsolete] forwarding alias so existing hosts keep compiling.

Closes #48
@andregoepel
andregoepel merged commit 41c2940 into main Jul 5, 2026
3 checks passed
@andregoepel
andregoepel deleted the feature/nav-menu-side-load-position branch July 5, 2026 07:31
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.

Place side-loaded menu entries in second position (between Home and Account)

1 participant