Skip to content

Conversation

xavier-GitHub76
Copy link
Contributor

I merged the changes made by
jberlyn (from pull request #804 to the updated master branch)

I then added drag 'n' drop sorting support.

dnd_sortorder.webm

const {active, over} = event;

if (over && active.id !== over.id) {
setLocalApps((items) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to expose both the sort order integer and the new api with the list of application ids. One should suffice.

If we choose the new reorder api we can hide the sort index in the application model which prevents breaking api changes (new field in the PUT /application/{id} endpoint). This would also expose less internals in the public api.

I think there is an argument for the sort index on the application. Fractional Indexing could be used that has some feature for collaborative editing (which we don't need) but this also allows us to move an application to a specific position without having to update the sort order index of all applications. The fractional index would be a text field that's sortable and the client would be able to update the fractionalIndex in the PUT /application/{id} endpoint with something like https://www.npmjs.com/package/fractional-indexing.

I don't think I've a clear best solution here. I'm slightly leaning towards the new api as it seems less complex but the fractional index solution only has to update a single application on reordering and doesn't need another endpoint.

@eternal-flame-AD do you have an opinion on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants