-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: unassign faces #9374
feat: unassign faces #9374
Conversation
7474201
to
7e2faf8
Compare
Deploying immich with Cloudflare Pages
|
7e7454a
to
0c3a058
Compare
0c3a058
to
7e9dcaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Server code looks pretty good, web is just always complex unfortunately :(
|
||
await expect(sut.unassignFace(authStub.admin, faceStub.face1.id)).resolves.toStrictEqual( | ||
mapFaces(faceStub.unassignedFace, authStub.admin), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to also expect some of the repo methods to have been called. Specifically that requirePermission
gets called for PERSON_WRITE
. Also, I would like to see a test without a personId, so that you don't run into that if but instead run into the createNewFeaturePhoto
method. Basically try to cover the relevant branches.
|
||
await expect( | ||
sut.unassignFaces(authStub.admin, { data: [{ assetId: faceStub.face1.id, personId: 'person-1' }] }), | ||
).resolves.toStrictEqual([{ id: 'assetFaceId1', success: true }]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, some branches remain untested.
const changeFeaturePhoto: string[] = []; | ||
const results: BulkIdResponseDto[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My OCD really likes that these two lines have the exact same length lmao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They just line up so perfectly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem with it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nothing, I was just happy about that lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a positive comment :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn, I just saw it. Satisfying 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The html in here is pretty complex (deeply nested, many branches, etc). I'm not really sure how to properly fix this? Maybe it's just a general issue of the page structure? Maybe sub-components could help as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure either, maybe I chose the wrong way to do this
web/src/lib/components/faces-page/unassigned-faces-side-panel.svelte
Outdated
Show resolved
Hide resolved
people?: PersonWithFacesResponseDto[]; | ||
people?: PeopleWithFacesResponseDto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change! I'm not really sure how to handle this case, as it isn't covered by the PropertyLifecycle
idea. The proper approach would probably be to introduce a new variable? Interested for @jrasm91 opinion on this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's a breaking change. It's fine to have another variable, but I prefer to have everything in people
.
Another simple fix would be to send all faces: currently we only filter faces associated with a person. But I prefer to represent faces/people like that:
"people": {
"visiblePeople": [
{
"birthDate": null,
"id": "b70e6b20-2dce-4184-aa20-dac1c9717a16",
"isHidden": false,
"name": "Test Person",
"thumbnailPath": "thumbnail.jpg",
"faces": [
{
"id": "ef8c6a56-2891-424b-a521-11c673e9bfd3",
"imageHeight": 1440,
"imageWidth": 1920,
"boundingBoxX1": 1494,
"boundingBoxX2": 1705,
"boundingBoxY1": 430,
"boundingBoxY2": 733
}
]
}
],
"numberOfFaces": 2
}
Co-authored-by: Daniel Dietzler <[email protected]>
…svelte Co-authored-by: Daniel Dietzler <[email protected]>
…svelte Co-authored-by: Daniel Dietzler <[email protected]>
5c42546
to
ff865e3
Compare
ff865e3
to
8f683f8
Compare
8f683f8
to
0f6e665
Compare
Hi. Any updates on this feature? |
Stale |
Continuing #5511, using the UI proposed here