Add support for service descriptions to include white spaces and new line when displayed in the UI #18988
Unanswered
bostonswe92
asked this question in
Accessibility
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently when writing the description for a service, or the description for the service fields/parameters, HA trims all new lines and white spaces in the UI description text box , leaving the description one long unformated text line.
If you have a lot of options to describe, or if you have a parameter with its own sub-parameters, your description will look very cluttery in the UI. This basicly only leaves you with the option to have a minimal description in the UI and refer the user to a wiki site.
Allowing for multiple lines in the description allows developers to better document the service directly in the home assistant UI, in a more readable way. Its never a bad thing to bridge the gap between the user and the documentation.
Example code for a field/parameter description and desired output in the UI:
What a possible desired output could look like in the UI text box(including an imagined automatic line break due to textbox size):
Clicking on the "FILL EXAMPLE DATA" button would fill in the following yalm code:
I do belive its only a matter of removing some trim functionallity that is currenly in place for the UI description text box. Currently the "example" parameter works like shown above (no white space/new lines are removed) so it must be some specific formatting that is applied to the description text box.
I do understand that everyone UIs and screen are diffrent size, so that might mess up any formatting you do to the description anyway. But allowing white spaces and new lines does not remove the ability to make the description display as it does today, if so desired. It only allows for more option for developers, if they want to use it.
Beta Was this translation helpful? Give feedback.
All reactions