While Bynder's Compact View widget provides some benefits, it also comes with a few drawbacks:
- We're reliant on hacks to Wagtail's base admin template to inject some necessary scripts
- Because the 'access token' for the widget needs to accessible to JS, it is exposed in the template output
- 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
- 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.
- The chooser solution overall is quite 'fragmented', as it requires overrides in several domains (templates, JS files and python).
- 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.
- 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.
While Bynder's Compact View widget provides some benefits, it also comes with a few drawbacks:
KeyErrorwhen the item is selected, because theoriginalvalue 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.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.