Skip to content

fix(web): suggest and merge existing people when naming a person - #1136

Open
Deeds67 wants to merge 3 commits into
mainfrom
fix/1098-rename-suggests-shared-people
Open

Deeds67 wants to merge 3 commits into
mainfrom
fix/1098-rename-suggests-shared-people

Conversation

@Deeds67

@Deeds67 Deeds67 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1098, fixes #1099, fixes #1100.

Cause

All three come from the same gap: naming a person never checked the name against people who already exist in a Space. The reports make it look like Admin vs Editor. It's really about who owns the people: the admin owns the library where the pets were detected, and the editor sees them only through a Space.

Together these left an editor naming a Space pet with no route to the existing one, which is how the reporter ended up with three "Norgy" entries.

Changes

Person page (/people/[personId])

  • The name field searches with withSharedSpaces.
  • The same-name check on save also searches with withSharedSpaces.
  • Suggestion avatars come from getGlobalPersonThumbnailUrl, so a Space person's avatar loads from the Space endpoint instead of 404ing on the owner-only one.

People grids (people-management-grid.svelte)

  • New optional searchNameSuggestions / onSuggestionSelect props add a suggestion dropdown under the tile's name field. It's a combobox (aria-activedescendant, arrow keys and Enter, Escape closes it).
  • Picking a suggestion offers a merge instead of renaming. mousedown is cancelled so the click doesn't blur the input and commit the typed text first.

Global People grid

  • Suggestions come from searchPerson({ withSharedSpaces: true }).
  • The same-name check now covers Space people (the isPersonalPrimary gate is gone) and searches shared spaces. It dates from the global-identities change (feat: add global face identities across spaces #495), before PersonMergeSuggestionModal learned to send Space people through the scoped merge.
  • Declining the merge for a picked suggestion leaves the name alone. Declining the prompt for a typed exact name still renames, as before.
  • The post-merge rename in handleMerge goes through updatePersonName instead of the owner-only updatePerson, so it writes to the Space for a Space person.

Space People grid and Space person page

  • Suggestions come from getSpacePeople({ name, named: true }).
  • A new helper, space-person-name-merge.ts, finds a Space person with the same name (ignoring case and accents). It then asks before running the Space merge, with the cross-owner confirmation. Both Space surfaces use it, and the Space person page's existing suggestion pick now uses it too, instead of its own copy.
  • Declining the merge keeps the rename, so two genuinely different pets can still share a name.

There are no server or i18n changes. GET /search/person?withSharedSpaces=true is already RBAC-scoped through searchAccessiblePeople, and the dropdown's label reuses the existing suggestions key.

Not changed

The asset-viewer face editor and the assign-face panel still list only the viewer's own people. They reassign faces rather than name a person, so they're a separate question.

Tests

  • person-detail-page.spec.ts: an editor renaming a Space person gets shared-space suggestions with the Space thumbnail. Saving an exact shared name opens the merge modal.
  • person-merge-suggestion-modal.spec.ts: a Space-to-Space merge goes through mergeScopedPeople, never mergePersonLegacy. This pins existing behaviour.
  • people-page.spec.ts: a global grid tile suggests shared-space people and picking one opens the merge modal without renaming. A Space-primary tile given an existing shared name opens the merge modal.
  • space-people-page.spec.ts: a Space grid tile suggests and merges on click and with the keyboard. Declining a picked suggestion changes nothing. A typed exact name (different case) offers the merge.
  • space-person-detail-page.spec.ts: a typed exact name on the Space person page merges and navigates to the surviving person. Declining still renames.

With the source changes set aside, the two #1098 page tests and the seven new grid and Space-page behaviour tests all fail. The decline-fallback test and the modal test pass either way; they pin existing behaviour.

Two existing tests changed. The Space grid's "no refresh after rename" check now allows name-filtered lookups. The Space person page's rename test waits for the save, which now looks up the name first.

The full web unit suite passes locally (6407 tests). Prettier, eslint and tsc are clean on the changed files. svelte-check reports no new warnings.

The rename autosuggest on /people/[personId] searched only people the
viewer owns. A Space editor naming a person detected in someone else's
library owns none of the existing people, so the dropdown stayed empty
and every typo created a new identity. It looked like an admin/editor
difference only because the admin owned the library.

Search with withSharedSpaces for both the suggestion dropdown and the
exact-name merge check, and resolve suggestion thumbnails per profile so
a Space person's avatar loads from the Space endpoint. The merge modal
already routes Space-scoped people through the scoped merge.

Fixes #1098
@Deeds67 Deeds67 added the changelog:fix Bug fix for changelog label Sep 24, 2026
… modal

When a Space editor renames a Space person to an existing Space person's
name (#1100), neither side belongs to them, so the merge has to go through
the scoped merge instead of the owner-only legacy merge.
… tile (#1099, #1100)

The inline "Add a name" field on the People grids was a plain input, so an
existing identity could only be reached by typing its exact name. That
path didn't catch duplicates either: the global grid skipped its same-name
check for Space people and searched only owned people, and the Space grid
and Space person page renamed straight through. An editor naming a Space
pet had no way to land on the existing one.

- The grid can now show a suggestion dropdown (combobox, arrow keys and
  Enter). Picking a suggestion offers a merge instead of renaming.
- The global grid suggests from shared spaces too. Its same-name check now
  covers Space people, and the post-merge rename goes through
  updatePersonName, so a Space person's name is written to the Space.
- The Space grid and Space person page look for a same-named Space person
  before renaming, and offer the Space merge (with the cross-owner
  confirmation). Declining keeps the rename.

Fixes #1099
Fixes #1100
@Deeds67 Deeds67 changed the title fix(web): suggest shared-space people when renaming a person fix(web): suggest and merge existing people when naming a person Sep 24, 2026
@Deeds67 Deeds67 added the rc Auto-build a release-candidate server image and post it on the PR label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

🧪 Release candidate build

Latest RC pr-1136-rc.0, built from 650b637 · build run

Images published

  • ghcr.io/open-noodle/gallery-server:pr-1136-rc.0 (linux/amd64 + linux/arm64)
How to run this RC

In the directory containing your docker-compose.yml, create (or append to) a docker-compose.override.yml:

services:
  immich-server:
    image: ghcr.io/open-noodle/gallery-server:pr-1136-rc.0

Then pull and restart:

docker compose pull immich-server
docker compose up -d

Each push publishes a new numbered tag, so update the image line to move to a newer RC. To roll back, point it at an earlier rc.<n> or delete the override and run docker compose up -d again.

Last updated Thu, 24 Sep 2026 17:55:54 GMT. Every push while the rc/rc-ml label is set publishes a new numbered RC. All pr-1136 RC images are deleted when this PR closes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:fix Bug fix for changelog rc Auto-build a release-candidate server image and post it on the PR 🖥️web

Projects

None yet

1 participant