Skip to content

Paginated resource selection #2824

Open
@ddmck

Description

@ddmck

Feature

On the index page of a resource, or when viewing nested resources on a resource show page, when a user selected a one or more records and then cicks on a pagination link/button the selected resources are not persisted.

Ideally a user would be able to select multiple resources across the paginated records and then bulk delete or perform a bulk action.

Right now, it is not clear to the user the the prior resources are no longer selected.

Current workarounds

For smaller collections of resources it is possible to increase the number of items per page to select more than the default pagination amount, but for larger collections this would likely cause memory issues.

Screenshots or screen recordings

AvoPaginatedResources.mov

The video shows what happens when selecting a resource from the blog posts on the AVO demo site. When no records are selected the action is disabled, which occurs after changing pages. When navigating back the checkbox briefly shows as selected but I think this is just due to browser caching, as no params are passed in the the pagination request related to selected resources.

Additional context

I have not seen this behavior implemented elsewhere. This could potentially be solved by having a stimulus controller tracking the selected items, or by making a get request when checkboxes are updated, and use turboframes/streams to update the pagination links with the currently selected resources, and then create hidden form fields for the resources not shown on the page.

It might be a good idea to indicate to the user the number of resources currently selected, so that they are not performing actions/deleting records they are unaware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureHelp wantedWe could use some help with thisJavascriptPull requests that update Javascript codeUIThis issue is related to the UI

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions