Skip to content

Fix/find similar includes self - #39

Merged
charpy4n6 merged 5 commits into
mainfrom
fix/find-similar-includes-self
Sep 5, 2026
Merged

charpy4n6 merged 5 commits into
mainfrom
fix/find-similar-includes-self

Conversation

@charpy4n6

@charpy4n6 charpy4n6 commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator
  • 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).
  • Wired up the previously-unreachable 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.
  • The right-click menu gets a single Show all in group (N) entry that mirrors /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

charpy4n6 and others added 5 commits September 5, 2026 16:16
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]>
@charpy4n6
charpy4n6 merged commit 02c83a5 into main Sep 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant