core icon indicating copy to clipboard operation
core copied to clipboard

[Feature request] Officially support `collapsible: true` deeper than top level items

Open ascott18 opened this issue 3 years ago • 3 comments

Clear and concise description of the problem

Currently, collapsible: true can be set on nested sidebar items and it does work, but the Typescript typings don't allow this so I have to cast to any.

The functionality today works how I would want it - the nested items under Attributes in my example below are listed when navigated into that section, and not listed when not in that section.

It is just that the documentation and the TS types try to discourage this usage. It would also be nice if the arrow to manually expand/collapse without navigating into the section could be rendered.

Suggested solution

Allow this to be an officially supported scenario without the cast to any on the child item:

sidebar: [
  "/",
  {
    text: 'Model Components',
    children: [
      '/model-components/properties',
      {
        text: "Attributes",
        link: '/model-components/attributes',
        collapsible: true, // Allow this to work without TS workarounds.
        children: fs
          .readdirSync(path.resolve(__dirname, '../model-components/attributes'))
          .map(f => '/model-components/attributes/' + f)
      } as any,
      '/modeling/model-components/methods',
     ],
  },
] 

Alternative

No response

Additional context

No response

ascott18 avatar May 10 '22 21:05 ascott18

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

github-actions[bot] avatar May 18 '22 01:05 github-actions[bot]

Not stale - would still very much like to see this.

ascott18 avatar May 18 '22 16:05 ascott18

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

github-actions[bot] avatar May 26 '22 01:05 github-actions[bot]

Hello, I would like this issue to be fixed too. I opened a pull request about 1 month ago. Have a maintainer a chance to look a it? Thanks

pplr avatar Dec 08 '22 08:12 pplr