Skip to content

Make Edit Setting interface clearer #5067

@joemull

Description

@joemull

User story

If I go to edit a setting and create an override for my journal, it is sometimes hard to know what to do in the case of Boolean settings.

For example, if a boolean setting is on by default, then I see an unchecked tick box and a "Create Override" button. Do I check the box before clicking "Create Override"? Do I leave the box unchecked? Leaving it unchecked is correct, but not the most intuitive.

Image

Proposed solution

  • Use a toggle switch for this screen. This is what the team has expressed a preference for.
  • Consider clarifying setting names and truthiness / falsiness via Standardize setting names #5066 at the same time

Alternative widget

In my experience, the toggle switch provided by Foundation is very particular, and may be hard to implement here. If the dev handling this issue finds that to be the case, can use the "Yes No Radio" widget that we created to overcome the switch input difficulties.

Image

janeway/src/utils/forms.py

Lines 178 to 197 in 65d95eb

class YesNoRadio(RadioSelect):
"""
A drop-in radio widget to use with BooleanField
when the user is meant to express a simple yes/no preference.
Displays compactly inline.
"""
def __init__(self, attrs=None, choices=()):
yes_no_attrs = {"class": "yes-no-radio"}
if attrs:
yes_no_attrs.update(attrs)
yes_no_choices = [
(True, _("Yes")),
(False, _("No")),
]
if choices:
raise ImproperlyConfigured(
"The YesNoRadio widget does not expect choices from the initializer."
)
super().__init__(attrs=yes_no_attrs, choices=yes_no_choices)

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureA new thing that doesn't exist yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions