wagtail / wagtail-generic-chooser

A toolkit for custom chooser popups in Wagtail
BSD 3-Clause "New" or "Revised" License
116 stars 25 forks source link

Improve the chooser modal following Wagtail's built-in ones #44

Closed jeromelebleu closed 1 year ago

jeromelebleu commented 2 years ago

Various cleaning and improvements have been made to choosers in Wagtail and should be included here - to satisfy the goal of covering all the functionality of built-in choosers.

What could be done at least is:

gasman commented 2 years ago

Thanks @jeromelebleu! The eventual goal of my current chooser refactoring work is to extract a common base implementation that can serve as the basis of user-defined choosers as well as Wagtail's built-in ones, so wagtail-generic-chooser is very much tied in to that process. Really happy to hear that you're interested in helping out!

The new implementation will most likely live at wagtail.admin.views.generic.chooser and be some sort of hybrid of wagtail-generic-chooser and the refactored Wagtail chooser code, with the external wagtail-generic-chooser package becoming obsolete as a result. On that basis, bringing the two codebases closer together is definitely a good thing. However I suspect that it's going to be more efficient to do that within the Wagtail repo rather than this one, for a couple of reasons...

jeromelebleu commented 2 years ago

Thanks @gasman for this detailed answer! Glad to know the plan of the future implementation, I didn't realize that it were on the way like that. I agree with you that it will be more efficient to work on the Wagtail repo directly.

I am now wondering if this proposal is still interesting regarding the backward incompatibility that it could introduce and the possible duplicated work with the Wagtail repo. I opened it and started to working on since the current state lack of a customizable search form and generic columns - as you did for the document and snippet choosers, wonderful! - for a project we are working on - wagtail-webradio which is in early stage. But instead of using wagtail-generic-chooser, we could just add a chooser view based on what you are doing for snippets and documents - in waiting for wagtail.admin.views.generic.chooser. I could then help if you need for the new implementation but I don't have the big picture yet, so I would probably need to be guided. What do you think?

gasman commented 2 years ago

Hi @jeromelebleu - can we interest you in joining the Wagtail core team? You've made plenty of really useful contributions to the project, and especially on these choosers your thoughts are very much aligned with the way we'd like to take them. It looks like I don't have contact details for you outside of Github, but if you're interested (no commitment yet, don't worry!) then please drop tom@torchbox.com an email.

gasman commented 1 year ago

Generic chooser viewsets are now implemented in Wagtail 4.0 and serve as the basis of the built-in choosers. https://docs.wagtail.org/en/stable/extending/generic_views.html#chooserviewset