magmax/python-inquirer

Request for 'hints' to be added to multiple-choice questions.

Closed this issue · 3 comments

Great module, thank you.

I was wondering if you could add a feature. I would like it if we could add a hint to go along side the various options to checkbox and lists question types? The hint would provide more detail about what the highlighted answer would do. For example:

questions = [
    Checkbox('fruits',
             message="Select model mode:",
             choices=['SIMPLE', 'COMPLEX', 'BALANCED'],
             hint=["Faster computation but smaller outputs","Slow computation but large outputs","A happy medium"]
    )
]

This would display the corresponding hint when the items are highlighted, for both Checkbox and List types. The problem being that 'message' is usually not quite enough to explain the choices one is making.

How would you imagin this beeing rendered? shoudl the hints replace the message in the first line? or what was you idea here?

Hi. I would suggest putting it at the top, between the message and the list, ideally. I think if you put it at the side of each option as you navigate that would be ok, except that it might get truncated or cause the display to mess up because the line would wrap in some cases.

This means that if you do have a hint set, you should probably leave a blank line between the message and the list beforehand.

Thanks, HTH.

implemented in #433