Page MenuHomePhabricator

Support suggestedvalues in TemplateWizard
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
It is possible to specify suggested values in the TemplateData. Their support is implemented in VisualEditor. Their use simplifies template customization and helps the user to understand it.

A ComboBoxInputWidget should be used to show the available values (but still allow other values to be entered).

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Benefits (why should this be implemented?):
Users will make fewer mistakes, and there will be no need to duplicate the proposed values in the parameter description.

Event Timeline

Samwilson renamed this task from Support Suggested values in TemplateWizard to Support suggestedvalues in TemplateWizard.Apr 23 2025, 5:00 AM
Samwilson removed projects: VisualEditor, TemplateData.
Samwilson updated the task description. (Show Details)

Change #1138144 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/TemplateWizard@master] Support suggestedvalues ComboBox fields

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

Why do we allow empty string in the set of suggested values? e.g. the following

"type": {
	"type": "string",
	"suggestedvalues": [
		"foo",
		"bar",
		""
	]
}

results in an empty option (a nonbreaking space is added as the option label):

Screenshot from 2025-05-16 15-29-16.png (192×520 px, 4 KB)

I guess it just makes sense to accept whatever people put in the templatedata, and they can remove that if they want.

Change #1138144 merged by jenkins-bot:

[mediawiki/extensions/TemplateWizard@master] Support suggestedvalues ComboBox fields

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

Why do we allow empty string in the set of suggested values? e.g. the following

"type": {
	"type": "string",
	"suggestedvalues": [
		"foo",
		"bar",
		""
	]
}

results in an empty option (a nonbreaking space is added as the option label):

Screenshot from 2025-05-16 15-29-16.png (192×520 px, 4 KB)

I guess it just makes sense to accept whatever people put in the templatedata, and they can remove that if they want.

I used once an empty string as parameter, distinguished from no parameter at all, so maybe it may be useful.