Replies: 1 comment
-
|
Hi @ollym, thanks for the heads up on those articles. I'd explored fractional indexing before but thought it had some similar drawbacks to the issue ranked-model has with space depletion for the common use case of always appending to the list. Apparently not when using strings? I assume it's still possible to exhaust the gap between the last item and 1 but it would take longer? I'm glad you found that gem and hopefully the author accepts your PR with the changes. I think I'm happy to keep going in the current direction for now with positioning but perhaps if I have time in the future I could create an alternative Mechanisms class that uses fractional indexing instead? If you find the other gem author unresponsive and want to explore adding in an additional Mechanism so long as it doesn't affect the current code, then I'd be open to that. It could then be something that's configured globally or per use. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Came across this article:
https://www.figma.com/blog/realtime-editing-of-ordered-sequences/
Then this implementation document:
https://observablehq.com/@dgreensp/implementing-fractional-indexing
And this lesser-known gem that implements it:
https://github.com/kazu-2020/narabikae
We did some pretty heavy evaluation of both this and narabikae, both needed some work so we submitted PRs against both to plug some gaps, but have decided to deploy with
narabikae(fractional indexing) because I just couldn't get comfortable with the idea that whenever a record is inserted or moved you need to update all subsequent records to maintain a position index. This can create stale records and easily conflicts with concurrent behaviour. I also liked the simplicity of narabikae's implementation.I'm curious on your thoughts on fractional indexing, ultimately
narabikaeisn't well maintained so we'll likely need to maintain it ourselves, possibly as afractional_positioninggem, but would rather not duplicate efforts if you think this is an interesting next iteration.Beta Was this translation helpful? Give feedback.
All reactions