Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / contacts / AGENTS.md
| 1 | # AGENTS.md — contacts/ (':contacts') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `contacts/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install contacts (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :contacts / dir: contacts/ |
| 8 | - Package roots present: ui, data, intents, auth |
| 9 | - Entry files: MainActivity.kt (no Route.kt — list/detail/edit flow with dialogs + pick activities) |
| 10 | - Deps: (none — contacts provider + account framework only) |
| 11 | - Metadata: metadata_data/contacts.md (present) |
| 12 | - Rust: no / screenshotTest: yes |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Offline system contacts app — Google Contacts replacement minus cloud sync; handles system pick/view/edit/create intents, vCard import/export, SIM contacts, groups. |
| 16 | **Key features:** |
| 17 | - List/detail/edit with groups, favorites, photo crop, birthdays/dates, per-account storage via `auth/Authenticator` |
| 18 | - vCard import/export + SIM import; quick actions into WhatsApp/Telegram; assistant read/add via `intents/` |
| 19 | - Optional calendar birthday sync (`CalendarSyncHelper` + `CalendarWorker`); everysync is the sync story, not this app |
| 20 | **Architecture / data-flow:** `ui/` list/detail/edit pages (+ `ui/dialogs/`) → `util/ContactViewModel` (+ split `Accounts`/`Draft` helpers, `ContactsUiContract`) → `data/` models over the system contacts provider (`Contact`/`ContactGroup`, `ContactPrefill`, `SimContacts`); persistence is the provider, not Room — there is no database here. |
| 21 | **Entry points + reading order:** `MainActivity.kt` → `ui/ContactListScreen.kt` → `ui/ContactDetailsPage.kt` → `ui/EditContactPage.kt` → `util/ContactViewModel.kt` → `data/Contact.kt`. |
| 22 | **Gotchas:** |
| 23 | - `util/` is NOT a closed package root — the `util/`→closed-roots migration is pending; don't add more files there |
| 24 | - Write paths go through the contacts provider + account (`auth/`), not a local DB — account picker dialogs matter |
| 25 | - `ImportActivity` + `ImportVcfScreen` handle VIEW intents; `ContactListPick`/`ContactItemPick` serve picker callers |
| 26 | |
| 27 | ## Key files |
| 28 | ### Root + auth/ — entry and account framework |
| 29 | - com/vayunmathur/contacts/MainActivity.kt |
| 30 | - com/vayunmathur/contacts/auth/Authenticator.kt |
| 31 | ### data/ — provider-backed models (no Room) |
| 32 | - com/vayunmathur/contacts/data/Contact.kt |
| 33 | - com/vayunmathur/contacts/data/ContactGroup.kt |
| 34 | - com/vayunmathur/contacts/data/ContactPrefill.kt |
| 35 | - com/vayunmathur/contacts/data/SimContacts.kt |
| 36 | ### util/ — ViewModel + helpers (pending migration to closed roots) |
| 37 | - com/vayunmathur/contacts/util/ContactViewModel.kt |
| 38 | - com/vayunmathur/contacts/util/ContactViewModelAccounts.kt |
| 39 | - com/vayunmathur/contacts/util/ContactViewModelDraft.kt |
| 40 | - com/vayunmathur/contacts/util/ContactsUiContract.kt |
| 41 | - com/vayunmathur/contacts/util/ContactSorting.kt |
| 42 | - com/vayunmathur/contacts/util/VcfUtils.kt |
| 43 | - com/vayunmathur/contacts/util/CalendarSyncHelper.kt |
| 44 | - com/vayunmathur/contacts/util/CalendarWorker.kt |
| 45 | - com/vayunmathur/contacts/util/PackageUtils.kt |
| 46 | ### ui/ + ui/dialogs/ — list/detail/edit/import |
| 47 | - com/vayunmathur/contacts/ui/ContactListScreen.kt |
| 48 | - com/vayunmathur/contacts/ui/ContactList.kt |
| 49 | - com/vayunmathur/contacts/ui/ContactItem.kt |
| 50 | - com/vayunmathur/contacts/ui/ContactListPick.kt |
| 51 | - com/vayunmathur/contacts/ui/ContactItemPick.kt |
| 52 | - com/vayunmathur/contacts/ui/GroupedContactSection.kt |
| 53 | - com/vayunmathur/contacts/ui/GroupsPage.kt |
| 54 | - com/vayunmathur/contacts/ui/FavoritesHeader.kt |
| 55 | - com/vayunmathur/contacts/ui/LetterHeader.kt |
| 56 | - com/vayunmathur/contacts/ui/AvatarColors.kt |
| 57 | - com/vayunmathur/contacts/ui/ContactUiHelpers.kt |
| 58 | - com/vayunmathur/contacts/ui/ContactDetailsPage.kt |
| 59 | - com/vayunmathur/contacts/ui/ContactDetailsHeader.kt |
| 60 | - com/vayunmathur/contacts/ui/ContactDetailsRows.kt |
| 61 | - com/vayunmathur/contacts/ui/ContactDetailsSections.kt |
| 62 | - com/vayunmathur/contacts/ui/ContactDetailsComms.kt |
| 63 | - com/vayunmathur/contacts/ui/ContactDetailsFormat.kt |
| 64 | - com/vayunmathur/contacts/ui/EditContactPage.kt |
| 65 | - com/vayunmathur/contacts/ui/EditContactNameSection.kt |
| 66 | - com/vayunmathur/contacts/ui/EditContactPhotoSection.kt |
| 67 | - com/vayunmathur/contacts/ui/EditContactAccountSection.kt |
| 68 | - com/vayunmathur/contacts/ui/EditContactBirthday.kt |
| 69 | - com/vayunmathur/contacts/ui/EditContactDateDetails.kt |
| 70 | - com/vayunmathur/contacts/ui/EditContactDetailGroups.kt |
| 71 | - com/vayunmathur/contacts/ui/EditContactGroupSection.kt |
| 72 | - com/vayunmathur/contacts/ui/CropPhotoScreen.kt |
| 73 | - com/vayunmathur/contacts/ui/CropPhotoSection.kt |
| 74 | - com/vayunmathur/contacts/ui/NamePrefixChooser.kt |
| 75 | - com/vayunmathur/contacts/ui/NameSuffixChooser.kt |
| 76 | - com/vayunmathur/contacts/ui/ImportActivity.kt |
| 77 | - com/vayunmathur/contacts/ui/ImportVcfScreen.kt |
| 78 | - com/vayunmathur/contacts/ui/InsertOrEditContactScreen.kt |
| 79 | - com/vayunmathur/contacts/ui/SettingsPage.kt |
| 80 | - com/vayunmathur/contacts/ui/dialogs/AddAccountDialog.kt |
| 81 | - com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.kt |
| 82 | - com/vayunmathur/contacts/ui/dialogs/EventDatePickerDialog.kt |
| 83 | - com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.kt |
| 84 | ### intents/ — assistant IPC |
| 85 | - com/vayunmathur/contacts/intents/GetIntent.kt |
| 86 | - com/vayunmathur/contacts/intents/InsertIntent.kt |
| 87 | |
| 88 | ## Verify (this module only) |
| 89 | ``` |
| 90 | ./gradlew :contacts:compileDevKotlin |
| 91 | ./gradlew :contacts:lint |
| 92 | ./gradlew :contacts:checkMetadata |
| 93 | ``` |