Page MenuHomePhabricator

Ensure duplicate queries don't run for a tab panel while allowing users to switch tabs quickly
Closed, ResolvedPublic

Description

Currently, due to a check in fetchItems() that bails if the new query type is equal to the current tab, when a user finishes a batch of images, the next batch will not load. We added this line to avoid duplicate queries running when the user switches tabs via URL fragment, and we still need a way to avoid this.

Furthermore, if a user switches tabs quickly, they might see the batch for the wrong tab for a short time before it's replaced by the batch for the correct tab. This means we need to ensure cardstacks are only added to the element of their respective tab, and they can't be unintentionally shown on the wrong tab.

Steps to Reproduce:

  • Go to suggested tags and skip through all images in a batch
  • You'll see a blank tab because fetchItems() bails early
  • Click on the user tab then quickly back to the popular tab. You'll see the user results for a second before the popular results replace them

Expected Results:

  • When user finishes a batch of images, the next one loads and is displayed
  • User can switch tabs quickly because results are tied to their respective tabs
  • User can switch tabs via URL fragment without seeing duplicate query results

Event Timeline

Change 545302 had a related patch set uploaded (by Anne Tomasevich; owner: Anne Tomasevich):
[mediawiki/extensions/MachineVision@master] Ensure subsequent queries can run when user finishes a batch

https://gerrit.wikimedia.org/r/545302

Change 545302 merged by jenkins-bot:
[mediawiki/extensions/MachineVision@master] Ensure subsequent queries can run when user finishes a batch

https://gerrit.wikimedia.org/r/545302