タスクキルをしなくとも複数人数登録可能に - #27
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes face registration dialog selection to handle multiple unrecognized faces properly. The previous implementation only targeted the first unrecognized face, causing unstable selection when multiple faces were present.
- Introduces explicit tracking ID management for dialog target selection
- Updates dialog logic to prioritize previously selected faces, then stable unrecognized faces, then first unrecognized face
- Passes tracking ID explicitly to the save function instead of relying on internal face detection
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CameraViewModel.kt | Adds tracking ID state management and updates face registration logic to handle multiple faces |
| CameraScreen.kt | Updates UI to use explicit tracking ID instead of searching for first unrecognized face |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| dismissNameDialog() | ||
| } catch (e: Exception) { | ||
| println("Failed to save person name: ${e.message}") | ||
| fun savePersonName(trackingId: Int, name: String) { |
There was a problem hiding this comment.
The function definition is missing proper indentation. It should be indented to match the class structure.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Intに変えたのでIntを超えたらここでエラー |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| val trimmed = name.trim() | ||
| if (trimmed.isEmpty()) { | ||
| return@launch |
There was a problem hiding this comment.
Early return when name is empty doesn't call dismissNameDialog(), leaving the dialog open with cleared tracking ID state. This creates an inconsistent UI state.
| return@launch | |
| println("Name is empty. Dialog will be dismissed.") | |
| } else { | |
| println("Attempting to save person with trackingId: $trackingId, name: $trimmed") | |
| val personId = faceDetector?.saveNewPersonWithEmbedding(trackingId, trimmed) | |
| if (personId != null) { | |
| println("Successfully saved new person: $trimmed (ID: $personId)") | |
| } else { | |
| println("Failed to save new person: $trimmed. personId is null.") | |
| } |
0101d12 to
40d4924
Compare
正常に動くことは確認
タスクキルせずに以下の人数登録確認
