Page MenuHomePhabricator

Code hygiene/performance: Batch filter update operations when we update multiple items
Open, Needs TriagePublic

Description

Right now, we listen to itemUpdate from the model to update many pieces of the interface - this makes sense in specific terms, since every time anything changes we want to validate the UI -- but in effect, we do have cases where we have batch operations, and then those actions are running multiple times over and over unnecessarily.

Batch operations include:

  • Clear filters ("trash" icon)
  • Reset to defaults
  • Load/apply saved query

The adding/removing of individual items through the menus are the only case where it makes sense to go with "itemUpdate" separately. Same goes to removing filter 'tag' items (bubble items) from the active tag area.

We already have a sort of batching logic when we store the filter groupings -- we can use some of that logic to do these batch operations; instead of listening to itemUpdate, we could change it to listen to batched operation which, in cases where we only change 1 item, will just contain a single change.

This requires a slight change in where we listen to events, but shouldn't be too elaborate to do and can save a lot of repetitive operations.

Event Timeline

Mooeypoo created this task.Oct 12 2017, 4:52 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 12 2017, 4:52 AM
Mooeypoo updated the task description. (Show Details)Oct 12 2017, 4:52 AM
Mooeypoo updated the task description. (Show Details)

Change 383956 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] [poc] RCFilters: Enable a batched update operation

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

Restricted Application added a project: Growth-Team. · View Herald TranscriptNov 21 2018, 2:18 PM