Page MenuHomePhabricator

Create the message group/prefix selector component
Closed, ResolvedPublic

Assigned To
Authored By
abi_
Jan 11 2022, 11:52 AM
Referenced Files
F34966507: image.png
Feb 25 2022, 4:45 PM
F34966502: image.png
Feb 25 2022, 4:45 PM
F34952297: image.png
Feb 15 2022, 10:01 AM
F34948213: Screenshot 2022-02-11 at 09.57.17 2.png
Feb 11 2022, 9:03 AM
F34948215: Screenshot 2022-02-11 at 09.57.41 (2).png
Feb 11 2022, 9:03 AM
F34443808: MG-overview.png
Jan 11 2022, 11:52 AM

Description

Current status

See: https://phabricator.wikimedia.org/T298960#7721165


See component:

MG-overview.png (768×1 px, 182 KB)

The plan is to to use OOUI to develop this component.

Until there is back-end support for displaying statistics for prefixes, this component should only display groups. Displaying of messages is tracked under T300483: Update the message group selector component to work with message prefixes

Event Timeline

Change 742173 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Special:MessageGroupStats: Add EntitySelector for groups

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

Change 742173 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Special:MessageGroupStats: Add EntitySelector for groups

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

The autocompletion is very convenient already for searching for specific groups and discovering related groups. For example, searching for Content Translation surfaces "Content Translation - API" group.

Screenshot 2022-02-11 at 09.57.17 2.png (573×883 px, 78 KB)

However, when there is no search term, no results are shown. In such case it would be useful to show the long list of groups to support browsing. This brings compatibility with the previous behaviour and helps to understand which kind of content users are. expected to be searching for.

Screenshot 2022-02-11 at 09.57.41 (2).png (523×883 px, 71 KB)

Putting this back in progress as we are looking at and reviewing the feedback received.

Change 762743 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessageGroupStats: Add placeholder text for the entity selector

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

One of the common feedback we've received has been that without any search text, no groups are displayed. Expected behavior is that all the groups would be shown. We had considered this earlier but decided against doing it primarily due to performance reasons. We're currently re-looking at this decision.

To make it clear to users that they need to type to start searching, I've added a placeholder:

image.png (511×953 px, 37 KB)

Current status of the ticket:

Feedback

The primary feedback that we have received on this ticket is that: without any search text, no groups are displayed. Expected behavior is that all the groups would be shown. We had considered this earlier but decided against doing it primarily due to performance reasons.

Future work

Potential improvements include:

  1. Add a placeholder text: Type to start searching - Patch pending for this: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/762743
  2. Add functionality to fetch only groups or message prefixes. Currently even though message prefixes are not being displayed, we're fetching them from the API. It would make this component (entity selector) more reusable and help performance if we would update the entity selector to fetch only the required entity (groups or message prefixes). This would be a small task and we could track this work under the current ticket itself.
  3. Replace usage of the current group selectors on a couple of other pages - (ExportTranslationsSpecialPage and AggregateGroupsSpecialPage). This would be maybe a big bit larger than small task. I'd recommend a separate task for this.
  4. After we implement step 2 above, if the entity selector is configured to fetch only message prefixes or groups, we could add pagination. This would help to implement the expected behavior mentioned in the feedback above. So if the user enters "G", then we will fetch 10 groups that contain "G", and as the user scrolls down, we'll fetch the next 10 and so on. The pagination is needed to ensure that the performance does not suffer due to use fetching all the groups/message prefixes at once. The whole change would be a medium sized task, but I'd also need a day to check if this is feasible using the existing OOUI components that we use.

The order of 3 and 4 is debatable. We could add 4 first and then replace the existing group selectors on those pages.

I'm going to go ahead and finish 2 under this task, and resolve it.

@Pginer-WMF, @Nikerabbit - Thoughts regarding 3 and 4?

Change 762743 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessageGroupStats: Add placeholder text for the entity selector

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

Change 764715 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslationEntitySearch: Add parameter to fetch only a certain entity

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

@Pginer-WMF, @Nikerabbit - Thoughts regarding 3 and 4?

The approach described makes sense to me. In that way, the initial set of results only involves loading a smaller part (enough to fill the visible list) and more are only loaded if the user really wants to browse and scrolls to look for more.

Items mentioned under 1) and 2) here are coded up.

I'll create a couple of more tasks to handle 3) and 4).

Change 764715 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslationEntitySearch: Add parameter to fetch specific entity types

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

Before deployment groups and messages are fetched:

image.png (532×868 px, 101 KB)

After deployment only groups are fetched:

image.png (473×873 px, 84 KB)

Created the following task to track other suggestions:

  1. T302281: Use group entity selector in other special pages
  2. T302280: Update the message group/prefix selector component to paginate results

Marking this task as done.