Page MenuHomePhabricator

Add support for field placeholders
Closed, ResolvedPublic3 Estimated Story Points

Description

It would be nice to provide an auto generated message key for each field placeholder so consumers can provide "communityconfiguration-myprovider-myconfigoption-placeholder": "My placeholder".

This requires updating both getEditorTextKeys and getControlTextProps to request and add a "placeholder" property for each field.

Acceptance criteria

  • Placeholders are displayed for any control providing a "placeholder" text controls using an html input, that is controls using Codex's TextInput or ChipInput.
  • REVIEW: Use placeholders for the help panel links examples in the help panel schema
  • Use existing placeholder for the Namespaces and Pagetitles controls ("Add more...")

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
KStoller-WMF moved this task from Inbox to Up Next on the Growth-Team board.
Sgs raised the priority of this task from Medium to High.Apr 30 2024, 11:56 AM
KStoller-WMF set the point value for this task to 3.Apr 30 2024, 4:25 PM

Change #1029219 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Add placeholders to Number and String controls

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

Change #1029224 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] Add the i18n for the placeholder for gehelppanellinks-text

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

Change #1029233 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Hard-code placeholder for complex controls

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

The acceptance criteria Use placeholders for the help panel links examples in the help panel schema, see labels in F47353401, is in conflict with our "generic" approach for arrays. That is because the message keys that we provide for the GEHelpLinks config option are:

Given the configuration contains two links:

  • array-label: Missing, should be Help panel links
  • array-control-label: Not necessary, control-label is just for checkboxes, i18n should probably skip it for arrays, filed T364527
  • array-help-text: Not used, does not harm although we don't have any use case for it
  • array-placeholder: Not necessary, placeholder is just for inputs, i18n should probably skip it for arrays, filed T364527
  • array-0-label: Correct: First link
  • array-1-label: Correct: Second link
  • array-title-label: Correct: Destination page
  • array-title-control-label: Not necessary, ditto, T364527
  • array-title-help-text: Not used, does not harm although we don't have any use case for it
  • ⚠ array-title-placeholder: We wanted to use this to display recommended: manual of style or just manual of style but this won't work as that is specific to the first link, not any link in the collection
  • array-text-label: Correct: Label
  • array-text-control-label: Not necessary, ditto, T364527
  • array-text-help-text: Not used, does not harm although we don't have any use case for it
  • ⚠ array-text-placeholder: We wanted to use this to display recommended: "Manual of style" or just "Manual of style" (note subtle difference of capitalization), but again, this won't work as that is specific to the first link, not any link in the collection

Using the help text would suffer from the same problem. The possible alternatives I can see at the moment are:

  1. Provide per array item placeholders (and/or maybe also help texts). I would create these as an addition of the existing array-title-placeholder not a replacement, that is to support both the per item specif iciness or a generic one.
  2. Include the recommendation on the main label, eg: Second link (recommended title "manual of style", recommended label: "Manual of style")
  3. Make the recommendations part of an explanatory message for the whole GEHelpLinks, we could use existing help-text for this or introduce a new key, eg: config-option-description

What do you think @Michael @KStoller-WMF @JFernandez-WMF?

@Sgs and I discussed moving forward with the third approach he recommends.

We should make improvements in the future, based on designs from this task: T360445: Propose a control for collections.

@Michael definitely let us know if you have concerns with that approach, or you have any questions.

Michael changed the task status from Open to Stalled.May 13 2024, 10:09 AM

This sounds good, but doing this task properly is effectively blocked on T364527: Client i18n module generates unnecessary keys. That being said, fixing T364527 should not be that hard.

Change #1029219 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] ComponentEditor: add placeholders to number and string controls

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

@Michael Are you going to be working on this in this sprint. I see that it's marked as stalled

The changes in T363051: Add support for field placeholders have been merged and it can be considered fixed, so this is back to code review.

Add the i18n for the placeholder for gehelppanellinks inputs adds placeholders for the two inputs of help panel links section. I've taken the values of the first link as it is currently on English wikipedia, which from my point of view makes for a nice placeholder.

Change #1029233 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Hard-code placeholder for custom multi-select controls

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

Change #1029224 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add the i18n for the placeholder for gehelppanellinks inputs

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

Some notes on verification:

This can now be seen on https://es.wikipedia.beta.wmflabs.org/wiki/Especial:CommunityConfiguration/HelpPanel. This task added both the "Add more..." placeholders, as well the placeholders for the inputs in the "Help panel links" section. It is intentional that the placeholders in the "Help panel links" section are the same for each link.

Etonkovidova updated the task description. (Show Details)
Etonkovidova subscribed.

Checked in beta - below are examples of placeholders:

Screen Shot 2024-06-11 at 8.10.36 AM.png (456×1 px, 80 KB)
Screen Shot 2024-06-07 at 12.08.10 PM.png (1×2 px, 327 KB)