-
Notifications
You must be signed in to change notification settings - Fork 155
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
Persist sorting per view #6290
Persist sorting per view #6290
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
cc @dschmidt since this touches composables you have been working on |
884654a
to
97ce203
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice!
When I introduced the sort composable, I was annoyed I had to make the same adjustments in several locations - this nicely gets rid of those duplications. Love it!
packages/web-app-files/src/composables/pagination/usePagination.ts
Outdated
Show resolved
Hide resolved
packages/web-pkg/src/composables/localStorage/useLocalStorage.ts
Outdated
Show resolved
Hide resolved
packages/web-pkg/src/composables/router/useRouteQueryPersisted.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items per page seems to mostly work fine, just produced a This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://firefox-source-docs.mozilla.org/performance/scroll-linked_effects.html for further details and to join the discussion on related tools and features!
for me once in Firefox
Shared with me:
[Vue warn]: Property or method "targetRoute" is not defined on the instance but referenced during render.
upon page navigation with only pending shares, pending&accepted and pending&accepted&declined shares- Accepted&declined shares table persist the same preference, but I suppose that is fine for now
Shared with others:
- Sorting by name works
- Sorting by Share receiver is broken
- Sorting by Sharedate is broken
Shared via Link
- Sorting by name works
- Sorting by Share receiver is broken
- Sorting by Sharedate is broken
Is that related to this PR? 🤔
That's on master, but I fixed it now. The pending shares table was referencing a targetRoute variable that didn't exist anymore - just deleted it, because you can't click on resources in the pending shares table anyway, so there is no need for a target route. Additionally fixed, that the
Yes, unfortunately the way the table is built this is not that easily changed, so I'd like to keep it for now. The better UX would be, that accepted and declined shares have their own sorting. Would like to look into that separately.
Sorting by |
2adbde6
to
bd89542
Compare
Results for oC10SharingExternal https://drone.owncloud.com/owncloud/web/22095/40/1
|
Results for oC10iPhone3 https://drone.owncloud.com/owncloud/web/22095/49/1
|
Results for oC10XGAPortrait3 https://drone.owncloud.com/owncloud/web/22095/45/1
|
Results for oC10iPhone1 https://drone.owncloud.com/owncloud/web/22095/47/1
|
It's being used to auto-wire RouteQuery params to local storage. It also enforced RouteQuery params to be set in the URL, even if the route was visited without them. With this we start to always have a full state in the URL. Started with the usePagination composable which now handles the items per page internally, including persistence to localStorage. Later on this can be replaced with another storage (like settings in the backend).
bd89542
to
d0b2b84
Compare
Results for oC10SharingExternal https://drone.owncloud.com/owncloud/web/22099/40/1 |
Results for oC10SharingPermission https://drone.owncloud.com/owncloud/web/22100/35/1
|
Results for oCISSharingBasic https://drone.owncloud.com/owncloud/web/22100/53/1 |
Kudos, SonarCloud Quality Gate passed! |
Force merged without waiting for another CI run - the last one was green and the two commits didn't change anything that could explode in tests. |
Description
This PR adds a new composable (
useRouteQueryPersisted
) which takes care of syncing non-default query params into the localStorage automatically. It has been hooked into theuseSort
andusePagination
composables (optional, can be overwritten, e.g. with mocks for tests).This kind of spams the localStorage a little bit, but since we want to be flexible regarding the persistence backend we probably need to be on a fine grained key-value-pair level with persisting options/settings.
With this we now persist the sort choices into the local storage per view. I.e. navigating into subfolders will keep the same sort choices. Navigating to different views will restore the historic sort choices of that respective view.
Related Issue
Motivation and Context
Improve UX.
How Has This Been Tested?
Not yet, unit tests need to be added/adapted.
Types of changes
Checklist:
Open tasks: