Skip to content

Refreshing a filtered list clears the active filter #97

Closed

Description

@daewon

Summary

If a filter is applied in the bucket list or object list, pressing refresh (R) reloads the data but also clears the active filter.

Version

  • STU 0.7.6

Steps to reproduce

  1. Open the bucket list or any object list.
  2. Press /, enter ba, and apply the filter.
  3. Press R to refresh the list.

Expected

Refreshing should reload the data while keeping the current filter text active and reapplying it to the refreshed items.

Actual

The refresh completes, but the active filter is cleared and the full list is shown again.

Notes

This appears to affect both the bucket list and object list views.

Activity

  1. daewon commented on Mar 11, 2026

    @daewon
    ContributorAuthor

    Attached a screenshot.

    Before

    Image

    After Pressing R

    Image
  2. daewon commented on Mar 11, 2026

    @daewon
    ContributorAuthor

    While testing this issue, I also noticed that the selected sort order is reset on refresh.

    That looks related, since refresh appears to rebuild the list view state.

    I saw the same behavior in both the bucket list and object list views.

  3. lusingander commented on Mar 12, 2026

    @lusingander
    Owner

    Yes, I'm aware of this behavior, but I haven't specifically addressed it yet.

    Implementing a reload feature for stateful lists requires careful consideration, and the best behavior often depends on the use case, so I haven't implemented any specific handling.

    That said, as you pointed out, preserving filter and sort states would likely be preferable in many scenarios.

  4. added
    enhancement
    on Mar 12, 2026
  5. daewon commented on Mar 12, 2026

    @daewon
    ContributorAuthor

    I put together a draft PR here: #98

    I tried to keep the change as narrow as possible, since reload behavior for stateful lists can get complicated quickly.

    The root cause seemed to be that refresh rebuilds the list page, while the active filter and sort selection currently live inside that page, so they get reset unless they are explicitly restored.

    With that in mind, this draft only preserves and restores:

    • the active filter text
    • the selected sort option

    I did not try to preserve all list UI state globally.

    While working on this, I also found that the bucket reload path needs some extra care when a multi-bucket view refreshes into a single bucket. Switching away from the existing BucketList too early can leave the app in a bad state if the follow-up object load fails, so this draft keeps the current list visible until that load succeeds. Zero-bucket and error cases also stay retryable.

    I reviewed the flow carefully and verified it locally with cargo test, but this is meant as a draft idea rather than a request to merge as-is. If you have time, I'd really appreciate a quick behavior check and code review.

  6. lusingander commented on Mar 12, 2026

    @lusingander
    Owner

    Thanks for the PR. I'm not sure if I can look at it immediately, but I intend to review it as soon as possible.

  7. lusingander commented on Mar 20, 2026

    @lusingander
    Owner

    Thank you for your support.
    I am still in the process of reviewing the finer details, but the basic policy seems fine. The necessary actions and points to consider also appear to be appropriate.

  8. linked a pull request that will close this issuePreserve list view state on refresh #98on Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions