facebook / facebook/docusaurus

Persist sidebar state (categories expanded state, hidden sidebar)

Aperta
#6,319 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
domain: theme feature
Lingua principale
TypeScript
Stelle
66.2k
Fork
10k
Merge medio
1g 3h
PR unite (30g)
52

Descrizione

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Description

It would be useful to persist sidebar state like which categories are collapsed and if the sidebar is hidden or not in local storage (or session storage?), so that the user's navigation experience is not interrupted by, say, going to the blog briefly.

### Has this been requested on Canny?

No

### Motivation

Better UX

### API design

Persist state in local storage / session storage and retrieve on sidebar first render. After #3811 we probably have a better way to control the collapsed state of individual categories.

### Have you tried building it?

No

### Self-service

- [ ] I'd be willing to contribute this feature to Docusaurus myself.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.