Skip to content

Reorder Components within large Dynamic Zones more quickly & easily #7941

Closed

Description

@LilyLauben
  • I have created my request on the Product Board before I submitted this issue
  • I have looked at all the other requests on the Product Board before I submitted this issue

Please describe your feature request:
Hello, I'm working on a fairly small dev team, using strapi to create a large online exhibition website. This project takes advantage of the Dynamic Zones to create large sections with varied layouts, because one of our top priorities is to make a beautiful and visually interesting site.

However, once you start working with Dynamic Zones that are longer than 15 components, further edits become increasingly difficult, due to how hard it is to reorder components within Dynamic Zones. There are two main problems:

  1. Currently, new components can only be added to the bottom
  2. Currently, existing components can only be reordered one step at a time, using the up and down arrows

These buttons are quickly becoming the bane of my team's existence

This means that whenever my team wants to add a component towards the beginning of the dynamic zone, it's a process of pressing the up button, scrolling, pressing it again, scrolling, etc until it's where they want it to be.

After taking a look at the code feels like there a number of solutions, some of which are simple, and some of which are more ambitious, to help resolve this issue.

Solution 1: Move Up/Down 3x Buttons

The easiest fix seems to me to be to add additional arrow buttons to reorder the components, but instead of simply moving up or down by one step, this set of buttons would move the component up or down by 3 steps. So, clicking the MoveUp3 button once would move a component from index 4 to index 1. This seems like it would be pretty achievable by modifying this file to have additional action for MOVE_COMPONENT_UP_THREE which would be identical other than altering this line action.currentIndex - 1,to action.currentIndex - 3,. Then the function would have to be passed down through to context to the component. The only reason I hesitate to implement this myself is that I'm not sure if any additional error checking would need to be done to make sure that the index didn't go out of bounds.

Solution 2: Move Up/Down Buttons with Input Field for Number

The slightly more complex, but more powerful solution would be to instead let the user specify how much they would like to move the component up or down by. This would involve the passing of a variable, and also the setup of a number field.

Solution 3: Move to Top/Bottom Buttons

This solution is also additional arrow buttons, but these would move the component all the way to the top or to the bottom of the Dynamic Zone. These seems like it shouldn't be too difficult to create an action for, I'm just not certain how the action's implementation would differ from the MOVE_COMPONENT_UP action, since I don't understand the functions being called within it. Could you just do the following?

    case 'MOVE_COMPONENT_TO_TOP':
      return state
        .update('shouldCheckErrors', v => {
          if (action.shouldCheckErrors) {
            return !v;
          }

          return v;
        })
        .updateIn(['modifiedData', action.dynamicZoneName], list => {
          return list
            .delete(action.currentIndex)
            .insert(
              0, //would it be fine to just pass a number as the index?
              state.getIn(['modifiedData', action.dynamicZoneName, action.currentIndex])
            );
        });

Solution 4: MoveToIndex Buttons with Input Field

A variant on Solution 2 would be to have the ability to move a component to a certain index within the Dynamic Zone, using an input field in conjunction with a button.

Solution 5: Accordion with Drag and Drop functionality to Reorder

This is what I feel would be the best solution, but also the most intensive. For arrays and repeater fields, there is an option to collapse items within the array, and then move them around with drag and drop functionality. This would be amazing, but I recognize it would be extremely involved, and I don't even know how one would start that process.

Edit: From looking at #7940 and also talking to my own content managers:

Solution 6: Additional Add Component Button at Top

Another solution would be to give users the power to add items directly to the top of a Dynamic Zone, by having another ComponentsPicker component at the top of the list of components (as long as the list was not of length 0 I suppose). It also looks like this would have to call a variant ADD_COMPONENT_TO_DYNAMIC_ZONE that instead added the item to the start of the list rather than pushing it to the end.

I'm willing to help contribute some dev time to this issue myself, but I'm generally more of a front-end programmer and don't fully trust myself with a React project of this complexity. Some guidance and assistance would be much appreciated!

Activity

  1. LilyLauben commented on Sep 17, 2020

    @LilyLauben
    Author

    I didn't see #7940 when I was typing all of this up, but I think we're both asking for the same thing!

  2. cronin4392 commented on Oct 2, 2020

    @cronin4392

    This would be a great feature! I have pages with a lot of content in dynamic zones and it can be a process having to add content in the middle of it.

  3. gu-stav commented on Dec 18, 2020

    @gu-stav
    Contributor

    Hey @derrickmehaffy . I think the dynamic zone editing experience is currently our biggest pain point for the decision between the future CMS of a large website. I'd really like to go for Strapi, but the current experience for content types, which are using dynamic zones a lot is not good. Wordpress is much better there, because you can move blocks/ components in every direction and add blocks/ components between other blocks. @LilyLauben already did a good job in the initial description 👍🏽

    Are there any plans to work on this in the near future? Or do you want any help with that? I'd really like to work on that, so editors can have the same good experience that strapi offers for devs.

    Or, with all the v4 stuff going on, doesn't this have priority at all?

  4. derrickmehaffy commented on Dec 19, 2020

    @derrickmehaffy
    Member

    Hey @derrickmehaffy . I think the dynamic zone editing experience is currently our biggest pain point for the decision between the future CMS of a large website. I'd really like to go for Strapi, but the current experience for content types, which are using dynamic zones a lot is not good. Wordpress is much better there, because you can move blocks/ components in every direction and add blocks/ components between other blocks. @LilyLauben already did a good job in the initial description 👍🏽

    Are there any plans to work on this in the near future? Or do you want any help with that? I'd really like to work on that, so editors can have the same good experience that strapi offers for devs.

    Or, with all the v4 stuff going on, doesn't this have priority at all?

    To my knowledge we do not have any plans to work on this in the near future. The next two or three quarters are 100% filled with what we plan to do, but can be re-evaluated at the end of each quarter (Q1 2021 is set in stone).

    To that end, the choice is not mine to make, its our product teams who decide what gets priority. At the moment Q1 2021 is entirely the plug-in API and I18N.

    If you want to work on a feature like this, I suggest you submit an RFC

  5. self-assigned this
    on Jan 14, 2021
  6. LilyLauben commented on Dec 13, 2021

    @LilyLauben
    Author

    @derrickmehaffy @sam-pires Have there been any updates to this issue? Now that v4 has been released, will there be any space in the upcoming roadmap to consider UX issues such as this one?

    It's been a frustrating experience to wait for over a year for a solution, have a PR come out that solves all of our pain points, and then have that PR closed with an automated message eight months later after a major update with no further communications.

  7. derrickmehaffy commented on Dec 13, 2021

    @derrickmehaffy
    Member

    @derrickmehaffy @sam-pires Have there been any updates to this issue? Now that v4 has been released, will there be any space in the upcoming roadmap to consider UX issues such as this one?

    It's been a frustrating experience to wait for over a year for a solution, have a PR come out that solves all of our pain points, and then have that PR closed with an automated message eight months later after a major update with no further communications.

    Not currently no as for the past few months we had our hands full with the v4 development.

    (Also sam no longer works for us)

  8. laugepetersen commented on Apr 25, 2022

    @laugepetersen

    +1 For the option to reorder dynamic zone components by drag and drop.

  9. jgoslow commented on Apr 28, 2022

    @jgoslow

    Wanted to weigh in here - I think the UX would be improved and this issue would be solved by having Content Components minimized by default and allowing drag-and-drop re-ordering of the components. The Components list would be much easier to see at a glance, and to re-arrange.

    image

  10. derrickmehaffy commented on May 20, 2022

    @derrickmehaffy
    Member

    Hey all, we are currently moving many feature requests to our new feedback and feature request website to help clean up the GitHub issues and make it easier for us to review bug reports and fix them.

    I have moved this feature to the following URL: https://feedback.strapi.io/customization/p/reorder-components-within-large-dynamic-zones-more-quickly-easily
    If you are interested in this feature please feel free to go there and add more comments and/or upvote it there.

    For now I will close this and lock it so that all new information goes into our new feedback website.
    Thanks!

  11. locked and limited conversation to collaborators on May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions