MS-1502 Refactor Life feedback fragment to have a single UI state#1737
Merged
Conversation
luhmirin-s
requested review from
a team,
BurningAXE,
TristramN,
alex-vt,
alexandr-simprints,
Copilot,
meladRaouf and
ybourgery
and removed request for
a team
July 9, 2026 09:35
There was a problem hiding this comment.
Pull request overview
This PR refactors the face live-feedback capture screen to use a single, immutable UI state (LiveFeedbackState) exposed from the ViewModel via StateFlow, with the fragment rendering deterministically from that state. It also removes the legacy BAD_QUALITY face-detection status from capture logic/tests and deprecates the corresponding face-capture event result.
Changes:
- Replaced multiple
LiveDatastreams in the live-feedback ViewModel/fragment with a singleStateFlow<LiveFeedbackState>and state-driven rendering. - Removed
FaceDetection.Status.BAD_QUALITYand stopped emittingFaceCapturePayload.Result.BAD_QUALITY(now deprecated in event model). - Consolidated/rewrote live-feedback ViewModel tests into a single behavior-pinning test file and updated related capture tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| infra/events/src/main/java/com/simprints/infra/events/event/domain/models/FaceCaptureEvent.kt | Deprecates the legacy BAD_QUALITY event result value. |
| face/capture/src/main/java/com/simprints/face/capture/models/FaceDetection.kt | Removes BAD_QUALITY from detection statuses. |
| face/capture/src/main/java/com/simprints/face/capture/usecases/SimpleCaptureEventReporter.kt | Stops mapping capture status to BAD_QUALITY payload results. |
| face/capture/src/main/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackViewModel.kt | Refactors to single-source-of-truth StateFlow state, removes runBlocking, and drives UI via emitted state snapshots. |
| face/capture/src/main/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackState.kt | Introduces immutable UI state + progress model + status→feedback mapping. |
| face/capture/src/main/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackFragment.kt | Renders from LiveFeedbackState and collects state with repeatOnLifecycle. |
| face/capture/src/test/java/com/simprints/face/capture/usecases/SimpleCaptureEventReporterTest.kt | Updates expectations to match removal of BAD_QUALITY reporting. |
| face/capture/src/test/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackViewModelTest.kt | New consolidated tests for the refactored single-state ViewModel. |
| face/capture/src/test/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackFragmentViewModelTest.kt | Removes legacy tests for the old ViewModel shape. |
| face/capture/src/test/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackAutoCaptureFragmentViewModelTest.kt | Removes legacy auto-capture tests for the old ViewModel shape. |
| face/capture/src/test/java/com/simprints/face/capture/screens/FaceCaptureViewModelTest.kt | Initializes the Face BioSDK in tests to align with updated ViewModel behavior. |
Comments suppressed due to low confidence (1)
face/capture/src/main/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackViewModel.kt:105
emit()'s parameters are non-nullable, so the Elvis operators (phase ?: ...,feedback ?: ...,result ?: ...) are dead code and will always pick the left-hand side. This adds noise and can mask intent (e.g., if the goal was to allow passingnullto keep existing state).
luhmirin-s
force-pushed
the
feature/MS-1502-livefeedback-refactoring
branch
from
July 9, 2026 09:46
4d3d11d to
3583931
Compare
luhmirin-s
marked this pull request as ready for review
July 9, 2026 09:46
alexandr-simprints
requested changes
Jul 9, 2026
luhmirin-s
force-pushed
the
feature/MS-1502-livefeedback-refactoring
branch
from
July 9, 2026 11:30
3583931 to
99af6ca
Compare
meladRaouf
approved these changes
Jul 13, 2026
luhmirin-s
force-pushed
the
feature/MS-1502-livefeedback-refactoring
branch
from
July 13, 2026 10:09
99af6ca to
12a74f7
Compare
luhmirin-s
force-pushed
the
feature/MS-1491-spoof-check-ux
branch
from
July 13, 2026 10:09
467fefa to
69827c7
Compare
alexandr-simprints
approved these changes
Jul 13, 2026
luhmirin-s
force-pushed
the
feature/MS-1491-spoof-check-ux
branch
from
July 14, 2026 14:12
69827c7 to
7565841
Compare
luhmirin-s
force-pushed
the
feature/MS-1502-livefeedback-refactoring
branch
from
July 14, 2026 14:12
12a74f7 to
a902bf9
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



JIRA ticket
Will be released in: 2026.3.0
Notable changes
Testing guidance
Additional work checklist