Page MenuHomePhabricator

NewImpact module: Implement unactivated state code from Impact.php
Closed, ResolvedPublic

Description

Steps to reproduce:
  1. On enwiki betalabs create a new account
  2. A new user goes to Special:Homepage where the Impact module Last edited shows incorrect value

Screen Shot 2022-10-28 at 5.31.00 PM.png (1×2 px, 398 KB)

The Console will display the error:

TypeError: Cannot read properties of undefined (reading 'days')
at Proxy.bestStreakDaysLocalisedCount
Expected behaviour/design
ScenarioDesktopMobileMobile summary (no change)
Scenario A: Person has 0 edits, Suggested edits is enabled. – Use the existing empty state
image.png (718×754 px, 96 KB)
image.png (1×720 px, 104 KB)
image.png (432×658 px, 57 KB)
Scenario B: Person has 0 edits, Suggested edits is *disabled*. – Use the empty state with references to Suggested edits removedReplace footer text
image.png (718×754 px, 95 KB)
Remove CTA button, replace footer text
image.png (1×720 px, 97 KB)
Same empty state
image.png (432×658 px, 57 KB)

Event Timeline

Once the impact module is complete, the empty state should display rather than an empty score card (with incorrect date).

IMG_2038 1.png (648×368 px, 82 KB)

@Sgs - thoughts on if this bug needs to be fixed, or if we can ignore the issue because it won't be noticeable once you've implemented the empty state?

Once the impact module is complete, the empty state should display rather than an empty score card (with incorrect date).

IMG_2038 1.png (648×368 px, 82 KB)

@Sgs - thoughts on if this bug needs to be fixed, or if we can ignore the issue because it won't be noticeable once you've implemented the empty state?

We should fix this by copying over the logic from the older impact module to show the unactivated state. We don't need to worry about code duplication or copy/paste because we'll be removing Impact.php when this epic is wrapped up.

image.png (786×948 px, 142 KB)

One change we'll want to make is to check $user->getTotalEditCount() instead of queryArticleEdits().

Etonkovidova renamed this task from Impact module: scorecards displays incorrect time for the Last edited to Impact module: scorecards display incorrect time for the Last edited.Nov 1 2022, 7:39 PM
kostajh renamed this task from Impact module: scorecards display incorrect time for the Last edited to NewImpact module: Implement unactivated state code from Impact.php.Nov 1 2022, 8:20 PM

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

[mediawiki/extensions/GrowthExperiments@master] [WIP] User impact: display empty state when user has no edits

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

We should fix this by copying over the logic from the older impact module to show the unactivated state. We don't need to worry about code duplication or copy/paste because we'll be removing Impact.php when this epic is wrapped up.

Do you mean to reuse also the OOUI client side code that implements the intermediate step of showing the "About suggested edits" dialog?

Screenshot 2022-11-07 at 16.41.13.png (1×2 px, 330 KB)

One change we'll want to make is to check $user->getTotalEditCount() instead of queryArticleEdits().

Alright, I will copy the logic from Impact->getArticleEditCount(). Do you think we should build the unactivated state markup in the server or the client? Since the total count is already avaialble when the Javascript loads it could make sense to not have to maintain server html generation at the cost of render time. But I'm fine with both approaches.

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

[mediawiki/extensions/GrowthExperiments@master] [WIP] User impact: add unactivated state

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

Change 854048 abandoned by Sergio Gimeno:

[mediawiki/extensions/GrowthExperiments@master] [WIP] User impact: add unactivated state

Reason:

Squashed in Id3c6064979b678ac24a1a3e32f55467f6ac72f3f

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

Sgs changed the task status from Open to In Progress.Nov 7 2022, 7:12 PM

While developing this issue we've come across the views for the "suggested edits disabled" state, see screenshots per view:

State/ViewDesktopSummaryOverlay
Suggested edits disabled
Screenshot 2022-11-09 at 12.15.59.png (416×1 px, 50 KB)
Screenshot 2022-11-09 at 12.16.25.png (326×1 px, 51 KB)
Screenshot 2022-11-09 at 12.17.24.png (908×812 px, 65 KB)
Suggested edits enabled, 0 edits to articles
Screenshot 2022-11-09 at 12.18.09.png (882×688 px, 141 KB)
Screenshot 2022-11-09 at 12.18.25.png (394×1 px, 78 KB)
Screenshot 2022-11-09 at 12.27.07.png (1×830 px, 175 KB)

Are the suggested edits disabled state views correct or we want to have some new display for these? @RHo

While developing this issue we've come across the views for the "suggested edits disabled" state, see screenshots per view:

State/ViewDesktopSummaryOverlay
Suggested edits disabled
Screenshot 2022-11-09 at 12.15.59.png (416×1 px, 50 KB)
Screenshot 2022-11-09 at 12.16.25.png (326×1 px, 51 KB)
Screenshot 2022-11-09 at 12.17.24.png (908×812 px, 65 KB)
Suggested edits enabled, 0 edits to articles
Screenshot 2022-11-09 at 12.18.09.png (882×688 px, 141 KB)
Screenshot 2022-11-09 at 12.18.25.png (394×1 px, 78 KB)
Screenshot 2022-11-09 at 12.27.07.png (1×830 px, 175 KB)

Are the suggested edits disabled state views correct or we want to have some new display for these? @RHo

Thanks for noticing this @Sgs - I think we should use the same "0 edits to articles" empty state of the impact module when Suggested edits is enabled, but remove the CTA on the mobile view to see suggested edits, and use the generic Once you start editing, you’ll see here how many people are viewing the articles you’ve edited. text string that is used on the mobile summary empty state. I'll update the task description as well to make this clear.

kostajh triaged this task as Medium priority.Nov 10 2022, 11:45 AM
RHo renamed this task from NewImpact module: Implement unactivated state code from Impact.php to NewImpact module: Implement unactivated state code from Impact.php with additional Summary scorecards added.Nov 10 2022, 12:19 PM
RHo updated the task description. (Show Details)

Hi @Sgs - I've added the intended new empty state of the Impact module which should have a couple of the scorecards present. Is this easily achieveable? If not, I can move adding this section as a new task for follow-up work for v2.

Hi @Sgs - I've added the intended new empty state of the Impact module which should have a couple of the scorecards present. Is this easily achieveable? If not, I can move adding this section as a new task for follow-up work for v2.

I have split the addition of scorecards in the subtask T322850. Not sure if we'll be able to fit it in the first release or v2 since we have a significant queue of tasks for v1.

Hi @Sgs - I've added the intended new empty state of the Impact module which should have a couple of the scorecards present. Is this easily achieveable? If not, I can move adding this section as a new task for follow-up work for v2.

I have split the addition of scorecards in the subtask T322850. Not sure if we'll be able to fit it in the first release or v2 since we have a significant queue of tasks for v1.

Super, thanks for doing that! I will update this one with the previous mocks.

RHo renamed this task from NewImpact module: Implement unactivated state code from Impact.php with additional Summary scorecards added to NewImpact module: Implement unactivated state code from Impact.php .Nov 10 2022, 1:57 PM
RHo updated the task description. (Show Details)

Change 853378 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] User impact: add disabled and unactivated state

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

Checked in wmf.12 - looks according to the specs (new-impact=1 url parameter was used) . The Suggested edits disabled state was checked on frwikitionary.

Suggested edits enabledSuggested edits disabled
Screen Shot 2022-12-01 at 4.38.30 PM.png (1×1 px, 184 KB)
Mobile
Screen Shot 2022-12-01 at 4.59.20 PM.png (1×712 px, 149 KB)
Screen Shot 2022-12-01 at 4.41.24 PM.png (1×546 px, 109 KB)
Screen Shot 2022-12-01 at 5.04.42 PM.png (844×1 px, 162 KB)
Screen Shot 2022-12-01 at 4.38.55 PM.png (966×676 px, 111 KB)
Screen Shot 2022-12-01 at 4.39.15 PM.png (1×578 px, 107 KB)