Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use in practice #3

Open
nirvdrum opened this issue Jan 1, 2020 · 7 comments
Open

Document how to use in practice #3

nirvdrum opened this issue Jan 1, 2020 · 7 comments

Comments

@nirvdrum
Copy link

nirvdrum commented Jan 1, 2020

I've watched the LexoRank video linked from the README, but I couldn't work out from either the video or the README how to best use the library. When reordering an item, calculating the new rank seems pretty straightforward. But it's not clear to me how to get going with a brand new list.

As far as I can tell, you want to do something like:

const firstItem = LexoRank.middle();
const secondItem = firstItem.genNext();
const thirdItem = secondItem.genNext();

But, that "wastes" half of the available rankings for the extremely unlikely event where the entire list gets reversed. But, the first Item can't be LexoRank.min() either, or you'd never be able to put something before it. I guess it could be something like LexoRank.min().between(LexoRank.middle()) or maybe LexoRank.min().genNext(). Maybe there isn't a right answer for this. But, any guidance the document could provide would be much appreciated.

In my particular case, I append items to a list by default and the user might opt to re-order the list. I expect reorderings to be relatively small and infrequent, so my primary concern would be exhausting the default space by cutting it in half each time a new item is appended.

@shobokshy
Copy link

@nirvdrum if you set up a new instance of JIRA core, the very first issue you create will get assigned a rank using LexoRank.middle() "0|hzzzzz". Then subsequent issues get ranked using genNext().

@nirvdrum
Copy link
Author

@shobokshy Thanks for the info. It's a bit surprising to me, but useful nonetheless.

@shobokshy
Copy link

@nirvdrum I think it's because the rank field in JIRA is a global field per instance, so that allows you to view issues from different projects all on the same board, and users might re-order the issues to the top.

So for a single board it might not be common scenario to move issues to the top of the first created one, but when you look at the whole instance it probably common, therefore they start at .middle()

Anyways I am just speculating.

@shobokshy
Copy link

@nirvdrum another thing I noticed is when you have two issues for example and you swap their order around they dont use .between() but they just swap the ranks from the two issues.

Don't know if this makes sense

@trydalch
Copy link

trydalch commented Sep 3, 2020

It would also be valuable to give examples of detecting a rebalance and the use of the bucketing feature is done.

Not that I absolutely need it, but it would also be valuable to have an eli5 example of how to use this library. Would lead to quicker and probably wider adoption.

@trydalch
Copy link

trydalch commented Sep 3, 2020

Documenting how to change the base would be valuable.

@kvandake
Copy link
Owner

kvandake commented Apr 6, 2023

Hello!

Thank you for the feedback. I will try to find time to write detailed documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants