# menuPanel behaviour

*Open when a form has a sidebar navigation — a menuPanel, its items, or the pane it drives.*

The panel's navigation **is** its `menuPanelItem` children, attached by `layout[bp].parentId`. **Its value is the selected item's `entity`** — an item is active when `owningPanel.value === entity`, and the URL sync is `?<urlParam>=<entity>`. A `workspaceViewport` mirrors it by `menuComponent` (the menu's `name`) and opens that entity with that item's `filter`.

Nothing else consumes the selection. A panel no viewport names and no code-form reads is a list of rows that highlight and do nothing. Only a `menuComponent` naming the *wrong* element is caught here; an absent one is not.

Only items with `kind: 'entity'` **and** a non-empty `entity` are selectable. A targetless row — an entity item with `entity: ''`, a `kind: 'link'` with no `url` — still draws its label, icon, hover tint and cursor, and the click is a silent no-op. The entity-less one is worse: the panel filters it out entirely, so it never highlights, `defaultItem` cannot name it, and the viewport sits on its grey `emptyText` forever. Nothing on this path reports either.

Landing entry, in precedence order: the URL `?<urlParam>=` (a base prop; an empty string publishes nothing), then the user's remembered choice, then `defaultItem`. `rememberLastChoice` is true when absent, so `defaultItem` alone is a no-op for every returning user — to pin a landing row, set both.

**`defaultItem` takes either spelling.** `resolveMenuSelection` matches the item's own `name` first and falls back to an item's `entity` for back-compat; the platform's own module seeder writes the **entity** system name, which is the spelling its documentation describes. Either way it must land on a `kind: 'entity'` item with a non-empty `entity` — a `link` or `button` row can never be the landing entry, and a token matching nothing falls through to the first entity item with nothing reported. The gate catches both misses.

`selectionScope` fuses several panels into one navigation: at most one highlighted row across all of them, one shared remembered choice, and only the first panel to mount seeds the default. The value is trimmed, so whitespace equals absent — and two menus that must stay independent must not share a tag.
