Page MenuHomePhabricator

Add an image: captions
Closed, ResolvedPublic

Description

After the user selects "Yes" on the image inspector (T290045), they are taken to the caption step. This is a WYSIWYG "in context" experience.
==== Note: Final copy updated below - see relevant tab for corresponding QQQ in the copy spreadsheet: ====

  • Animation on arrival
    • While the image is loading, the user should see a gray placeholder for the image at the top of the article.
    • The header should have a spinner and say, Loading image preview...
    • Once loaded, the header text shown is Add a caption with a back arrow that returns to the image inspector step.
    • Ideally, the gray placeholder should be the same size and shape of the incoming image, but we want to inherit whatever Visual Editor does by default if possible.
    • At this time, the image inspector also animates down and away.
    • The focus should be such that the caption box is about a third of the way down the screen. The user should be able to see the bottom of the image preview, the caption box, and the top of the article.
    • We want this animation to take about a half second.
  • Onboarding
  • Caption adding experience
    • Nice to have: after the user dismisses the onboarding (or if they don't get onboarding), the focus should be in the caption box with the device keyboard open.
    • The article text should be shown at Base20 color here instead of black.
    • The image preview should be at the top of the article.
    • On the bottom of the image preview is a row of gray overlay, which on the righthand side says, View image details with an "i" icon. Tapping anywhere on this row opens the image details dialog. See T290782: Add an image: image details.
    • Below the image preview is the caption box.
      • It contains hint text: Write a short caption describing how this image is relevant to “$PageTitle”.. The actual name of the article should be substituted in. The hint text should be in the UI language, not the content language, but the article title will be in the content language.
      • In the lower right, it contains a question mark icon, which brings up the onboarding dialog in T292887. There is an invisible label to Help with writing an image caption on this icon. When brought up from this interaction, the Don't show again checkbox should not be present in the caption help dialog.
      • As the user writes their captions, the caption area grows dynamically if the user writes a lot of text (as opposed to being a scrollable area).
    • Caption validation
    • Until the user puts text in the caption box, the Publish button in the upper right is not active.
    • Once they have some text, the button turns blue and they are able to tap it. It takes them to the edit summary screen: T290784: Add an image: edit summary and publish.
  • If the user taps the back arrow in the header, they should return to the image inspector step without their selection chosen. In other words, it should look exactly as it did when they first arrived on the image inspector at the start of the task.

Mockup as of 2021-10-08:

image.png (1×1 px, 1 MB)

Figma: https://www.figma.com/file/ULhJr1isDstRbGE5vjYDsr/Add-images-structured-task?node-id=3043:10770

Event Timeline

MMiller_WMF renamed this task from Add an image: captions (PLACEHOLDER) to Add an image: captions.Oct 9 2021, 1:33 AM
MMiller_WMF removed MMiller_WMF as the assignee of this task.
MMiller_WMF updated the task description. (Show Details)
MMiller_WMF updated the task description. (Show Details)
MMiller_WMF removed a subscriber: Mmiller0712.

This now contains the latest mockups and our notes from the deep dive. It is no longer a placeholder and is Ready for Development.

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: Basic inline caption functionality

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

Hi @MMiller_WMF @RHo I wanted to follow up on this requirement to bring up the keyboard programmatically.

After the user dismisses the onboarding (or if they don't get onboarding), the focus should be in the caption box with the device keyboard open.

On iOS, there is no way to do this since the OS doesn't allow the virtual keyboard to be invoked without a user action (https://bugs.webkit.org/show_bug.cgi?id=195884#c4). I'm not entirely sure about Android, but from my limited testing today, the behavior seems to be the same as in iOS (programmatically focusing on the text area doesn't do anything; focusing on the text area in response to a button click does bring up the virtual keyboard).

Hi @MMiller_WMF @RHo I wanted to follow up on this requirement to bring up the keyboard programmatically.

After the user dismisses the onboarding (or if they don't get onboarding), the focus should be in the caption box with the device keyboard open.

On iOS, there is no way to do this since the OS doesn't allow the virtual keyboard to be invoked without a user action (https://bugs.webkit.org/show_bug.cgi?id=195884#c4). I'm not entirely sure about Android, but from my limited testing today, the behavior seems to be the same as in iOS (programmatically focusing on the text area doesn't do anything; focusing on the text area in response to a button click does bring up the virtual keyboard).

Hi @mewoph - I was wanting the same behaviour to occur as on the add image prototype where the virtual keyboard does come up when the caption is shown, at least on Android (and I am pretty sure on iOS tests as well). Here's a screencast from my phone:

Based on your assessment that this happens only in response to a button click, could we link the focus-and-invoke-keyboard action to when the user selects "Done" to close the caption onboarding dialog (if the onboarding is being shown), or else to the "Yes" selection for the image (when caption onboarding is not shown)?

Hi @mewoph - I was wanting the same behaviour to occur as on the add image prototype where the virtual keyboard does come up when the caption is shown, at least on Android (and I am pretty sure on iOS tests as well). Here's a screencast from my phone:

Here is a screen recording of the same flow in the prototype from an iPhone: https://drive.google.com/file/d/1mIiBcsHdZVn5oGjKK2tIlPfGWFDE2Crf/view?usp=sharing. Even in regular editing mode, when the article is first opened, the keyboard doesn't appear. This is by iOS's design/limitations and I'm not sure there's a good way around that.

Based on your assessment that this happens only in response to a button click, could we link the focus-and-invoke-keyboard action to when the user selects "Done" to close the caption onboarding dialog (if the onboarding is being shown), or else to the "Yes" selection for the image (when caption onboarding is not shown)?

It might be possible, but it could (likely) add to the timeline (cc: @kostajh @DMburugu). Based on the current setup, I don't think the effort will be trivial.

@mewoph -- thanks for bringing this up. What experience do you recommend we make here that doesn't increase the scope?

Change 730942 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: Basic inline caption functionality

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

Hi @mewoph - I was wanting the same behaviour to occur as on the add image prototype where the virtual keyboard does come up when the caption is shown, at least on Android (and I am pretty sure on iOS tests as well). Here's a screencast from my phone:

Here is a screen recording of the same flow in the prototype from an iPhone: https://drive.google.com/file/d/1mIiBcsHdZVn5oGjKK2tIlPfGWFDE2Crf/view?usp=sharing. Even in regular editing mode, when the article is first opened, the keyboard doesn't appear. This is by iOS's design/limitations and I'm not sure there's a good way around that.

Based on your assessment that this happens only in response to a button click, could we link the focus-and-invoke-keyboard action to when the user selects "Done" to close the caption onboarding dialog (if the onboarding is being shown), or else to the "Yes" selection for the image (when caption onboarding is not shown)?

It might be possible, but it could (likely) add to the timeline (cc: @kostajh @DMburugu). Based on the current setup, I don't think the effort will be trivial.

Ah, thanks for pointing this out and sorry I misremembered the iOS test behaviour! But it does seem like this is an iOS-specific? @MMiller_WMF given that the user will see the caption onboarding and it is iOS-only, and it is essentially the only input field on the screen, maybe we can descope (break into a "later" task) the need force virtual keyboard on iOS from the initial iteration?

@mewoph -- thanks for working on this issue with the keyboard. I agree with @RHo that we should relax the requirement now to pop open the keyboard automatically. Let's proceed without that, and we can talk about it again later if we realize while testing the experience that it's necessary. I'll update the task description.

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: loading states for caption

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

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: view image details button

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

Change 732091 abandoned by MewOphaswongse:

[mediawiki/extensions/GrowthExperiments@master] Add an image: view image details button

Reason:

Squashed changes into https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/ /732034/2

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

Here are the flows w/the latest changes (autofocusing on the input field hasn't been implemented):

iOS:

caption_ios.gif (1×886 px, 3 MB)

Android:

caption_android.gif (1×800 px, 1 MB)

Moving back to In Progress to address the issues @kostajh brought up:

  • you can press backspace while in the empty caption node and delete it entirely, then see the VisualEditor UX to insert a new paragraph
  • on my iOS device, the caption field is displayed out of the viewport. (probably an edge case, I am reusing the same article over and over again so it has dozens of the same image added to it)

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: Don't call the default deletion handler when ceRecommendedImageCaptionNode is empty

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

Moving back to In Progress to address the issues @kostajh brought up:

  • you can press backspace while in the empty caption node and delete it entirely, then see the VisualEditor UX to insert a new paragraph

Thanks for fixing this! I also noticed that on desktop, the keyboard shortcut for "Select all" manages to get me outside of the node; maybe we should register a handler for that too.

  • on my iOS device, the caption field is displayed out of the viewport. (probably an edge case, I am reusing the same article over and over again so it has dozens of the same image added to it)

This one is probably OK to ignore for now, though I don't know if templates or other rendered elements might have a similar effect.

Change 732795 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: Don't call the default deletion handler when ceRecommendedImageCaptionNode is empty

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

Moving back to In Progress to address the issues @kostajh brought up:

  • you can press backspace while in the empty caption node and delete it entirely, then see the VisualEditor UX to insert a new paragraph

Thanks for fixing this! I also noticed that on desktop, the keyboard shortcut for "Select all" manages to get me outside of the node; maybe we should register a handler for that too.

It looks like the focus is kept when VE's selectAll command is used. I added this to the list of safeCommands for Add Image's registration (in the current patch).

Change 732034 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: loading states & view images details button for caption step

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

RHo updated the task description. (Show Details)

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: update copy & QQQs for image inspector, rejection dialog, edit summary, caption UI

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

Change 737784 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: update copy & QQQs for image inspector, rejection dialog, edit summary, caption UI

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

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

[mediawiki/extensions/GrowthExperiments@master] Add an image: Update text color for caption field

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

Change 738480 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: Update text color for caption field

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

Checked on betalabs and testwiki wmf.9 - all specs seem to be in place.