Skip to content

Extend AsyncList capabilities#4

Merged
darakreqo merged 21 commits into
Kreqo:mainfrom
darakreqo:main
Jan 27, 2026
Merged

Extend AsyncList capabilities#4
darakreqo merged 21 commits into
Kreqo:mainfrom
darakreqo:main

Conversation

@darakreqo
Copy link
Copy Markdown
Contributor

@darakreqo darakreqo commented Jan 25, 2026

This PR improves the AsyncList component and adds a lot of basic features:

  1. Items can now be updated directly by sending a ItemAction::Update action.
  2. Lists can now be filtered with the new ListFilter trait.
  3. Lists can now be sorted with the new ListSorter trait.
  4. The UI reflects pending operation statuses.
  5. Failed requests periodically auto-retry until success.

Improvements include:

  1. The user of AsyncList can now decide how to display the list (Portal removed from AsyncList::view).
  2. The list uses ListItem::Id instead of usize everywhere for more stability.
  3. The editing status (Option<T::Id>) is now reset in Submit's handling instead of in ListMessage's.
  4. A lot of refactoring and improvement to ergonomics.

TODOS

  1. Add a way to customize the layout & editing flow of AsyncList::view with default ready-to-use models (this can probably be added in a future PR).

@darakreqo
Copy link
Copy Markdown
Contributor Author

Now that the pending ListRequest::Create functionality has been added (2395248), we should generalize the idea of a pending operation to extend the functionality to other ListRequest variants as well.

@darakreqo
Copy link
Copy Markdown
Contributor Author

Now that the pending operations have been generalized (c87157b), we should look into handling failure cases. In particular, the AsyncList should detect when it needs to sync itself and periodically try reconnecting when server connection is lost.

@darakreqo darakreqo self-assigned this Jan 26, 2026
@darakreqo
Copy link
Copy Markdown
Contributor Author

Also, filtering should happen before sorting for efficiency.

@darakreqo
Copy link
Copy Markdown
Contributor Author

Also, filtering should happen before sorting for efficiency.

Really, filtering should happen mostly on the server because with very large lists, a fetch_all over HTTP would be laggy. Or at least, there should be a mix of the two (maybe with some caching), but this should really be implemented when most components are added and storage is generalized for the entire application.

@darakreqo
Copy link
Copy Markdown
Contributor Author

darakreqo commented Jan 27, 2026

ListFilter::filter should output a f32 score in addition to a bool so that it can be used in sorting.

@darakreqo darakreqo marked this pull request as ready for review January 27, 2026 12:37
Copy link
Copy Markdown
Contributor Author

@darakreqo darakreqo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just apply those comments quickly and merge, we should move on.

Comment thread ui/src/component/list/filter.rs Outdated
Comment thread ui/src/component/list/filter.rs
Comment thread ui/src/component/list/sorter.rs
Comment thread ui/src/component/list/storage.rs
Comment thread ui/src/pending.rs Outdated
Comment thread ui/src/pending.rs Outdated
@darakreqo darakreqo merged commit dc1e186 into Kreqo:main Jan 27, 2026
8 checks passed
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.

1 participant