I'm quite puzzled on how to implement offset changes in the new thumbtable (see #4103) Currently it's not really satisfactory (see #4168 as the last example)
Initial situation (number is ordering value and letter is the imgid and x means the image is shown)
1-2-3-4-5-6-7-8-9
A-B-C-D-E-F-G-H-I
x x x x
case 1 In case there's movement in all images except D : no problem, we just need to ensure D is still the first image shown (keep offset by imgid)
In case D moves, it's problematic :
case 2 CDE are removed (example : they are selected and we reject the selection):
1-2-3-4-5-6
A-B-F-G-H-I
x x x x
Here we need to know previous collection, to use the "first-still-here" imgid as offset (need some modification but doable)
case 3 D move to the beginning
1-2-3-4-5-6-7-8-9
D-A-B-C-E-F-G-H-I
x x x x
And here is the problem : we can't rely on imgid offset, but I don't see how to be sure that D has moved (yes ordering has changed, but this is true in case 1 too)
And keeping offset by ordering doesn't work well too :
case 4 CDE move to the beginning
1-2-3-4-5-6-7-8-9
C-D-E-A-B-F-G-H-I
x x x x
ATM, I've not seen any easy way to implement a "clear and consistent" algorithm to determine the new offset after a collection changed.
So if some other devs have ideas, I would be grateful !
Maybe the solution is to forget about what is displayed and ensure that we are always seeing the same picture slots on screen?
1-2-3-4-5-6-7-8-9
A-B-C-D-E-F-G-H-I
x x x x
Case 2:
1-2-3-4-5-6
A-B-F-G-H-I
x x x x
Case 3:
1-2-3-4-5-6-7-8-9
D-A-B-C-E-F-G-H-I
x x x x
Case 4:
1-2-3-4-5-6-7-8-9
C-D-E-A-B-F-G-H-I
x x x x
That is, if we are looking at the 3 first images of the collection, we will always look at the 3 first whatever happens to the collection. This seems safe and very easy to understand for end-user. Won't this works in all cases? Any drawbacks?
BTW, what other software (shotwell, digikam, gthumb...) are doing in such situation ? Maybe following what others do will make more sense.
I'm not a dev... but still opinionated :-)
Basically you want a sort order that can be applied during a sort, which respects both the post-sort and pre-sort order. I don't think that is possible.
So what is it that the user is trying to do? Do a complete traverse of the collection without revisiting previously graded images? In that case moving D to the front should make it disappear from the screen, since it is "done" (a bucket-sort logic, D is "good enough"). If otoh it is meant to be competitive grading, ie what is the "best" image, then D needs to be kept on screen (first position reserved for highest ranked image) while the "challengers" continue to arrive in the remaining observation slots.
That could be generalised up to preserving upto the first n-1 of n slots.
But the basic problem is that there is no O(m) sorting routine for m objects, so there can be no single-pass complete sort.
So... I've done some quick tests with different software (note that I certainly have missed some specific features here, as I'm not really familiar with those apps...)
Finally, @TurboGit may be the better solution. Not to say that it's the simplest to implement :P
Ok, I've gone a little further in the implementation, and I finally think that keeping offsets in not a good idea after all, at least for this cases :
So after some thought, I think I'll be able to implement this :
I see one problematic case, if the change to the list move images but not the first one although the first is in the list : this can be the case if D has 4 stars, E-F has 3 stars and you apply "4 stars" to DEF
But well, this is a corner case, so I'm not sure that "failing" here is so problematic...
The "new" algorithm should do :
Initial situation (number is ordering value and letter is the imgid and little x means the image is shown)
1-2-3-4-5-6-7-8-9
A-B-C-D-E-F-G-H-I
x x x x
A. EF move to the beginning
1-2-3-4-5-6-7-8-9
E-F-A-B-C-D-G-H-I
x x x x
B. CDE are removed (example : they are selected and we reject the selection):
1-2-3-4-5-6
A-B-F-G-H-I
x x x x
C. D move to the beginning
1-2-3-4-5-6-7-8-9
D-A-B-C-E-F-G-H-I
x x x x
D. CDE are move to the beginning
1-2-3-4-5-6-7-8-9
C-D-E-A-B-F-G-H-I
x x x x
What do you think ? any drawback or forgotten cases ?
Hard to visualize all cases but what you describes seems workable to me. I suppose all this will be really tested when having the lt in front of us and see how the images are moving around and to see of our cognitive understanding makes sense of the new positions easily.
This issue did not get any activity in the past 30 days and will be closed in 7 days if no update occurs. Please check if the master branch has fixed it since then.
closing, now that lighttable rewrite as landed in master