-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add resizable sidebar (DHIS2-17170) (#534)
* feat: add resizable sidebar * feat: prevent sidebar from becoming to narrow or extend past the end of the window * chore: use correct default size * feat: add sidebar width to global state and store in local storage * feat: allow sidebar width reset via view menu * chore: add translation for reset sidebar width button * feat: enable resizing the sidebar with keyboard navigation * fix: persist width correctly after resetting * feat: ensure sidebar does not break layout * feat: decrease sidebar width after window resize if needed * fix: add dependency array to effect hook * fix: ensure resize handler is removed when the component unmounts * test: implement e2e tests * fix: address overshooting min and max width issues * test: assert out-of-bounds behavior Out of bound mouse moves should be ignored, so the sidebar should not start resizing again until the cursor returns over the resize handle For keypresses we need to ignore that keypresses in an valid direction are not ignored * chore: correct some typos * docs: describe how the resizable sidebar feature works * chore: fix typo in filename * chore: remove redundant call to event.persist() * refactor: keep reading and writing to local storage in a separate file * chore: use local storage key format consistent with dashboards * feat: reset to default width on double click * chore: add e2e test for reset by double click * fix: hide panel content after transition is complete * fix: animate width on inner panel to fix reset animation * docs: add instructions for resetting to default by double-click * fix: set animation duration to 150ms for increased snappiness
- Loading branch information
1 parent
4db7f03
commit 2904c66
Showing
16 changed files
with
776 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.