Page MenuHomePhabricator

HTMLForm: Add support for per-option descriptions
Closed, ResolvedPublic3 Estimated Story Points

Description

Codex's Checkbox and Radio components support descriptions along with their labels. But we can't make use of these in HTMLFormFields that display multiple options, because HTMLForm doesn't have the concept of per-option descriptions.

We should add the ability to set descriptions for each option for radio-based and checkbox-based multi-option fields (but not for <select>-based ones, because <option> tags don't provide as much flexibility).

  • Add per-option descriptions to HTMLForm (in the top-level doc comment with all the options) HTMLRadioField
  • Implement support for them in HTMLRadioField's Codex implementation
  • (Maybe?) implement support for them in HTMLRadioField's OOUI implementation
  • (Maybe?) implement support for them in HTMLMultiSelectField

Event Timeline

lwatson set the point value for this task to 3.Mar 18 2024, 5:21 PM

Change 1012791 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] HTMLForm: Add per-option descriptions for Codex radio buttons

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

Change 1012792 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] [WIP] SpecialBlock: Use option descriptions instead of label hack

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

@AnneT has convinced me that we should narrow the scope of this and not bother to try to implement support for this for non-Codex HTMLForms. I also found a previous attempt to do this in T324268: HTMLRadioField: Support per-option help texts, which stalled out after running into issues trying to support this behavior in OOUI. One thing I did adopt from the stalled patch for T324268 is making this setting specific to HTMLRadioField, rather than making it apply to all field types.

Change #1012791 merged by jenkins-bot:

[mediawiki/core@master] HTMLForm: Add per-option descriptions for Codex radio buttons

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