AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.08k stars 351 forks source link

Help Text Color configurable for users #317

Closed kennyngdev closed 3 years ago

kennyngdev commented 3 years ago

Hi My Name is Kenny and I want to help with this project. I added some code to make the help text color configurable with respect to #298 the UX with the added functionality should be the same, as you can still have the default cyan color help text without any changes.

For now its only in select.go. If i get a nod i can also expand it to other prompts.

Thank you!

AlecAivazis commented 3 years ago

hey @kenny01123! Thanks for your contribution.

I think this kind of configuration should be passed as a survey.Option to Ask/AskOne, similar to what we do for Changing the Icons used by a prompt, instead of adding another field to every prompt

kennyngdev commented 3 years ago

Hey @AlecAivazis I added a field called Prompt Text in IconSet. This is added to select, and i have changed the help text color configuration in multiselect and multiline from {{- color $.Config.Icons.SelectFocus.Format}} to {{- color $.Config.Icons.PromptText.Format}}. The reason is that the select focus imo should only be referred as the selected option in the list but not the helptext.

I only set the format as the option in the field but not the text. Since select, `multiselect and multiselect have different default texts.

What is your opinion about it?

317

AlecAivazis commented 3 years ago

Hey @kenny01123!

I think these changes make sense. It could be a little confusing specifying the prompt text as an Icon since the Text field is ignored but i'm not sure its worth introducing anything new and it is related to the rest of the IconSet.

Looking forward to seeing the other prompts updated aswell! Thanks again for the contribution 👍

AlecAivazis commented 3 years ago

I'm going to close this PR to keep things tidy, please feel free to open another one up when you are ready