Repository navigation
Fix/find similar includes self - #39
Merged
Merged
Conversation
find_similar() excluded file_id from its own results, so right-clicking a file and choosing "Find similar" made the file you clicked disappear from the grid. It's now returned first, at distance 0 / 100% similarity. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Mirrors the existing visual-stack ("Show only this group") feature: a
right-click menu entry when the file has stack_count > 1, plus a
details-pane button. The backend stack= filter already existed but was
never reachable from the UI.
Along the way, fixed a real bug this exposed: filtering to one
stack/vstack group while "Collapse duplicates" is checked (the default)
collapsed the group down to a single representative row, hiding the
very copies being browsed - both filters now bypass collapse.
Also hardens find_similar() for the no-phash case: it now returns the
file itself instead of an empty list, consistent with the has-phash path.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
The grid badge shows whichever grouping is non-trivial - "≈ N" for a near-duplicate (vstack) group takes precedence over "⬚ N" for an exact stack - but the right-click menu only ever offered "Show all copies" (the exact stack). Right-clicking a file badged "≈ 28" had no menu entry that reached those 28; only "Show details" > "Show only this group" did. Adds a matching "Show visually similar (N)" entry. Co-Authored-By: Claude Sonnet 5 <[email protected]>
"Show all copies" and "Show visually similar" forced a choice the
examiner shouldn't have to make: a collapsed tile hides one group,
picked by /api/files' own collapse logic - COALESCE(vstack_id,
stack_id, id) - and previously there was no way to tell from the menu
which of the two entries would actually be non-trivial without reading
the badge first. One "Show all in group (N)" entry now mirrors that
same COALESCE precedence: visual group if the file has one, else its
exact-copy stack. The two separate buttons in the details pane ("Show
only this group" / "Show all copies") are unaffected - this only
touches the right-click quick menu.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Avoids adding a second test function with its own `case` fixture parameter, which pylint's lint-changed-files gate flags as a new redefined-outer-name occurrence (the pattern is pre-existing debt elsewhere in this file, but a genuinely new line of it still counts as introduced). Same coverage, one function. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
find_similar()no longer excludes the file you clicked - it's returned first, at distance 0 / 100% similarity, so it doesn't disappear from its own results grid. Also fixed for files with no pHash (now returns just themselves instead of an empty list).stack=filter as "Show all copies" for exact-duplicate stacks in the details pane, and fixed a bug it exposed: filtering to one stack/vstack group while "Collapse duplicates" is checked used to collapse the group back down to one row, hiding the very copies being browsed./api/files' own collapse logic (COALESCE(vstack_id, stack_id, id)) - it opens the visual-similarity group when the file has one, otherwise its exact-copy stack, instead of forcing a choice between two separate menu entries.Tested:
pytest tests -q- 176 passed, 3 skipped, 3 pre-existing failures reproduced identically on a clean origin/main checkout (unrelated: a search-fixture assertion and a missing local piexif install). Built the frozen exe and smoke-tested --version.🤖 Generated with Claude Code