tator icon indicating copy to clipboard operation
tator copied to clipboard

Filtered corrections view skips localizations after editing

Open jrtcppv opened this issue 1 year ago • 5 comments

If a filter is applied in the corrections view, and edits are made which cause localizations to not pass the filter, going to the next page will cause localizations to be skipped, as they are now shown on the previous page.

Proposed solution:

  • Cache any modified localizations that no longer pass the current filter, along with their position in the full dataset (index)
  • Modify any REST requests (start and stop parameters) based on analysis of the cache. For example, if I am on page 5 and 50 cached localizations have indices prior to the start of page 5, subtract 50 from the offset. If 10 localizations on page 5 are cached, subtract 10 localizations from the limit.
  • Insert cached localizations back into the response. So for the page 5 example, insert the 10 localizations back in.
  • Update the display to indicate localizations that no longer pass filters, and possibly that a reload will make them go away.
  • The cache is invalidated on hard reload, when the user changes sorting, or when the user changes filters.

One weakness of the approach is that simultaneous modifications to the same dataset by a different user could result in incorrect data being displayed. The most technically correct approach would be to simply soft reload the current page after a bulk edit is made and not display zombie localizations, but I understand this is not desired behavior.

jrtcppv avatar Feb 23 '24 21:02 jrtcppv

Keeping the cards that no longer 'belong' off to the side might be worth exploring. It probably simplifies the complexity of internal data storage and provides a helpful visualization for how many edits someone has done. It is similar to dealing with a deck of playing cards and putting some "off to the side".

bctcvai avatar Feb 23 '24 21:02 bctcvai

Side note - this solution could be applied to bulk editing of media as well on the project detail view (which currently has the same behavior).

jrtcppv avatar Feb 23 '24 21:02 jrtcppv

Is desired behavior to not lose one's place while paginating through? I can understand it from this example QA/QC workflow - a user is going through a list of localizations to review that's filtered with Needs Review == true, and updates that flag to false. Are there other workflows to consider?

If the user wants to update a list as they go, but not get lost with where they are in the pages, it may be helpful to have other visual cues to keep track of where they are. One was mentioned here by keeping a list of localizations that have been updated (could get unwieldy really quick). Another method could be a queue-like UI and force the user through a list / acknowledging entities have been reviewed, and soft reloads can happen but the user won't lose their spot.

In light of this issue, I would at least recommend removing the ability to edit in localization gallery and only through the corrections gallery. Or, supporting the ability to detect if the attribute edits would change the filter and warn the user.

marktaipan-cvisionai avatar Feb 24 '24 00:02 marktaipan-cvisionai

Need two indicators on cards:

  • Entity successfully edited -> suggestion to use a green check mark icon
  • Entity edited such that it no longer is included in filtered dataset (but is still being displayed until a hard reload) -> suggestion to use a pink or yellow border

jrtcppv avatar Feb 26 '24 15:02 jrtcppv

We can implement the suggestions in #770.

jrtcppv avatar Feb 26 '24 16:02 jrtcppv