Skip to content

Use server-side Django views for choosers instead of Bynder's compact view #3

Description

@ababic

While Bynder's Compact View widget provides some benefits, it also comes with a few drawbacks:

  1. We're reliant on hacks to Wagtail's base admin template to inject some necessary scripts
  2. Because the 'access token' for the widget needs to accessible to JS, it is exposed in the template output
  3. Getting to the bottom of the widget UI to confirm a selection is often annoying, because more items load as you scroll, pushing the button further off screen
  4. I've noticed some oddness around the behaviour of 'private' assets - which seem to appear for selection even when the associated user does not have permission to download them. This results in a KeyError when the item is selected, because the original value isn't included in the API representation when accessed. This can be worked around for images and videos (where we only use derivative values). But, for documents, not being able to download the original is a show stopper.
  5. The chooser solution overall is quite 'fragmented', as it requires overrides in several domains (templates, JS files and python).
  6. If you open the chooser whilst the side panel is active, the widget will continue to display at reduced width, even if the side panel is closed and the chooser is closed down and re-opened.
  7. It doesn't really work with Wagtail's dark mode.

Although it would require a fair amount of work to refactor, I feel a server-side API-powered approach would give us better control over the behaviour, improve overall clarity in the solution, and make the whole package infinitely more testable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions