Page MenuHomePhabricator

Add support for <textarea> fields to the ApiSandbox
Closed, ResolvedPublic

Description

Certain Wikibase API modules, e.g. SetClaim or SetReference, do have a field that must contain a JSON blob. Even if these API modules are not made to be used manually by a user, we want users to play around with the API and learn how it works. That's one of the reasons why we have the ApiSandbox.

Problem: The fields to input JSON blobs are tiny single-line, 225px wide (see ApiSandbox/resources/styles.css) <input> fields. Editing a JSON blob in this field is pretty much impossible.

Suggestion: Add support for <textarea> fields to the ApiSandbox, so extensions like Wikibase can make use of it when appropriate. Set a low default width and height (e.g. 3 lines height and keep the 225px width) and set resize: both;.

Event Timeline

thiemowmde raised the priority of this task from to Needs Triage.
thiemowmde updated the task description. (Show Details)
thiemowmde subscribed.

This isn't technically blocked by T92893: Update ApiSandbox to MediaWiki appearance using OOjs UI and/or T89386: Merge ApiSandbox extension into core, but it's already a feature in the rewrite I'm doing to solve those two tasks and isn't very likely to be done by anyone outside of that.

Great to hear that! :-) Does this mean the ApiSandbox extension can be considered legacy code and it would be a waste of time to work on it? Is there a rough estimate for the release of your rewrite?

Great to hear that! :-) Does this mean the ApiSandbox extension can be considered legacy code and it would be a waste of time to work on it? Is there a rough estimate for the release of your rewrite?

I really should put the WIP in Gerrit. T92893 has a list of blockers before it can be feature-complete, then however long it takes to be reviewed.

Change 209570 had a related patch set uploaded (by Anomie):
WIP: Add Special:ApiSandbox

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

You should be able to use 'text' as new type - https://gerrit.wikimedia.org/r/#/c/209569/
Maybe add a type json to move the validation of json to core (I did not know if that is useful in other extensions, but there is JsonContent with .json, so core has json support)

I tried and saw fields marked as 'text' rendered as (text). Simple reason: Don't forget to update the ApiSandbox extension. ;-)

thiemowmde claimed this task.

Change 209570 merged by jenkins-bot:
Add Special:ApiSandbox

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