diff --git a/i18n/en.json b/i18n/en.json index 5b14cd18033e0..e1538db1e45c5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1196,6 +1196,7 @@ "sort_items": "Number of items", "sort_modified": "Date modified", "sort_oldest": "Oldest photo", + "sort_people_by_similarity": "Sort people by similarity", "sort_recent": "Most recent photo", "sort_title": "Title", "source": "Source", diff --git a/web/src/lib/components/faces-page/merge-face-selector.svelte b/web/src/lib/components/faces-page/merge-face-selector.svelte index c50359c36278c..673ae9b2652c2 100644 --- a/web/src/lib/components/faces-page/merge-face-selector.svelte +++ b/web/src/lib/components/faces-page/merge-face-selector.svelte @@ -34,10 +34,14 @@ let hasSelection = $derived(selectedPeople.length > 0); let peopleToNotShow = $derived([...selectedPeople, person]); - onMount(async () => { - const data = await getAllPeople({ withHidden: false, closestPersonId: person.id }); + let sortFaces = $state(true); + + const handleSearch = async () => { + const data = await getAllPeople({ withHidden: false, closestPersonId: sortFaces ? person.id : undefined }); people = data.people; - }); + }; + + onMount(handleSearch); const handleSwapPeople = async () => { [person, selectedPeople[0]] = [selectedPeople[0], person]; @@ -149,8 +153,7 @@ - - + diff --git a/web/src/lib/components/faces-page/people-list.svelte b/web/src/lib/components/faces-page/people-list.svelte index 511792e536c35..6093bfa9d32b1 100644 --- a/web/src/lib/components/faces-page/people-list.svelte +++ b/web/src/lib/components/faces-page/people-list.svelte @@ -3,15 +3,18 @@ import FaceThumbnail from './face-thumbnail.svelte'; import SearchPeople from '$lib/components/faces-page/people-search.svelte'; import { t } from 'svelte-i18n'; + import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte'; interface Props { + sortFaces: boolean; screenHeight: number; people: PersonResponseDto[]; peopleToNotShow: PersonResponseDto[]; onSelect: (person: PersonResponseDto) => void; + handleSearch: () => void; } - let { screenHeight, people, peopleToNotShow, onSelect }: Props = $props(); + let { sortFaces = $bindable(true), screenHeight, people, peopleToNotShow, onSelect, handleSearch }: Props = $props(); let searchedPeopleLocal: PersonResponseDto[] = $state([]); @@ -28,6 +31,11 @@ +
+ +
+