Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ababic opened this issue Feb 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ababic
Copy link
Collaborator

ababic commented Feb 16, 2024

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.

@ababic ababic added the enhancement New feature or request label Feb 16, 2024
@zerolab
Copy link
Member

zerolab commented Feb 17, 2024

I agree and I think https://github.com/wagtail/queryish could come in handy for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants