ember-sortable icon indicating copy to clipboard operation
ember-sortable copied to clipboard

Add direction grid

Open mkszepp opened this issue 1 year ago • 8 comments

This feature allows users to create a sortable list that works with a grid. Items can be moved up, down, right, or left within the same list.

Motivation?

We are currently using ember-drag-sort, which supports this feature. Unfortunately, the addon uses classic components, and updating it to the latest edition would require significant effort. Additionally, it is not as flexible as this addon. The drag-and-drop animation in ember-drag-sort is a simple arrow with no options for customization.

Implementing this feature in ember-sortable will help us transition away from ember-drag-sort. This update might also encourage others still using the previous addon to switch to this one.

grafik

mkszepp avatar Jun 11 '24 14:06 mkszepp

@NullVoxPopuli can you make a rerun of test? Local it is passing without any issue and also same changes on my repo are getting a green ci: https://github.com/mkszepp/ember-sortable/pull/1

mkszepp avatar Jun 12 '24 05:06 mkszepp

@NullVoxPopuli do you have any plan when we can get this feature?

mkszepp avatar Jun 17 '24 19:06 mkszepp

Sorry, my email situation is a bit wonky atm <3 feature looks good -- gonna review the code

NullVoxPopuli avatar Jun 18 '24 17:06 NullVoxPopuli

@NullVoxPopuli test were now added... while adding tests i have discovered two bugs, but now they are fixed

mkszepp avatar Jun 19 '24 15:06 mkszepp

It looks like the test fails, cause a timing... locally i have got also sometimes a fail... maybe we need to add a short delay in reorder test helper, because we are moving 26 items in some seconds.. on my fork PR tests are looking sometimes good (but i have also needed some test retries)

mkszepp avatar Jun 19 '24 16:06 mkszepp

seems like things are failing pretty regularly -- def can't merge without resolving 🤔

Do you think a test waiter needs to be added so that the waiter system "just works", and consumers of this library then also don't need to worry about adding random waiting in their tests?

NullVoxPopuli avatar Jun 19 '24 17:06 NullVoxPopuli

agree, atm its not mergable, beacause tests do fail... i will look to find a fix... maybe waitUntil helps me... i will try

mkszepp avatar Jun 19 '24 17:06 mkszepp

@NullVoxPopuli i have left some comments... all test should now pass (without retries 😅)

While adding this feature i was running in errors, which are still present in current version, but tests were never failed beacuse the lists were always small. drag has never waited for transitionEnd, it works with 5 elements without any issue, but when we use more (can' t tell you the exact number) this tests do always randomly fail like we have now got in grid. For consumer apps this change should not be braking

There was also never waited if all transition from items were completed, by using transition time with 1 secound + you will get crazy animations 😂. With my fix now we do wait since everything is completed.

mkszepp avatar Jun 20 '24 10:06 mkszepp