rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

RFC 28: Tagging improvements

Open kaedroho opened this issue 7 years ago • 8 comments

Rendered

kaedroho avatar Jun 01 '18 12:06 kaedroho

cc @wagtail/ux-design

kaedroho avatar Jun 04 '18 08:06 kaedroho

FWIW the functionality outlined in Add a “Tag management” interface would be absolutely fantastic. We've had recurring issues with this too (especially when user accidentally add sentenced cased and lower cased variants of the same tag).

jonnyscholes avatar Jun 05 '18 22:06 jonnyscholes

Rather than adding a new input field for filtering by tags, one option would be to support a syntax for that within the main search box, e.g. croissant tagged:Savoury. The downside is that it's not as discoverable as an explicit field, and it'd be harder to integrate autocomplete.

As a minor point on the layout, bear in mind that the Collections dropdown won't always be there (it's hidden when no collections exist, or the user only has permission for one) so the UI would have to adjust to deal with the presence or absence of that field.

How useful is the 'popular tags' listing anyway? I don't think users would miss it too much if we dropped it, if we're giving them a better tag filtering UI at the same time. Perhaps we can set up the 'tags' field to offer the 'popular' list as an autocompletion dropdown when you first focus on the field?

gasman avatar Jun 06 '18 10:06 gasman

Rather than adding a new input field for filtering by tags, one option would be to support a syntax for that within the main search box, e.g. croissant tagged:Savoury. The downside is that it's not as discoverable as an explicit field, and it'd be harder to integrate autocomplete.

Maybe we could use this as a way to display the currently selected tags. To make it clear how to add a tag, we could add a small tag icon to the right of the search box which displays a tag selector?

How useful is the 'popular tags' listing anyway? I don't think users would miss it too much if we dropped it, if we're giving them a better tag filtering UI at the same time. Perhaps we can set up the 'tags' field to offer the 'popular' list as an autocompletion dropdown when you first focus on the field?

:+1:

kaedroho avatar Jun 06 '18 11:06 kaedroho

Proposed approach for disabling free tag creation (i.e. only allowing existing tags to be selected, through autocomplete):

  • Patch tag-it.js with https://github.com/aehlke/tag-it/pull/322
  • Add a flag to AdminTagWidget to pass autocompleteOnly in initTagField - this would be sufficient to disable creation of new tags by setting FieldPanel('tags', widget=AdminTagWidget(free_tagging=False)), but this would only be enforced client-side
  • Introduce a subclass of taggit.forms.TagField (I propose locating this at wagtail.admin.forms.tags) that accepts the free_tagging argument, and - as well as passing it on to AdminTagWidget - validates server-side that all entered tags are ones that exist already. This would allow devs to fully disable tag creation, but requires a custom admin form (https://docs.wagtail.io/en/v2.7.1/advanced_topics/customisation/page_editing_interface.html#wagtail.admin.forms.WagtailAdminPageForm)
  • Add a TagFieldPanel edit handler that accepts a free_tagging=False argument and passes it on to the form field; this allows tag creation to be disabled without needing a custom form.
  • Update documentation to cover the new parameter / panel type

gasman avatar Jan 31 '20 11:01 gasman

@gasman Hey Matt, We're interested in this enhancement for a project we're working on. I wonder if this is a candidate for a release soon?

rgs258 avatar Mar 26 '20 18:03 rgs258

@rgs258 Yep - this is now implemented and will be part of Wagtail 2.9, due for release at the beginning of May: https://docs.wagtail.io/en/latest/reference/pages/model_recipes.html#disabling-free-tagging

gasman avatar Mar 26 '20 19:03 gasman

@rgs258 Yep - this is now implemented and will be part of Wagtail 2.9, due for release at the beginning of May: https://docs.wagtail.io/en/latest/reference/pages/model_recipes.html#disabling-free-tagging

You're so fast! Thank you!

rgs258 avatar Mar 26 '20 19:03 rgs258