Repository navigation
feat(filter): persist board filters (saved views + default view) - #8325
heinrich-toews wants to merge 3 commits into
Conversation
|
Hi — this is a first contribution from a fork, so the GitHub Actions workflows are pending approval. Could a maintainer approve the workflow runs so CI can execute? Thanks! |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Allow saving the active card filter as a named view per board and re-apply it from the filter popover. Signed-off-by: Heinrich Toews <ht@twx-software.de>
Let users pick one of their saved views as the default view in the Deck settings. It is applied automatically when opening any board; tags are only applied where they match the current board. Signed-off-by: Heinrich Toews <ht@twx-software.de>
- use the Pinia settings store and drop the removed Vue.set helper - validate saved-view names and filters and limit views per board - index the owner column used by the cross-board query - clear the default view when its view is deleted - cover validation and cleanup with unit tests Signed-off-by: Heinrich Toews <ht@twx-software.de>
899d018 to
55380e5
Compare
|
Hi @grnd-alt and @luka-nextcloud — friendly bump on this PR, which has been open since Aug 27. I've rebased it onto current
Local checks pass: I also verified the flow end-to-end on a dev instance through the OCS API and a browser: create/apply/delete a saved view, set and remove the default view, pick the default in Deck settings, and confirm cross-user access returns Two asks:
Thanks! |
grnd-alt
left a comment
There was a problem hiding this comment.
Hello there, thanks for contributing, and please excuse me not getting to it earlier.
I like the changes idea itself but see some issues.
-
If we persist filters in the database I think we should not do it per user but per board for all users to see. I don't see any obvious drawback to that.
-
The views are not deleted from the database as far as I saw. That will lead to the database entries growing and growing overtime as boards are deleted
-
new endpoints should be OCS controllers only
-
The filters are not really validated, it's only checked if the stored value is valid json not if it's anything sensible, wrong json will probably break the rendering (didn't test that though). That will get especially problematic when some of the filters change and are not reshaped in the json fields in the future
I see that last point is relatively hard to fix but I don't like storing json in the database tbh, especially since only the frontend verifies it, and at that without any recovery mechanism to fix the json. So it would be nice to have a better approach here. Two ways would be to verify the json on the backend side or store actual filter values in the db instead of a json text field. With actual filters stored we could also add methods for backend filtering instead of only ui filters in the future so I would prefer that.
As these are some fundamental structural issues I see I did not yet review specifics in detail
|
@heinrich-toews I would prefer some more brainstorming here with you to get this feature done in a maintainable fashion, without you implementing things first and then having to redo it because of the reviews. I am open to different approaches as well here, what are your thoughts on the things I posted? |
Summary
This adds per-user saved board filter views and an optional per-user default view.
Saved board views
BoardViewentity, mapper, service and OCS API controller.deck/api/v1.0/views(index/create/update/delete).Default view
ConfigService::defaultBoardViewpersisted per user.Migration
Version11003Date20260821120000createsoc_deck_board_viewswith indexes for(board_id, owner)andowner.Hardening
mainand ported to the Pinia settings store;Vue.setis no longer used.Testing
composer test:unit— BoardViewServiceTest (12 tests) and the new ConfigService default-view tests pass.vendor/bin/psalm --no-cache— no errors.composer cs:check,npm run lint,npm run stylelint— clean.npm run test,npm run build— pass.403and cannot see another user's views.Note:
l10n/*is intentionally not included per the project's Transifex workflow — translations are managed upstream.