fix: disable code wrapping, allow max. 1 open nav#439
Conversation
| defaultValue={currentTopic} | ||
| onValueChange={(value) => | ||
| window.localStorage.setItem(openTopicsLocalStorageKey, JSON.stringify(value)) | ||
| } | ||
| type="multiple" | ||
| type="single" |
There was a problem hiding this comment.
This now doesn't allow all sections to be closed. If one is open, it can't be closed.
Additionally, onChange needs to be modified so that localStorage clears up and stores only one section as expanded. Otherwise, when you refresh the page, the expanded section isn't the last one you expanded.
|
There is a small bug in the documentation navigation. Unsure if related to this PR, however this is the only discussion I could find on the topic. If you navigate directly to a page (e.g. via URL or external navigation), the current nav group is highlighted, but not expanded. The expanded state is determined by the last page you clicked on or navigated to via the nav itself, however arriving at a page through other means results in this buggy state.
The issue seems to be related to the "openTopicPreferences" state in the DocsNavigation component. Claude Code suggested this fix, however it seems it might defeat the entire purpose of the "preferences" idea. Personally, I'd prefer an accurate nav bar over one that remember what I clicked on at 3am this morning. Linked issue - #477 |

Before:

After:

Before:

After:
