Variant D: difficulty overlay in onboarding
Closed, ResolvedPublic

Description

Remaining work:

  • Fix label alignment for desktop and mobile to be per the screenshots in my T258017#6644676 comment:

From T250343: Variant tests: D-desktop (and referred to in T250451: Variant tests: D-mobile):

  • Difficulty onboarding
    • After advancing from topic onboarding, the user sees content that is like a cross between the difficulty overlay from T235723: Newcomer tasks: intro and difficulty overlays and the difficulty filters from T235042: Newcomer tasks: implement difficulty filters. It has the top of the overlay (the header and sentence), but the bottom of the filters (the checkboxes and counter).
    • The user can select and deselect these different task types, essentially setting their filters in advance.
    • There is a "Back" button to return to the topic screen, and a button to "Get suggestions", which completes the onboarding.

For variant D, the first panel of the onboarding dialog (the intro overlay) is the same as currently (in variant A), but the second panel is different, as listed above. Also note that T258019: Variant D (desktop): embed onboarding dialog into suggested edits module calls for the onboarding dialog to be embedded in the suggested edits module on desktop (but not on mobile).

Mockups: desktop, mobile

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@RHo The task says that the top part of the difficulty overlay for variant D is the same as for variant A, but that doesn't appear to be completely true: in the variant D mocks, the image is missing, and the text "easy" is not colored green.

Is this an intentional difference? (It's OK if it is, just checking.)

Variant A (in production)Variant D (mock)
Screenshot from 2020-09-16 16-29-40.png (204×692 px, 32 KB)
Screenshot from 2020-09-16 16-27-33.png (129×657 px, 37 KB)

@RHo The task says that the top part of the difficulty overlay for variant D is the same as for variant A, but that doesn't appear to be completely true: in the variant D mocks, the image is missing, and the text "easy" is not colored green.

Is this an intentional difference? (It's OK if it is, just checking.)

Variant A (in production)Variant D (mock)
Screenshot from 2020-09-16 16-29-40.png (204×692 px, 32 KB)
Screenshot from 2020-09-16 16-27-33.png (129×657 px, 37 KB)

Hi @Catrope - thanks for checking, and yes, on Desktop the text is Base10 because it is on the pale blue background instead, where Green30 text does not pass colour contrast accessibility.
I also removed the image from desktop and mobile on variant D to simplify the screen a bit since we are allowing users to use the checkboxes in varD.

Change 628747 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] Factor out TaskTypeSelectionWidget

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

Change 628747 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Factor out TaskTypeSelectionWidget

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

Change 629051 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditing: Refactor CTA setup code

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

Change 629052 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Add TaskTypeSelectionWidget for variant D

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

Change 629053 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditing: Launch dialog from mobile summary button for variant D

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

Some additional styling questions for @RHo:

First, in variant A, and in the variant C mocks, the text color of the "There are many ways you can contribute..." subheader is lighter (base20) and smaller (14.8px) than that of the "Try some easy suggested edits first" header above it (base10, 16px). In the variant D mock, they're the same color and font size (both base10, 14px). Is that intended? Should these color and font size changes only apply in variant D? Or should they apply in all variants, or in none of them? (Any of these answers is easy to implement, I just want to know.)

Second, the styling of the "task type selector" (the Easy, Medium and Hard headers, the checkboxes, and their labels) in this mock is pretty different between desktop and mobile:

  • The headers are colored on mobile, but not on desktop
  • The subheaders are bolded on mobile, but not on desktop
  • The font sizes are generally larger on mobile (18px/16px vs 16px/14px)
  • The subheaders have a smaller font size (14.8px) than the checkbox labels (16px) on mobile, but the same font size on desktop (14px)
  • The vertical separation between the three sections is larger on mobile (24px) than on desktop (16px), even as a proportion of the font size of the header (1.333em vs 1em)

Are these differences intentional? Should these changes also be applied to the task type selector that appears when you click the "Easy tasks" button in the (activated) suggested edits module to change your task type selections later? If so, should those changes apply in variants A and C as well? (Applying these changes only to variant D or only to one of the occurrences of the task type selector would be doable, but a bit annoying, so I'd prefer to apply them universally.)

This is working and ready for review, except for the styling tweaks that I asked Rita about above.

Change 629051 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditing: Refactor CTA setup code

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

Change 629052 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Add TaskTypeSelectionWidget for variant D

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

Change 629053 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditing: Launch dialog from mobile summary for variant D

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

Change 629500 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/GrowthExperiments@master] Load extra data for mobile summary task preview after initiation

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

Change 629500 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Load extra data for mobile summary task preview after initiation

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

Change 629526 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Fix sizing/position of intro image in variant D

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

Change 629526 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Fix sizing/position of intro image in variant D

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

Change 629954 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] TaskTypeSelectionWidget: Add mobile-specific styling

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

Second, the styling of the "task type selector" (the Easy, Medium and Hard headers, the checkboxes, and their labels) in this mock is pretty different between desktop and mobile:

  • The headers are colored on mobile, but not on desktop
  • The subheaders are bolded on mobile, but not on desktop
  • The font sizes are generally larger on mobile (18px/16px vs 16px/14px)
  • The subheaders have a smaller font size (14.8px) than the checkbox labels (16px) on mobile, but the same font size on desktop (14px)
  • The vertical separation between the three sections is larger on mobile (24px) than on desktop (16px), even as a proportion of the font size of the header (1.333em vs 1em)

Are these differences intentional? Should these changes also be applied to the task type selector that appears when you click the "Easy tasks" button in the (activated) suggested edits module to change your task type selections later? If so, should those changes apply in variants A and C as well? (Applying these changes only to variant D or only to one of the occurrences of the task type selector would be doable, but a bit annoying, so I'd prefer to apply them universally.)

My TaskTypeSelectionWidget patch assumes that the answers to these questions are: these changes are intentional; they should apply to the task type selection UI both in the onboarding flow and in the dialog where you can change your filters later; they should only apply in variant D and only on mobile. If any of those assumptions are wrong, I can update my patch to address that.

First, in variant A, and in the variant C mocks, the text color of the "There are many ways you can contribute..." subheader is lighter (base20) and smaller (14.8px) than that of the "Try some easy suggested edits first" header above it (base10, 16px). In the variant D mock, they're the same color and font size (both base10, 14px). Is that intended? Should these color and font size changes only apply in variant D? Or should they apply in all variants, or in none of them? (Any of these answers is easy to implement, I just want to know.)

And to close this loop: my patches up for review assume that these color and font size changes should be specific to variant D.

hi @Catrope - thanks for your attention to detail on some of these discrepancies. Per my comment on this patch, I messed up font stylings in a few places which was causing inconsistent font-size mappings from Desktop to Mobile. I've now updated the Zeplin mocks to correct this, along with the colour differences across Mobile/Desktop and the variants. Detailed revisions are as follows:

1. Header text for overlays ("Suggested edits to get started" and "Try some...") should use the OOUI fieldset header text style, which on Desktop is 16px (per current), and on Mobile is ~18.28px.
This font-size applies to the case for Variant D on the "Try some easy suggested edits only" header in font-size.

Some additional styling questions for @RHo:
First, in variant A, and in the variant C mocks, the text color of the "There are many ways you can contribute..." subheader is lighter (base20) and smaller (14.8px) than that of the "Try some easy suggested edits first" header above it (base10, 16px). In the variant D mock, they're the same color and font size (both base10, 14px). Is that intended? Should these color and font size changes only apply in variant D? Or should they apply in all variants, or in none of them? (Any of these answers is easy to implement, I just want to know.)

2. Intro text ("Wikipedia is built collab..." and "There are many ways...") should use the OOUI UI text style, which on Desktop is 14px, and on Mobile is 16px. Accordingly, I think there is no amazing reason for the different colours across variants, so let's make all of them Base10.

Second, the styling of the "task type selector" (the Easy, Medium and Hard headers, the checkboxes, and their labels) in this mock is pretty different between desktop and mobile:

  • The headers are colored on mobile, but not on desktop

3. Task type selector - uses the fieldset header style (Desktop 16px, Mobile 18.28px).
Standardized to use corresponding coloured text on Mobile and Desktop.

  • The subheaders are bolded on mobile, but not on desktop

4. Task type subheaders - uses the smaller 'UI tag' style (Desktop 13px, Mobile 14.8px) and with both bolded.

5. Task type additional info - this is the info under the subheaderes on variant C (eg. "Copyediting and adding links to other articles")
Additional task info text style should use the inline help text style which on Desktop is 13px and on Mobile is 14.8px, and should be coloured Base20.

  • The font sizes are generally larger on mobile (18px/16px vs 16px/14px)
  • The subheaders have a smaller font size (14.8px) than the checkbox labels (16px) on mobile, but the same font size on desktop (14px)

This should be fixed with the updates that I am detailing in this comment.

  • The vertical separation between the three sections is larger on mobile (24px) than on desktop (16px), even as a proportion of the font size of the header (1.333em vs 1em)

Let's make this 24px for mobile and desktop.

Are these differences intentional? Should these changes also be applied to the task type selector that appears when you click the "Easy tasks" button in the (activated) suggested edits module to change your task type selections later? If so, should those changes apply in variants A and C as well? (Applying these changes only to variant D or only to one of the occurrences of the task type selector would be doable, but a bit annoying, so I'd prefer to apply them universally.)

Universal changes works for me.

hi @Catrope - thanks for your attention to detail on some of these discrepancies. Per my comment on this patch, I messed up font stylings in a few places which was causing inconsistent font-size mappings from Desktop to Mobile. I've now updated the Zeplin mocks to correct this, along with the colour differences across Mobile/Desktop and the variants. Detailed revisions are as follows:

1. Header text for overlays ("Suggested edits to get started" and "Try some...") should use the OOUI fieldset header text style, which on Desktop is 16px (per current), and on Mobile is ~18.28px.
This font-size applies to the case for Variant D on the "Try some easy suggested edits only" header in font-size.

[...]

2. Intro text ("Wikipedia is built collab..." and "There are many ways...") should use the OOUI UI text style, which on Desktop is 14px, and on Mobile is 16px. Accordingly, I think there is no amazing reason for the different colours across variants, so let's make all of them Base10.

I have addressed these points by amending the patch you referred to.

3. Task type selector - uses the fieldset header style (Desktop 16px, Mobile 18.28px).

Done in the TaskTypeSelectionWidget patch.

Standardized to use corresponding coloured text on Mobile and Desktop.

I don't see this change in the mocks, but I'm assuming that you want me to use colored text on both mobile and desktop, in all variants. Let me know if that's not what you want.

  • The subheaders are bolded on mobile, but not on desktop

4. Task type subheaders - uses the smaller 'UI tag' style (Desktop 13px, Mobile 14.8px) and with both bolded.

Done in the TaskTypeSelectionWidget patch.

5. Task type additional info - this is the info under the subheaderes on variant C (eg. "Copyediting and adding links to other articles")
Additional task info text style should use the inline help text style which on Desktop is 13px and on Mobile is 14.8px, and should be coloured Base20.

Done in the TaskTypeSelectionWidget patch (even though it's technically not part of TaskTypeSelectionWidget).

  • The font sizes are generally larger on mobile (18px/16px vs 16px/14px)
  • The subheaders have a smaller font size (14.8px) than the checkbox labels (16px) on mobile, but the same font size on desktop (14px)

This should be fixed with the updates that I am detailing in this comment.

Yes, it is.

  • The vertical separation between the three sections is larger on mobile (24px) than on desktop (16px), even as a proportion of the font size of the header (1.333em vs 1em)

Let's make this 24px for mobile and desktop.

Done in the TaskTypeSelectionWidget patch.

Are these differences intentional? Should these changes also be applied to the task type selector that appears when you click the "Easy tasks" button in the (activated) suggested edits module to change your task type selections later? If so, should those changes apply in variants A and C as well? (Applying these changes only to variant D or only to one of the occurrences of the task type selector would be doable, but a bit annoying, so I'd prefer to apply them universally.)

Universal changes works for me.

Yay! That makes it easier.

Change 629954 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] TaskTypeSelectionWidget: Styling tweaks

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

Etonkovidova subscribed.

For Design review - looks according to the specs - only the space between two elements
"mw-ge-startediting-dialog-difficulty-banner" and "mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-easy" is rather tight.

Screen Shot 2020-09-29 at 4.08.29 PM.png (656×536 px, 92 KB)

The screenshots below are just for the overall look:

Desktopmobile
Screen Shot 2020-09-29 at 4.04.10 PM.png (711×1 px, 165 KB)
Screen Shot 2020-09-29 at 4.18.19 PM.png (493×284 px, 57 KB)

@RHo, @Catrope

  • The font sizes are generally larger on mobile (18px/16px vs 16px/14px)

This should be fixed with the updates that I am detailing in this comment.

Yes, it is.

Just double-checking (and I looked at the mock and at the patch ) - so, now

.mw-ge-startediting-dialog-intro-topic-title {
    color: #202122;
    font-weight: bold;
    font-size: 1.14285714em;
    line-height: 1.375;

Question: That's how it's supposed to be - 18px as it is now in betalabs? Bigger than it's currently in produciton? I see in the browser mobile emulator font-size 18px (and from the font-size: 1.14285714em; =17.54 px -close enough).

Screen Shot 2020-09-30 at 4.41.42 PM.png (319×276 px, 43 KB)

In production, the title font is smaller.

Screen Shot 2020-09-30 at 4.46.02 PM.png (440×430 px, 64 KB)

I believe that is correct, @RHo said that verbatim here:

1. Header text for overlays ("Suggested edits to get started" and "Try some...") should use the OOUI fieldset header text style, which on Desktop is 16px (per current), and on Mobile is ~18.28px.

Thanks @Etonkovidova - yes the header suggested on Desktop as font-size:16px (and Mobile 18.28px) is correct, but the spacing between the top section and difficulty levels is not quite right as you noted, so putting back to needs more work for padding fixes. Specifically:

Actual:
image.png (614×896 px, 76 KB)
image.png (1×3 px, 422 KB)
Expected:
image.png (298×1 px, 103 KB)

a. Similar to comment on T258019#6510238 - please make the Desktop left and right padding 16px for the module
b. The bottom padding under the intro paragraph should be 24px (not 21px - this seems to have been a Zeplin error with export, sorry about that)

Actual:
image.png (122×566 px, 7 KB)
Expected:
image.png (184×1 px, 39 KB)

c. Spacing between the first "Easy" header and the bottom of the pale blue background should be 24px

Actual:
image.png (222×1 px, 43 KB)
Expected:
image.png (222×1 px, 79 KB)

d. Spacing between last checkbox item and module footer should be 24px

Actual:
image.png (362×1 px, 63 KB)
Expected:
image.png (170×1 px, 51 KB)

e. Module footer should be ~56px height as the buttons should have padding: 12px 16px on desktop (not 24px as shown in the Actual screenshot)

Actual:
image.png (238×500 px, 11 KB)
Expected:
image.png (514×1 px, 59 KB)

f. Results counter should be vertically centered in the module footer

Actual:
image.png (504×694 px, 58 KB)
Expected:
image.png (422×862 px, 23 KB)

g. Icon (20x20px) and difficulty text should be vertically centered, with 8px space between them

Change 634389 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Styling tweaks

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

a. Similar to comment on T258019#6510238 - please make the Desktop left and right padding 16px for the module

This is fixed now, with Kosta's patch for that issue.

b. The bottom padding under the intro paragraph should be 24px (not 21px - this seems to have been a Zeplin error with export, sorry about that)

Fixed in my patch. That also keeps it as 24px on mobile (since it was previously 1.5em, and 1.5*14=21 , 1.5*16=24). But the Zeplin mocks have this at 16px on mobile. Is that accurate, and should I make that change?

c. Spacing between the first "Easy" header and the bottom of the pale blue background should be 24px

Same story here: it's currently 21px/24px, I'm making it 24/24, but the mocks say 24/16, so please advise whether it should be 24px or 16px on mobile.

d. Spacing between last checkbox item and module footer should be 24px

Similar story: currently 21/24, changing it to 24/24, but in this case the mocks actually say 24/24.

e. Module footer should be ~56px height as the buttons should have padding: 12px 16px on desktop (not 24px as shown in the Actual screenshot)
f. Results counter should be vertically centered in the module footer

I don't see these issues, they must have been fixed since your comment (since your comment is 2 weeks old and I somehow missed it until today).

Screenshot from 2020-10-15 17-58-30.png (269×848 px, 32 KB)

g. Icon (20x20px) and difficulty text should be vertically centered, with 8px space between them

Padding fixed in my patch. I think the text centering has already been fixed, please confirm.

Screenshot from 2020-10-15 18-03-09.png (175×370 px, 17 KB)
Screenshot from 2020-10-15 18-03-19.png (133×354 px, 14 KB)

Change 634755 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Make image in difficulty banner top aligned, fix padding

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

Change 634755 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Make image in difficulty banner top aligned, fix padding

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

This patch does the 24/16 thing for item (c).

Change 634389 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Styling tweaks

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

Change 634755 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Make image in difficulty banner top aligned, fix padding

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

Change 635904 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Use smaller padding for mobile in various places

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

Change 634755 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Make image in difficulty banner top aligned, fix padding

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

This patch does the 24/16 thing for item (c).

Whoops, I meant (b).

Change 635904 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Use smaller padding for mobile in various places

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

This one does the 24->16px change for (c) and (d).

Change 635904 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] StartEditingDialog: Use smaller padding for mobile in various places

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

Checked

a. Similar to comment on T258019#6510238 - please make the Desktop left and right padding 16px for the module

This is fixed now, with Kosta's patch for that issue.

Done

Screen Shot 2020-11-04 at 11.58.21 AM.png (361×699 px, 58 KB)

b. The bottom padding under the intro paragraph should be 24px (not 21px - this seems to have been a Zeplin error with export, sorry about that)

Fixed in my patch. That also keeps it as 24px on mobile (since it was previously 1.5em, and 1.5*14=21 , 1.5*16=24). But the Zeplin mocks have this at 16px on mobile. Is that accurate, and should I make that change?

Done

DesktopMobile
Screen Shot 2020-11-04 at 12.02.04 PM.png (362×715 px, 63 KB)
Screen Shot 2020-11-04 at 12.10.55 PM.png (479×442 px, 69 KB)

c. Spacing between the first "Easy" header and the bottom of the pale blue background should be 24px

Same story here: it's currently 21px/24px, I'm making it 24/24, but the mocks say 24/16, so please advise whether it should be 24px or 16px on mobile.

Desktop 24pxMobile 16px
Screen Shot 2020-11-04 at 12.35.33 PM.png (553×514 px, 76 KB)
Screen Shot 2020-11-04 at 12.22.45 PM.png (323×508 px, 44 KB)
Screen Shot 2020-11-04 at 12.31.40 PM.png (486×389 px, 62 KB)

d. Spacing between last checkbox item and module footer should be 24px

Similar story: currently 21/24, changing it to 24/24, but in this case the mocks actually say 24/24.

Desktop 24pxMobile 16px
Screen Shot 2020-11-04 at 12.18.59 PM.png (502×565 px, 75 KB)
Screen Shot 2020-11-04 at 12.16.42 PM.png (702×550 px, 88 KB)

CSS - to clarify mobile screnshots

.growthexperiments-homepage-mobile-summary .mw-ge-startediting-dialog-difficulty-legend, .growthexperiments-homepage-mobile-summary .mw-ge-startediting-dialog-difficulty-taskTypeSelector, .growthexperiments-homepage-mobile-details .mw-ge-startediting-dialog-difficulty-legend, .growthexperiments-homepage-mobile-details .mw-ge-startediting-dialog-difficulty-taskTypeSelector {
    padding: 16px 16px;
}

e. Module footer should be ~56px height as the buttons should have padding: 12px 16px on desktop (not 24px as shown in the Actual screenshot)
f. Results counter should be vertically centered in the module footer

I don't see these issues, they must have been fixed since your comment (since your comment is 2 weeks old and I somehow missed it until today).

Screenshot from 2020-10-15 17-58-30.png (269×848 px, 32 KB)

As @Catrope said - seems to be fixed.

DesktopMobile
Screen Shot 2020-11-04 at 12.48.28 PM.png (256×734 px, 44 KB)
Screen Shot 2020-11-04 at 12.47.13 PM.png (312×502 px, 41 KB)

g. Icon (20x20px) and difficulty text should be vertically centered, with 8px space between them

Padding fixed in my patch. I think the text centering has already been fixed, please confirm.

Screenshot from 2020-10-15 18-03-09.png (175×370 px, 17 KB)
Screenshot from 2020-10-15 18-03-19.png (133×354 px, 14 KB)

Done - the above screenshots are correct.

Checked again and only part of item (g) – the vertical alignment of the text to icon is not quite right.

ExpectedActual
a. Desktop left and right padding 16px & b. Desktop - bottom padding under the intro paragraph should be 24px
image.png (916×1 px, 127 KB)
c. Desktop Spacing between the first "Easy" header and the bottom of the pale blue background should be 24px
image.png (562×1 px, 70 KB)
d. Desktop Spacing between last checkbox item and module footer should be 24px
image.png (572×1 px, 85 KB)
e. Module footer should be ~56px height as the buttons should have padding: 12px 16px on desktop
f. Results counter should be vertically centered in the module footer
image.png (500×826 px, 53 KB)
g. Icon (20x20px) and difficulty text should be vertically centered, with 8px space between them
image.png (368×690 px, 36 KB)
image.png (520×782 px, 61 KB)
8px space is right, but text is not vertically centered with icon on Desktop. Note that on Mobile vertical alignment looks more vertically centered since the font-size is larger but could still be ~2px lower.
image.png (368×690 px, 36 KB)

If you have suggestions for how to fix the text alignment (item (g) in your comment above), I'm all ears. Both the text and the icon have vertical-align: middle, and neither has vertical padding or margin, so I don't know what else to do.

This has been a recurring problem with our custom icons (see the icon before the result count at the bottom of the same dialog, the icons on the task card, the difficulty dialog etc), IIRC in other instances we either ignored it or just added some padding to the icon and tweaked the size until it looked right (with default zoom/font settings anyway). Would be nice to figure out what the proper fix is.

hi @Catrope and @Tgr - one suggestion I have is if we can incorporate the icon to the label element using teh ::before selector instead, as this makes it easier to control the positioning in reference to the text label.
This is what I did for the task types filter instead and it works on both mobile and desktop:

.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-easy h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label:before {
  content: '';
  background-image: url(/w/load.php?modules=ext.growthExperiments.Homepage.icons&image=difficulty-easy&format=rasterized&lang=cs&skin=minerva&version=162dj);
  background-image: linear-gradient(transparent,transparent),url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22%3E %3Cpath d=%22M21 3v18h-5V3h5zm-6 6v12h-5V9h5zm-6 6v6H3v-6h6zM20 4h-3v16h3V4zm-6 6h-3v10h3V10z%22 fill=%22%2314866d%22/%3E %3C/svg%3E");
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding-left: 1.5em;
}

.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-medium h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label:before {
  content: '';
  background-image: url(/w/load.php?modules=ext.growthExperiments.Homepage.icons&image=difficulty-medium&format=rasterized&lang=cs&skin=minerva&version=162dj);
  background-image: linear-gradient(transparent,transparent),url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22%3E %3Cpath d=%22M21 3v18h-5V3h5zm-6 6v12h-5V9h5zm-6 6v6H3v-6h6zM20 4h-3v16h3V4z%22 fill=%22%23ac6600%22/%3E %3C/svg%3E");
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding-left: 1.5em;
}

.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-hard h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label:before {
  content: '';
  background-image: url(/w/load.php?modules=ext.growthExperiments.Homepage.icons&image=difficulty-hard&format=rasterized&lang=cs&skin=minerva&version=162dj);
  background-image: linear-gradient(transparent,transparent),url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22%3E %3Cpath d=%22M21 3v18h-5V3h5zm-6 6v12h-5V9h5zm-6 6v6H3v-6h6z%22 fill=%22%23b32424%22/%3E %3C/svg%3E");
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding-left: 1.5em;
}

The above plus removing the respective <span> icon elements before the h4's and removing the padding-left on the class .h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label makes the icons align better on both Desktop and Mobile:

Desktop
image.png (1×2 px, 430 KB)
Mobile
image.png (1×3 px, 914 KB)

Could this work for us, and if so be applied to other places where were have these icon+label elements?
Incidentally, I got this idea from how the language icon is shown in CX

image.png (642×1 px, 162 KB)
.

Interesting that removing margin-top: 0 from h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label produces a good-enough alignment effect:

margin-top: 0margin-top: 0
Screen Shot 2020-11-30 at 3.54.11 PM.png (141×338 px, 7 KB)
Screen Shot 2020-11-30 at 3.53.54 PM.png (156×454 px, 8 KB)
Screen Shot 2020-11-30 at 3.20.29 PM.png (162×850 px, 22 KB)
Screen Shot 2020-11-30 at 3.46.16 PM.png (185×825 px, 22 KB)
Screen Shot 2020-11-30 at 3.23.41 PM.png (443×708 px, 59 KB)
Screen Shot 2020-11-30 at 3.22.33 PM.png (454×701 px, 59 KB)

@Catrope has this mostly complete and just has to clean it up and submit it. He will poke at it, but not more than another hour or two.

@Catrope sent me this in case it's useful to whoever picks this task up.

diff --git a/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.js b/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.js
index 44712b3a..0e44d652 100644
--- a/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.js
+++ b/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.js
@@ -134,7 +134,7 @@ TaskTypeSelectionWidget.prototype.makeHeadersForDifficulty = function ( difficul
                        'mw-ge-homepage-taskTypeSelectionWidget-difficulty-level ' +
                        'mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-' + difficulty
                )
-               .append( iconWidget.$element, $label, $description );
+               .append( /* iconWidget.$element, */ $label, $description );
 };
 
 /**
diff --git a/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.less b/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.less
index 32156910..10bbaf3e 100644
--- a/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.less
+++ b/modules/homepage/suggestededits/ext.growthExperiments.Homepage.TaskTypeSelectionWidget.less
@@ -31,9 +31,29 @@
                padding-bottom: 0;
                margin-top: 0;
                margin-bottom: 0;
-               // Align with icon
-               vertical-align: middle;
-               padding-left: 8px;
+
+               &:before {
+                       content: '';
+                       padding-left: 1.5em;
+                       background-position: bottom left;
+                       background-repeat: no-repeat;
+                       background-size: 20px 20px;
+
+                       .mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-easy & {
+                               /* @embed */
+                               background-image: url( ../../../images/difficulty-easy-ltr.svg );
+                       }
+
+                       .mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-medium & {
+                               /* @embed */
+                               background-image: url( ../../../images/difficulty-medium-ltr.svg );
+                       }
+
+                       .mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-hard & {
+                               /* @embed */
+                               background-image: url( ../../../images/difficulty-hard-ltr.svg );
+                       }
+               }
        }
 
        .oo-ui-checkboxMultiselectWidget {

Checked in wmf.7 - it seems that the issue is still present

Screen Shot 2021-06-07 at 5.47.39 PM.png (226×574 px, 35 KB)
Screen Shot 2021-06-07 at 5.56.15 PM.png (775×778 px, 100 KB)

Moving to Incoming.

Note: labels gets aligned with padding-top: 0;
h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label

Screen Shot 2021-06-07 at 5.53.21 PM.png (650×779 px, 82 KB)

Checked in wmf.7 - it seems that the issue is still present

Screen Shot 2021-06-07 at 5.47.39 PM.png (226×574 px, 35 KB)
Screen Shot 2021-06-07 at 5.56.15 PM.png (775×778 px, 100 KB)

Moving to Incoming.

Note: labels gets aligned with padding-top: 0;
h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label

Screen Shot 2021-06-07 at 5.53.21 PM.png (650×779 px, 82 KB)

@RHo could you please confirm that you want the proposed alignment from F34486359?

Checked in wmf.7 - it seems that the issue is still present

Screen Shot 2021-06-07 at 5.47.39 PM.png (226×574 px, 35 KB)
Screen Shot 2021-06-07 at 5.56.15 PM.png (775×778 px, 100 KB)

Moving to Incoming.
Note: labels gets aligned with padding-top: 0;
h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label

Screen Shot 2021-06-07 at 5.53.21 PM.png (650×779 px, 82 KB)

@RHo could you please confirm that you want the proposed alignment from F34486359?

Hi @kostajh - yes, to confirm, I would like the alignment for desktop and mobile to be per the screenshots in my T258017#6644676 comment:

hi @Catrope and @Tgr - one suggestion I have is if we can incorporate the icon to the label element using teh ::before selector instead, as this makes it easier to control the positioning in reference to the text label.
-[...]
The above plus removing the respective <span> icon elements before the h4's and removing the padding-left on the class .h4.mw-ge-homepage-taskTypeSelectionWidget-difficulty-level-label makes the icons align better on both Desktop and Mobile:

Desktop
image.png (1×2 px, 430 KB)
Mobile
image.png (1×3 px, 914 KB)

Change 711218 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Difficulty Overlay: align icon & label at baseline

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

Updated the alignment of the difficulty icon and label to be per F34486359 (align at baseline)

Desktop:

Screen Shot 2021-08-10 at 3.19.51 PM.png (1×1 px, 280 KB)

Mobile:

Screen Shot 2021-08-10 at 3.20.27 PM.png (1×1 px, 242 KB)

Change 711218 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Difficulty Overlay: align icon & label at baseline

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

The fix is in place - checked in betalabs:

Screen Shot 2021-08-11 at 11.30.58 AM.png (1×1 px, 228 KB)
Screen Shot 2021-08-11 at 11.33.00 AM.png (1×750 px, 148 KB)

Checked on testwiki wmf.19 - works as expected.