feat: Phase 4-5 VCard import, dedup/merge, Stream G tests#52
Merged
Conversation
- D5: VCard import (VCardParser, ContactsViewModel.importVCard, ContactsScreen import button) - E2/E3: Contact dedup (ContactDeduplicator exact + fuzzy) and merge UI (ViewModel merge/dismiss, Screen banner + dialog) - D1/D3: Confidence badge + error classification (ScanScreen, ScanViewModel) - Stream G tests: VCardParserTest (11), ContactDeduplicatorTest (15), ContactsViewModelTest (6), ContactsTest (+3 instrumented) - Build fix: Java 17, Ezvcard.parse().all(), MaterialTheme.colorScheme.error - Added kotlinx-coroutines-test + core-testing deps
| val edges = (0 until 4).map { i -> | ||
| val (x1, y1) = corners[i] | ||
| val (x2, y2) = corners[(i + 1) % 4] | ||
| sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) |
| val p2x = srcPoints[4]; val p2y = srcPoints[5] | ||
| val p3x = srcPoints[6]; val p3y = srcPoints[7] | ||
|
|
||
| val topW = sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y)) |
| val p3x = srcPoints[6]; val p3y = srcPoints[7] | ||
|
|
||
| val topW = sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y)) | ||
| val bottomW = sqrt((p2x - p3x) * (p2x - p3x) + (p2y - p3y) * (p2y - p3y)) |
|
|
||
| val topW = sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y)) | ||
| val bottomW = sqrt((p2x - p3x) * (p2x - p3x) + (p2y - p3y) * (p2y - p3y)) | ||
| val leftH = sqrt((p3x - p0x) * (p3x - p0x) + (p3y - p0y) * (p3y - p0y)) |
| val topW = sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y)) | ||
| val bottomW = sqrt((p2x - p3x) * (p2x - p3x) + (p2y - p3y) * (p2y - p3y)) | ||
| val leftH = sqrt((p3x - p0x) * (p3x - p0x) + (p3y - p0y) * (p3y - p0y)) | ||
| val rightH = sqrt((p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y)) |
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.
Summary
Phase 4-5 implementation completing VCard import, contact deduplication/merge, and comprehensive test coverage.
Phase 4 Changes:
VCardParser.kt(parse/parseMultiple),ContactsViewModel.importVCard(),ContactsScreenimport button withtestTag="import-vcard-button"ContactDeduplicator.kt(exact email/phone + fuzzy name similarity >0.8, same company >0.5),ContactsViewModelmerge/dismiss,ContactsScreenDuplicateBanner+MergeDialogPhase 5 - Stream G Tests:
VCardParserTest.kt- 11 unit tests (parse/parseMultiple: valid, empty, garbage, missing/blank FN)ContactDeduplicatorTest.kt- 15 unit tests (normalizedSimilarity, exact email/phone, fuzzy name, exact exclusion)ContactsViewModelTest.kt- 6 unit tests (init loads Success/Empty/Error, dismissDuplicatePair, dismissDuplicates)ContactsTest.kt- +3 instrumented tests (import button visible, export button visible)Build Fixes:
Ezvcard.parse().all()for correct API usageMaterialTheme.colorScheme.errorinstead of unqualifiedError(icon conflict)Dependencies Added:
kotlinx-coroutines-test:1.8.1androidx.arch.core:core-testing:2.2.0Verification:
:app:compileDebugKotlin,:app:compileDebugUnitTestKotlin,:app:compileDebugAndroidTestKotlin✅