Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix open folders in sidebar #55

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

andresgutgon
Copy link
Contributor

What?

The old approach did not work because navigating to a new document would re-render the tree. We now try to hold that state in Zustand so it can persist across navigations

@andresgutgon andresgutgon force-pushed the feature/sidebar-file-actions-popover branch from 561e0ac to bc3a363 Compare July 23, 2024 10:22
The old approach did not work because navigating to a new document
would re-render the tree. We now try to hold that state in Zustand so it
can be persisted across navigations
@andresgutgon andresgutgon force-pushed the feature/sidebar-file-actions-popover branch from bc3a363 to 9082de5 Compare July 23, 2024 10:23
Comment on lines +21 to +31
it('shout remove nested paths', async () => {
const { result } = renderHook(() => useOpenPaths((state) => state))
act(() => {
result.current.togglePath('some-folder/nested-folder/doc1')
})

act(() => {
result.current.togglePath('some-folder/nested-folder')
})
expect(result.current.openPaths).toEqual(['', 'some-folder'])
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@andresgutgon andresgutgon merged commit ba7494a into main Jul 23, 2024
2 checks passed
@andresgutgon andresgutgon deleted the feature/sidebar-file-actions-popover branch July 23, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants