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

Enable built-in state saving for Tasks datatable #1333

Merged
merged 2 commits into from
Oct 14, 2023
Merged

Enable built-in state saving for Tasks datatable #1333

merged 2 commits into from
Oct 14, 2023

Conversation

fretman92
Copy link
Contributor

@fretman92 fretman92 commented Oct 14, 2023

Hello @mher and thanks for this project

Resolve #1215

Relies on https://datatables.net/examples/basic_init/state_save.html

This allows to navigate to a specific task, then navigate back (press browser back) -> it restores the main tasks table state where it was (current page, current sort, ...) instead of going back to first page / initial state.

Maybe the other datatables could benefit as well, but the main use of this app is mainly to browse the list of task of investigate some one by one without having to find where we were each time

Very limited side effect (no external plugin, built-in option) and it keeps the url clean. (sadly no url bookmarking but not very useful for a always evolving list of tasks)

I considered the deeplinking plugin and stateRestore extension, both would have supported url params but it seemed simpler to just use this native configuration.

Thanks for the review (should be quick hopefully ;)

@fretman92 fretman92 changed the title Enable state saving Enable built-in state saving for Tasks datatable Oct 14, 2023
@mher mher merged commit 8cf8f23 into mher:master Oct 14, 2023
9 checks passed
@fretman92
Copy link
Contributor Author

maybe we should have configured an explicit stateDuration (rather than the default 2h using localStorage) https://datatables.net/reference/option/stateDuration
even stateDuration:-1 to use sessionStorage (ie related to the current tab lifecyle) would allow users to quickly reset their saved state by simply opening another tab.
Let's test out how it behaves though, if we get some negative feedback, stateDuration:-1 will probably appease the crowd ^^

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.

More consistent navigation by keeping pagination settings alive between page visits
2 participants