Skip to content

fix: align pubky and paykit ui#1097

Open
ben-kaufman wants to merge 3 commits into
codex/paykit-watch-only-accountsfrom
codex/970-pubky-paykit-ui-parity
Open

fix: align pubky and paykit ui#1097
ben-kaufman wants to merge 3 commits into
codex/paykit-watch-only-accountsfrom
codex/970-pubky-paykit-ui-parity

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #970

Depends on #1084.

This PR:

  1. Aligns Pubky profile onboarding, profile display/editing, and contact screens with the v61 Figma designs.
  2. Updates contact import, add, scan, detail, tag, and delete flows with the revised layouts, copy, spacing, accessibility, and navigation.
  3. Simplifies Paykit contact payments to one shared setting and removes the obsolete payment-preference screen.

Description

The Android Pubky and Paykit flows still mixed older layouts and settings with the v61 designs. Profile and contact screens used outdated spacing, labels, dividers, key formatting, and sheet sizing, while contact payments were split across onboarding and a separate per-method preference screen.

This update brings those flows together around the latest design. Profile and contact editing share the revised form treatment, contact import and add flows follow the new hierarchy, Pubky scanning uses its dedicated presentation, and newly added contacts can be reviewed or deleted from the detail screen. Profile and contact tags can be added and removed directly from their detail screens with stable, accessible controls.

General settings now exposes one payments-with-contacts switch backed by the receiver-aware behavior from #1084. Lightning and on-chain receiving remain enabled for the simplified Paykit experience. Paykit lifecycle/concurrency, sign-out and wallet-wipe safety, and unrelated endpoint-cleanup hardening are intentionally outside this PR.

Preview

QA Notes

Manual Tests

  • 1. Profile onboarding → Create Profile: copy, title treatment, avatar, and form spacing match the v61 Figma frames.
  • 2. Profile → Edit Profile: BIO label, public-data notice, links, delete action, and bottom actions match the design.
  • 3a. Profile → add and remove tags: changes persist and the tag controls expose clear accessibility labels.
    • 3b. Contact Detail → add and remove tags: changes persist after reopening the contact.
  • 4. Contacts → contact list: rows use the revised divider and spacing treatment without alphabet headers.
  • 5a. Contacts → Add Contact → Scan QR: Pubky scanner uses the revised status and paste presentation.
    • 5b. valid Pubky → save contact: Contact Detail opens with the delete action and confirmation flow.
  • 6. Profile import → overview → select contacts: trimmed Pubky key, selection rows, counts, and import actions match the design.
  • 7. Profile onboarding → Pay Contacts → Continue: contact payments enable without the removed opt-in toggle.
  • 8. Settings → General → Payments → Enable payments with contacts: the full row toggles once, exposes switch semantics, and cannot be double-triggered rapidly.
  • 9. Settings → General: Payment Preference is no longer shown or navigable.

Automated Checks

  • Unit tests added or expanded: contact-payment enable/disable behavior in ContactPaymentSettingsRepoTest.kt; profile and contact tag persistence in ProfileViewModelTest.kt and ContactDetailViewModelTest.kt; hidden Paykit method migration in SettingsSerializerTest.kt; and Pubky key formatting in PubkyPublicKeyFormatTest.kt.
  • Instrumented Compose tests added: tag accessibility and click handling in TagButtonTest.kt, plus full-row switch semantics and debouncing in SettingsSwitchRowTest.kt.
  • Unit tests modified: saved-contact navigation, Pay Contacts continuation, and General settings delegation in AddContactViewModelTest.kt, PayContactsViewModelTest.kt, and SettingsViewModelTest.kt.
  • Local: compileDevDebugKotlin, testDevDebugUnitTest, compileDevDebugAndroidTestKotlin, and detekt --rerun-tasks pass against the original rc37 artifact used by feat: add Paykit server accounts #1084. The currently published rc37 artifact resolves to a different breaking API; correcting that base dependency is outside this PR.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR aligns the Pubky and Paykit contact experience with the latest designs. The main changes are:

  • Refreshed profile, contact, import, scanner, and editing layouts.
  • Added contact review and deletion after saving.
  • Replaced payment preferences with one shared contact-payment switch.
  • Migrated hidden Paykit methods to the simplified defaults.

Confidence Score: 4/5

The private payment enable path and post-save back-stack cleanup need fixes before merging.

  • Private publication can fail while the repository reports success and persists sharing as enabled.
  • A normalized saved key can miss the raw AddContact route, leaving the completed add flow on the back stack.
  • The remaining UI, deletion, scanner, and settings delegation changes are consistent with the updated flow.

ContactPaymentSettingsRepo.kt and ContentView.kt

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/repositories/ContactPaymentSettingsRepo.kt Adds shared contact-payment enable, disable, cleanup, and rollback behavior; the enable path ignores private publication failure.
app/src/main/java/to/bitkit/ui/ContentView.kt Updates contact and scanner navigation; post-save cleanup can miss an AddContact entry whose raw key differs from the normalized key.
app/src/main/java/to/bitkit/viewmodels/SettingsViewModel.kt Exposes the shared contact-payment state and delegates switch updates to the new repository.
app/src/main/java/to/bitkit/ui/screens/contacts/ContactDetailViewModel.kt Adds contact deletion state, error handling, and a successful-deletion effect.
app/src/main/java/to/bitkit/data/serializers/SettingsSerializer.kt Applies the simplified Paykit payment-method defaults while loading persisted settings.

Reviews (1): Last reviewed commit: "chore: rename changelog fragment" | Re-trigger Greptile

Comment thread app/src/main/java/to/bitkit/repositories/ContactPaymentSettingsRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/ContentView.kt
@ben-kaufman ben-kaufman mentioned this pull request Jul 20, 2026
28 tasks
@ben-kaufman
ben-kaufman changed the base branch from master to codex/paykit-watch-only-accounts July 20, 2026 15:42
@ben-kaufman
ben-kaufman force-pushed the codex/970-pubky-paykit-ui-parity branch from f65148d to 2b14ed7 Compare July 20, 2026 15:42
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-watch-only-accounts branch from 5050c1e to edb688f Compare July 22, 2026 10:15
@jvsena42 jvsena42 added this to the 2.5.0 milestone Jul 22, 2026
@ben-kaufman
ben-kaufman force-pushed the codex/970-pubky-paykit-ui-parity branch from 2b14ed7 to 0a3c85c Compare July 22, 2026 13:13
@ben-kaufman

Copy link
Copy Markdown
Contributor Author

@piotr-iohk I think e2e tests might need some changes due to the UI updates here

@piotr-iohk

Copy link
Copy Markdown
Collaborator

E2E / companions

E2E for this PR: bitkit-e2e-tests#200.

Matches this flow (and Figma): no discard CTA / save toast; save → Contact Detail; no dissmis on contact add screen.

iOS (bitkit-ios#636) still has e2e compatibility hooks (AddContactDiscard / ContactsAddButton aliases + ContactSavedToast). Those should be removed so iOS matches Android/Figma.

Pre-existing: profile delete can fail when contacts exist

Not introduced by this UI PR (cleanup gate is older Paykit work). Seen on iOS too. Surfaced by e2e @pubky_profile_4 (and same path as @pubky_profile_2 if a contact is still present at delete).

Steps to reproduce

  1. Fresh wallet → enable Paykit UI → create Pubky profile (Wallet B).
  2. Contacts → Add Contact → paste another wallet’s pubky → Save (lands on Contact Detail).
  3. Edit that contact (change name/notes) → Save.
  4. Profile → Edit Profile → Delete → confirm Yes, Delete.

Expected

  • Profile is deleted.
  • App lands on PubkyChoice (Create profile / Import with Pubky Ring).

Actual

  • Delete does not complete; failure / retry dialog (or stuck on Edit Profile).
  • Never reaches PubkyChoice.
Screenshot 2026-07-23 at 14 51 56

Logs

logs.zip

PrivatePaykitRepo: Failed to remove private Paykit endpoints during 'EditProfileViewModel'
[PrivateUnavailable='Private Paykit is not available']

attemptDeleteProfile() aborts on removePublishedEndpointsForCleanup() failure (showDeleteFailureDialog) before PubkyRepo.deleteProfile() / deleteAllContacts().

Worth fixing on the Paykit/delete path (can be a follow-up).

Copy link
Copy Markdown
Contributor Author

iOS has been updated in bitkit-ios#636, commit d769ad19. We removed the AddContactDiscard / ContactsAddButton compatibility aliases and the ContactSavedToast, aligning the flow with Android/Figma and bitkit-e2e-tests#200. The profile-delete issue is being handled separately.

@ben-kaufman

Copy link
Copy Markdown
Contributor Author

@piotr-iohk Thanks — confirmed this was a pre-existing cross-platform cleanup gate rather than part of the UI-parity changes.

Terminal profile deletion now attempts private Paykit endpoint cleanup but does not block when that cleanup cannot complete, for example when a contact is offline or a private link is still in LINKING. The actual Pubky profile deletion remains authoritative and still surfaces the existing retry/disconnect UI if the homeserver cannot be reached.

Follow-up PRs:

Both delete confirmations now explain that contacts may retain profile or payment information previously shared with them. #1097 remains focused on UI parity, and the E2E changes remain separate in bitkit-e2e-tests.

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

e2e tests updated not to fail on delete for now. will update again after fix.
I'd propose to merge base codex/paykit-watch-only-accounts first and then this one.

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.

Design Update v61

3 participants