Page MenuHomePhabricator

Positive reinforcement: Revise skeleton state and behaviour of the Post-edit dialog
Closed, ResolvedPublic

Description

Problem

The post-edit dialog (and success message) can take a long time to appear since it loads the next suggested task before it appears. This delay may lead to the editor navigating away from the task without seeing the next suggestion.

  • Issue 1. The 'success' message and post-edit dialog takes very long to load on slow connections.
  • Issue 2. The current 'skeleton'; is not rendering correctly:
    • 2a. The image thumbnail skeleton goes blank/white for a couple of secs before loading
    • 2b. The wikidata description grey box is in the wrong location (not actually covering where the text appears when loaded.
Video of the current situation (en beta): Skeleton:
image.png (316×640 px, 58 KB)
Partially loaded state:
image.png (324×656 px, 62 KB)
Loaded state:
image.png (326×654 px, 93 KB)

Issue originally identified on T293316#7471066.

Proposed design

Figma design

image.png (1×1 px, 176 KB)

Proposed solution

  • Revise the loading behaviour so that the post-edit dialog is shown immediately after the success message", whilst the task is loading.
  • Ensure the skeleton (grey shimmer areas) are in the correct position above where content loads.

Event Timeline

RHo renamed this task from Add an image: Create a skeleton state of the Post-edit dialog to Add an image: Revise skeleton state and behaviour of the Post-edit dialog.May 18 2022, 4:00 PM
RHo renamed this task from Add an image: Revise skeleton state and behaviour of the Post-edit dialog to Positive reinforcement: Revise skeleton state and behaviour of the Post-edit dialog.Oct 19 2022, 1:31 PM
Sgs changed the task status from Open to In Progress.Feb 14 2023, 6:42 PM

Change 889505 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: show the task description skeleton while requesting the PCS

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

Change 889526 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: avoid showing the pageviews skeleton

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

Issue 1. The 'success' message and post-edit dialog takes very long to load on slow connections.

There's indeed an optimization we can do here as already mentioned in T293316#7471066. We can show the success message and open the drawer before having requested the tasks to the API. However that would leave us with a pretty empty panel since we wouldn't be able to render the amount of suggestions found "1 of 123 suggestions", neither the page title or task type. A different option could be to show the success message as soon as the edit is saved and after display the panel (with or without data). But I think we might come already from that status quo? What do you think we should do? @RHo @kostajh

Issue 2. The current 'skeleton'; is not rendering correctly:
2a. The image thumbnail skeleton goes blank/white for a couple of secs before loading

I think this loading bottleneck is restricted to the image of the first card, for the rest we preload them and I cannot perceive the blank gap. I'm not sure we can do much about it since that's how the browser processes the image loading. All I can think of is some CSS/HTML tricks to keep a gray background or the existing placeholder and stack the image on top. Ideas welcome.

2b. The wikidata description grey box is in the wrong location (not actually covering where the text appears when loaded.

What's happening is we're failing to show the skeleton for the page description (solved in 889505) while we're requesting the page content service and we're wrongly showing the skeleton for the pageviews data content (solved in 889526).

More findings: some confusing thing is we're indeed requesting pageviews data to the AQS even if we know we're not gonna display it. I can't tell if this is some kind of optimization or an undesired side effect of how the code was written since the SmallTaskCard is also used on the mobile homepage. I haven't found the original requirement that describes if the pageviews should show in the mobile overlay preview but my guess is they should and that's why we have support for it in the code and because of the bug report in T291510: [betalabs]Post-edit dialog: mw-ge-small-task-card-metadata-container attempts to load pageviews info and T263611: [wmf.10] mobile - mw-ge-small-task-card-pageviews skeleton persistently displayed in post-edit dialog . If so, we have another bug in production since we're not showing the number:

es.wikipedia.org
Screenshot 2023-02-15 at 11.23.27.png (508×1 px, 55 KB)
Homepage mobile summary task card not showing pageviews skeleton even if requesting the data
Screenshot 2023-02-15 at 11.20.43.png (530×1 px, 83 KB)
Homepage mobile summary task card not showing pageviews data even if requesting it

It would be nice to clarify this and fix the possible bug as part of this issue, even if we file a subtask for it. cc @RHo @KStoller-WMF @Etonkovidova

@Sgs Based on Newcomer homepage Figma designs, I don't think the page view data is supposed to display on the homepage summary task card.

Mobile homepage.png (1×362 px, 64 KB)

Currently most work is triggered by the postEdit JS hook, which is not a particularly helpful hook: sometimes it is triggered after the page has been reloaded, sometimes just before it reloads. Sometimes there is no reload at all (VE just replaces the editing interface with the saved content it fetches via API). So in theory we can preload most of the information the postedit panel is delayed on, e.g. have it ride the VE save API response, but then it might only be needed by the next response and we'd have to stash it in session storage. Also we'd have to account for the fact that some of the data comes from the server, some (PCS and the image thumbnail content, and possibly AQS) is fetched directly by the client; and that if we generate the data pre-save, the user's edit stats will be off by one.

All that is doable; do we think it is worth the effort?

Hi @Sgs - so I think my proposed solution is matches yours in that I think we should try to show the success message immediately while the post edit dialog is loading.
This would involve having a better skeleton state than the current behaviour for the post edit dialog, which I am more open to being different if there are issues with rendering more of the content than th proposed mock. To answer your second question, the pageviews is not meant to be shown here.

Hi @Sgs - so I think my proposed solution is matches yours in that I think we should try to show the success message immediately while the post edit dialog is loading.
This would involve having a better skeleton state than the current behaviour for the post edit dialog, which I am more open to being different if there are issues with rendering more of the content than th proposed mock.

Ack. I'll work on this. For the loading state we can add another skeleton for the title and display a text Loading suggestions... for the suggestion counter. For the task type I'm not sure about a right-aligned skeleton, your feedback is welcome. Also related with comment below.

To answer your second question, the pageviews is not meant to be shown here.

If that's the case, I don't think the pageviews are shown in any usage of the "small card" widget. Are they? We could left align the task type and display a standard skeleton for it. (The bug description for the pageviews skeleton would become a feature :)

Hi @Sgs - so I think my proposed solution is matches yours in that I think we should try to show the success message immediately while the post edit dialog is loading.
This would involve having a better skeleton state than the current behaviour for the post edit dialog, which I am more open to being different if there are issues with rendering more of the content than th proposed mock.

Ack. I'll work on this. For the loading state we can add another skeleton for the title and display a text Loading suggestions... for the suggestion counter. For the task type I'm not sure about a right-aligned skeleton, your feedback is welcome. Also related with comment below.

OK cool, I've updated the mock and figma to show skeleton for the task type in full-width of the text area (along with the title text). And suggest the proposed text can be the shorter Loading... as well. Hope that helps!

To answer your second question, the pageviews is not meant to be shown here.

If that's the case, I don't think the pageviews are shown in any usage of the "small card" widget. Are they? We could left align the task type and display a standard skeleton for it. (The bug description for the pageviews skeleton would become a feature :)

SGTM :)

Change 889505 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: show the task description skeleton while requesting the PCS

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

Change 889526 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: avoid showing the pageviews skeleton

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

Change 891607 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: show the pageviews in desktop

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

Change 891608 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Newcomer tasks store: mark null properties for failed requests to PCS and AQS

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

Change 891609 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: do not wait for tasks request to show the panel

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

Testing notes

Reminder:

Scenarios:

Common loading scenario

Screenshot 2023-02-23 at 19.50.10.png (796×1 px, 168 KB)
Screenshot 2023-02-23 at 19.50.14.png (692×1 px, 160 KB)
Screenshot 2023-02-23 at 19.50.20.png (782×1 px, 285 KB)
Edit is successfully saved and the panel shows up, tasks are being fetched in the backgroundTasks have been fetched, thumbnail, description and pageviews are being fetched from PCS and AQSPCS and AQS data is received, all task data is shown

Fetch tasks API failure

Screenshot 2023-02-23 at 19.50.10.png (796×1 px, 168 KB)
Screenshot 2023-02-23 at 20.35.38.png (502×1 px, 126 KB)
Edit is successfully saved and the panel shows up, tasks are being fetched in the backgroundAPI call fails

PCS request failure

Screenshot 2023-02-23 at 19.50.10.png (796×1 px, 168 KB)
Screenshot 2023-02-23 at 19.50.14.png (692×1 px, 160 KB)
Screenshot 2023-02-23 at 20.39.27.png (654×1 px, 143 KB)
Edit is successfully saved and the panel shows up, tasks are being fetched in the backgroundTasks have been fetched, thumbnail, description and pageviews are being fetched from PCS and AQSPCS fails AQS suceeds

AQS request failure

Screenshot 2023-02-23 at 19.50.10.png (796×1 px, 168 KB)
Screenshot 2023-02-23 at 19.50.14.png (692×1 px, 160 KB)
Screenshot 2023-02-23 at 20.43.04.png (684×1 px, 229 KB)
Edit is successfully saved and the panel shows up, tasks are being fetched in the backgroundTasks have been fetched, thumbnail, description and pageviews are being fetched from PCS and AQSPCS suceeds and AQS fails

Change 891607 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: show the pageviews in desktop

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

Change 891608 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Newcomer tasks store: mark null properties for failed requests to PCS and AQS

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

Change 896332 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: extract the fallback card construction to a separate method

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

Change 896332 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: extract the fallback card construction to a separate method

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

Change 891609 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Post edit panel: do not wait for tasks request to show the panel

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

Checked on testwiki wmf.1 - works as expected. Thx, @Sgs for the detailed screnshots!

Some examples of loading states:

Screen Shot 2023-03-24 at 3.18.33 PM.png (1×1 px, 527 KB)
Screen Shot 2023-03-24 at 3.24.31 PM.png (1×1 px, 665 KB)

mobile:

Screen Shot 2023-03-24 at 3.17.23 PM.png (1×728 px, 247 KB)
Screen Shot 2023-03-24 at 3.02.18 PM.png (662×742 px, 58 KB)