Building the 411 for air quality in the United States: a texting platform accessible to all, that provides actionable local information to protect your and your community.
This works fairly well, but it results in a UX which isn't quite as fluid as we'd like. For example, IntegerPreference exposes a get_prompt() method which returns a prompt like "Enter an integer between %(min_value)s and %(max_value)s.". In the case of the alert_frequency pref, for example, this result in a prompt like Enter an integer between 0 and 24. Note that we don't mention "hours" anywhere. Context is missing.
So this ticket is really just arguing that there should be a clean way to add more nuance to the prompts generated by these prefs' get_prompt() method. We would like to keep adding a new pref simple while allowing this extra flexibility.
To make it simple to add a preference, I created a basic framework where you define preferences a descriptors on the
Client
class; e.g.,The preference can then be used as follows:
This works fairly well, but it results in a UX which isn't quite as fluid as we'd like. For example,
IntegerPreference
exposes aget_prompt()
method which returns a prompt like "Enter an integer between %(min_value)s and %(max_value)s.". In the case of thealert_frequency
pref, for example, this result in a prompt likeEnter an integer between 0 and 24
. Note that we don't mention "hours" anywhere. Context is missing.So this ticket is really just arguing that there should be a clean way to add more nuance to the prompts generated by these prefs'
get_prompt()
method. We would like to keep adding a new pref simple while allowing this extra flexibility.