strapi / rfcs

RFCs for Strapi future changes
68 stars 33 forks source link

add component at any location in dynamic zone #48

Closed AdilAmanat closed 1 year ago

AdilAmanat commented 1 year ago

Link to markdown: https://github.com/AdilAmanat/rfcs/blob/main/rfcs/xxxx-template.md

strapi-cla commented 1 year ago

CLA assistant check
All committers have signed the CLA.

AdilAmanat commented 1 year ago

@alexandrebodin can you have a look at it?

alexandrebodin commented 1 year ago

Hi @AdilAmanat I do like the proposal of being able to add a components below or above another directly. I'll ping the Product team on our side to comment on the RFC.

gu-stav commented 1 year ago

Just a heads-up here: we recently started to implement a unified way to handle drag and drop (for relations), which we now start to apply to repeatable components and soon dynamic zones. It's not the same as inserting a component at a certain position, but it will allow you to move them around more easily.

You can follow along the progress e.g. here: https://github.com/strapi/strapi/pull/15079

AdilAmanat commented 1 year ago

@gu-stav for the initial thought DND seems to be a fine idea for most of the cases where the dynamic zone doesn't have hundreds of components. But when dynamic zone has 200-300 components, DND would still be a pain point because it wouldn't be easy to add component on the bottom and scrolling it to the top/middle of the dynamic zone to drop it to a required state.

Why I think DND is not an eventual problem solver: For a large dynamic zone where we have 200-300 components in the dynamic zone on Drag, it would be rerendering the entire list on drag and rerendering a large list of UI can result in a laggy experience. To prevent that you would have to apply virtualization on the dynamic zone(which is the optimum idea) but it would have a different UX.

joshuaellis commented 1 year ago

Hi everyone, we've picked this up and are moving it into our review process to resolve this RFC. When there's an update on the product decision, we'll update you all.

AdilAmanat commented 1 year ago

@joshuaellis do let me know if I can contribute because I have already done the POC and the draft PR is ready.

joshuaellis commented 1 year ago

@joshuaellis do let me know if I can contribute because I have already done the POC and the draft PR is ready.

I think we'll probably go for an in-house design solution that aligns with the overall product vision. Thank you for sharing a POC and this RFC however, it's always helpful to know how we can improve the content experience 😊

joshuaellis commented 1 year ago

Thank you for your patience all, there's a PR open in the main strapi repo with an implementation to do this.

AdilAmanat commented 1 year ago

@joshuaellis thanks for the update.