Skip to content

[FS-Router] wildcard views are ending up in the automatic menu #3360

@taefi

Description

@taefi

Describe the bug

Having a wildcard views like this ends up having them in the auto menu that is created based on the createMenuItems utility from @vaadin/hilla-file-router/runtime.js:

/views
├── +customers
├── /products
│   ├── {id}
│   │   ├── edit.tsx
│   │   └── @index.tsx
│   ├── @index.tsx
│   ├── new.tsx
│   └── {...wildcard}.tsx      <- shows up in the menu
├── @index.tsx
└── {...wildcard}.tsx     <- shows up in the menu

Like this:
Image

Workaround

The wildcard views can be excluded from the menu explicitly using the exported ViewConfig:

import {ViewConfig} from "@vaadin/hilla-file-router/types.js";

export const config: ViewConfig = {
    menu: {
        exclude: true
    }
}

Expected-behavior

Wildcard views should be filtered out automatically by the createMenuItems utility.

Reproduction

You can find the reproducible example here.

System Info

Vaadin: 24.7.0.rc1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions