Bug 491599 - Scroll index resets to item 0 in Similarity list window on delete of any list deletion
Summary: Scroll index resets to item 0 in Similarity list window on delete of any list...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Similarity (other bugs)
Version First Reported In: 8.5.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-11 22:05 UTC by Roland
Modified: 2024-08-13 19:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.5.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland 2024-08-11 22:05:53 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY

Deleting a duplicate (2 or more listed for the reference image) via the Del key in the list box resets the scroll index to the first element

STEPS TO REPRODUCE
1.  Run a search that will return >2 list items in the Duplicates list window
2. Use the arrow keys to scroll up/down to visually verify that the suggested matches are actually duplicates
3. For any duplicate record entry > position 1, hit the Del key. This will delete all matches for that entry except the reference image.
4. Scroll down via arrow key, and you will find you are looking at item 1 in the list.

OBSERVED RESULT
System is resetting the index to item 1 vs leaving it at the active entry. 

EXPECTED RESULT
System should retain its position in the list, so that a down arrow key selects the next item in the list vs resetting to item 1.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2024-08-12 05:56:14 UTC
Point 3 is not correct, the delete key deletes the first item when it is selected, this can also be the reference image. So it can be dangerous to just press the delete key without paying attention to the refermz image. If you select the images you want to delete, the duplicates list will have lost focus anyway.

Maik
Comment 2 Maik Qualmann 2024-08-12 20:38:08 UTC
Git commit 17f34664539c70bcb24b6dcba369096141a4832f by Maik Qualmann.
Committed on 12/08/2024 at 20:36.
Pushed by mqualmann into branch 'master'.

select next list entry if duplicate images are deleted
FIXED-IN: 8.5.0

M  +1    -1    NEWS
M  +50   -0    core/utilities/fuzzysearch/findduplicatesalbum.cpp

https://invent.kde.org/graphics/digikam/-/commit/17f34664539c70bcb24b6dcba369096141a4832f
Comment 3 Roland 2024-08-13 19:52:21 UTC
Hi Mark

Thank you for the correction on my understanding of how the default Del works for duplicates. I would suggest the behavior as it is implemented is probably a logical bug. There is a mechanism for defining the reference image during the filtering. That is, this is not arbitrary, and I think it would be reasonable to expect that the system would not default to deletion of the reference image. Of course, it may be that the user wishes to delete the reference image, but that could just be intervention in the form of a manual selection of which duplicate(s) to delete for that list entry.

Its not sarcasm when I ask- what is the purpose of defining a reference image in a function like this if the reference image isnt intended to be special in some way?  That is, if there are filters to define Reference as 'prefer newer date' or 'larger image' or 'newest modified', the implication is that the user considers those to be primary against which other instances are assumed to be duplicates. 

In my view, it would be best to simply always place the reference image at position 1 in the summary view, and have the focus for 'delete' on the first non-reference image. In a scenario where someone runs a Similarity check against 1 or more albums, it is possible to simply hit the 'remove duplicates' button as a batch process,  and it isnt at all clear from that: if duplicates arent defined as non-reference, then this is doing something that isnt implied (at least, not to me). 

Best
Rob