tools icon indicating copy to clipboard operation
tools copied to clipboard

Schema: Support multi-line text inputs

Open ewels opened this issue 1 year ago • 1 comments

It would be nice to support / differentiate text variables between simple one-line inputs and multi-line textareas in the schema. (See original request for support in Seqera Platform launch page).

Need to figure out what the best JSON schema syntax is first. Suggestions from Slack discussion:

  1. minLength
  2. New format type textarea
  3. Using a pattern that includes zero or more \n newlines

Once we agree on such a flag we can detect it in the launch form and have an option / docs for it in the schema builder.

ewels avatar Aug 28 '24 11:08 ewels

It would be great if the schema included an optional configuration to specify the desired height of the box (like rows) when defining multi-line text areas. I can see a number of use cases where the text area can be small and others where it should be bigger for it to be useful.

mbosio85 avatar Aug 30 '24 08:08 mbosio85

Ok, suggestion then is to use rows:[integer] in that case. For example:

"my_parameter": {
    "type": "string",
    "description": "This parameter should be a super long string.",
    "fa_icon": "fas fa-file-signature",
    "rows": 4
}

This would be ignored if other things such as format are set to file-path and so on.

ewels avatar Dec 02 '24 15:12 ewels

After some nice discussion in slack, consensus is forming around a more future-proof ui_hint syntax. For example:

"my_parameter": {
    "type": "string",
    "description": "This parameter should be a super long string.",
    "fa_icon": "fas fa-file-signature",
    "ui_hint": {
        "type": "textarea",
        "rows": 4
    }
}

ewels avatar Dec 03 '24 13:12 ewels

If anyone would like an array of dicts for ui_hint then speak now!

ewels avatar Dec 03 '24 13:12 ewels

moved to https://github.com/nextflow-io/schema-spec/issues/4

mashehu avatar Jun 03 '25 13:06 mashehu