Skip to content

feat: Phase 4-5 VCard import, dedup/merge, Stream G tests#52

Merged
rprabhat merged 1 commit into
mainfrom
feat/phase4-5-vcard-import-dedup-tests
Jun 17, 2026
Merged

feat: Phase 4-5 VCard import, dedup/merge, Stream G tests#52
rprabhat merged 1 commit into
mainfrom
feat/phase4-5-vcard-import-dedup-tests

Conversation

@rprabhat

Copy link
Copy Markdown
Collaborator

Summary

Phase 4-5 implementation completing VCard import, contact deduplication/merge, and comprehensive test coverage.

Phase 4 Changes:

  • D5 VCard Import: VCardParser.kt (parse/parseMultiple), ContactsViewModel.importVCard(), ContactsScreen import button with testTag="import-vcard-button"
  • E2/E3 Dedup + Merge: ContactDeduplicator.kt (exact email/phone + fuzzy name similarity >0.8, same company >0.5), ContactsViewModel merge/dismiss, ContactsScreen DuplicateBanner + MergeDialog
  • D1/D3: Confidence badge (HIGH/MEDIUM/LOW), error classification (ScanError sealed class)

Phase 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:

  • Java 17 required (not Java 25)
  • Ezvcard.parse().all() for correct API usage
  • MaterialTheme.colorScheme.error instead of unqualified Error (icon conflict)

Dependencies Added:

  • kotlinx-coroutines-test:1.8.1
  • androidx.arch.core:core-testing:2.2.0

Verification:

  • All compile: :app:compileDebugKotlin, :app:compileDebugUnitTestKotlin, :app:compileDebugAndroidTestKotlin
  • Unit tests: 118 passed ✅

- 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
@rprabhat rprabhat merged commit 6ffa195 into main Jun 17, 2026
4 checks passed
@rprabhat rprabhat deleted the feat/phase4-5-vcard-import-dedup-tests branch June 17, 2026 13:33
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants