Reordering notes in the UI

First, I want to make clear that if you agree with the feature request, I’m willing to create a design doc and implement it myself. But I would not do it unless I know it’s not time lost.

I’ll tell you what I want first, and then the problem it solves.

The solution

Currently, in a deck, notes are ordered according to their creation time, which is also the note id. You can reorder new cards by entering their position manually, but that’s a very complex process when you want to manually reorder a lot of cards, and this information is lost when the cards graduate from new to in review.

I would like the note to contains two distinct fields for those two distinct purposes. The note id can stay as-is, it represents the creation time. And a order id. When we introduce this field, it’ll be set to be equal to the note id. And when new cards are created, it’ll be a number higher than any current order id in the collection. The order id will be used to sort new cards if the user has selected a sequential order for new cards.

I suggest that by default, we leave a big gap between each successive order, so that most of the time, if I want to put a cards A between cards B and C, I don’t need to renumber B and C.

I really don’t want to touch note id. Because first, the creation date of the note is a nice information to have. And there are some addons and some logging that uses the note id by assuming it’s constant. While add-ons such as https://ankiweb.net/shared/info/1114271285 or https://ankiweb.net/shared/info/1665261045 may solve the same issue, I don’t think doing it by changing NID is great

The problem it solves

Firstly, as I mentioned above, being able to do that in the UI would be quite simpler than doing so by opening the menu and entering a number. I could directly see which cards is under which cards, navigating quickly between them to see their content. (I suggest using something similar to the current browser, but with an option to have the previewer in the side panel instead of the list of field)

But most importantly, there are many topics where the order of the notes matter a lot. For example, when a note refers to a definition introduced in another note, the definition should come first. If I introduce a general concept, examples of this concept should come first so that it’s clear what the general definition is for. If I have a theorem whose proof requires a lemma, the lemma should come first.

When I create my notes, very often it takes me time to realize what the proper order should have been. I would love to be able to easily reorder the notes after I created them, if I see I just created two notes in the wrong order.

Most importantly, if I read multiple books on the same topic, I would like to be able to interleave notes from various books in the way that makes the most sense to me, even if I read the second book months or even years after the first one.

I’d love at some point to be able to share my decks. I also would love to collaborate on mathematics decks with other people the way medical school students have done in the past. And I consider that having a way to have an order that is actually what we want for our deck would make such task far far easier

I don’t remember which version introduced this but the position is now saved as card.original_position when cards go from new to learn/review.

So, I think that your idea can be simplified to just “leave big gaps between positions of new cards” so that adding more cards between two cards doesn’t require renumbering the other cards.

We’ve all seen this method before: 10, 20—line numbering in Basic.
Then, to have enough space for another offset, we had to write 5, 15.
And it seems like once a card has been studied, they can’t be renumbered?
There will always come a time when the user wants to enter a lot of cards and place them all somewhere at the beginning, say, starting with number 1. If new cards can be renumbered, what do we do with the ones already studied?

And there are some addons and some logging that uses the note id by assuming it’s constant.

I agree. This field is supposed to be used to build the search index, and it shouldn’t be changed for good performance and linking purposes.

If I introduce a general concept, examples of this concept should come first so that it’s clear what the general definition is for. If I have a theorem whose proof requires a lemma, the lemma should come first.

But if there are several lemmas, then you forgot one, not another, and then the order for studying will not be exactly as you need?

I totally agree that the solution is far from perfect. I cared about offering something that can be implemented with anki without to much changes and with no impact for users that don’t care about the feature.

I actually created an addon that deals with dependencies between note in a more inteligent manner. But too much pain to actually use it properly when I mostly review on ankidroid.

Another thing I like about having feature in anki instead of add-on is that ankidroid follows anki in terms of features, so if it’s in anki, I can also get it merged in ankidroid