Skip to content

fix: align Pubky and Paykit flows#636

Open
ben-kaufman wants to merge 7 commits into
masterfrom
codex/pubky-paykit-figma-alignment
Open

fix: align Pubky and Paykit flows#636
ben-kaufman wants to merge 7 commits into
masterfrom
codex/pubky-paykit-figma-alignment

Conversation

@ben-kaufman

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

Copy link
Copy Markdown
Contributor

Part of #571

Description

This PR aligns the Pubky profile, contacts, and Paykit contact-payment flows with the v61 Figma designs while keeping the Ring flow unchanged.

  • Removes the onboarding payment toggle and enables contact payments by default.
  • Replaces the separate payment-preference screen with one General Settings toggle controlling both public and private contact payments.
  • Shows Pay and Save when a contact exposes a payment endpoint, and Save only when no payment endpoint is available.
  • Aligns profile creation/editing, contact import, contact detail, contacts list, and saved-contact navigation with the current designs.
  • Uses raw truncated Pubky keys and updates the overlapping contact-avatar stack to the Figma sizing, overlap, border, and overflow treatment.
  • Adds direct profile-tag management and prevents overlapping tag saves.
  • Consolidates contact-payment publication and cleanup behavior into one service while preserving rollback state.

This PR is based directly on master. Incoming Paykit payment-request work remains outside this branch.

Linked Issues/Tasks

Screenshot / Video

Comparison screenshots were captured and reviewed locally for the changed onboarding, profile, contacts, import, settings, and avatar-stack states. Ring remains out of scope because that flow is being updated separately.

QA Notes

Manual Tests

  • 1. Profile onboarding → Pay with Contacts: no toggle is shown; Continue enables contact payments and opens Profile.
  • 2. Settings → General → Enable payments with contacts: one toggle controls both public and private contact-payment publication.
  • 3a. Contacts → Add Contact → enter a contact with a payment endpoint: Pay and Save actions are shown.
    • 3b. Enter a contact without a payment endpoint: only Save is shown.
  • 4. Contacts → import profile contacts → select/import: selection, overview, and completion screens match the v61 flow.
  • 5. Profile → add and remove tags: changes persist and controls remain disabled while a save is running.
  • 6. Contacts list with more than five contacts: avatar stack uses 32 pt circles, 8 pt overlap, five visible avatars, and the bordered overflow count.
  • 7. regression: Pubky Ring authorization and watch-only account flows remain unchanged.

Automated Checks

  • Unit tests added: ContactPaymentsServiceTests.swift covers default enablement, unified public/private publication, cleanup, partial failures, and rollback to both enabled and disabled states.
  • Unit tests modified: ContactsManagerTests.swift verifies raw truncated Pubky key display; PublicPaykitServiceTests.swift verifies the unified preference key cleanup.
  • Local: SwiftFormat lint passes for all changed Swift files, translation validation passes with 0 errors, and git diff --check passes.
  • Local simulator: the app and test targets compile and all 8 focused contact-payment tests pass in a disposable compatibility build using the locally available newer Paykit/LDK artifacts. The exact master artifact graph could not be re-fetched locally, so CI remains the authoritative locked-dependency build.
  • CI: standard build and test checks run by the PR bot.

@ben-kaufman
ben-kaufman force-pushed the codex/pubky-paykit-figma-alignment branch from fb7d862 to 12ab412 Compare July 20, 2026 09:09
@ben-kaufman
ben-kaufman changed the base branch from codex/paykit-watch-only-accounts to master July 20, 2026 09:09
@ben-kaufman
ben-kaufman marked this pull request as ready for review July 20, 2026 11:11
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Greptile Summary

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

  • Consolidated public and private contact-payment settings and rollback handling.
  • Updated profile, contact, import, and saved-contact screens.
  • Added direct profile-tag management and overlapping-save protection.
  • Changed Pubky-key formatting and contact-avatar layouts.
  • Added focused tests for contact-payment state transitions.

Confidence Score: 4/5

The unified payment flow needs fixes for displayed state, unloaded contacts, and failed endpoint rollback.

  • An unconfirmed preference can appear enabled without publishing endpoints.
  • Enabling before contacts load can omit private endpoint publication.
  • A failed compensating cleanup can leave a public endpoint published after state is restored to disabled.
  • The remaining profile and contact UI changes are contained.

Bitkit/Views/Settings/GeneralSettingsView.swift; Bitkit/Services/ContactPaymentsService.swift

Important Files Changed

Filename Overview
Bitkit/Services/ContactPaymentsService.swift Adds unified endpoint publication, cleanup, and rollback, but a failed compensating cleanup can leave published state inconsistent with the restored preference.
Bitkit/Views/Settings/GeneralSettingsView.swift Adds the unified toggle, but its default display and contact-list snapshot can diverge from actual endpoint publication.
Bitkit/Views/Profile/PayContactsView.swift Removes the onboarding toggle and enables contact payments through the consolidated service.
Bitkit/Views/Profile/ProfileView.swift Adds direct tag creation and deletion with a synchronous overlapping-save guard.
Bitkit/Views/Contacts/AddContactView.swift Adds conditional Pay and Save actions plus saved-contact navigation.
Bitkit/Views/Contacts/ContactDetailView.swift Adds the saved-contact title and delete mode.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[General Settings toggle] --> B[ContactPaymentsService.setEnabled]
    B --> C[Sync public endpoints]
    B --> D[Prepare or remove private endpoints]
    C --> E[Persist publication state]
    D --> E
    B -->|failure| F[Restore previous state]
    G[Unconfirmed preference] --> H[Toggle displays enabled]
    H -. no publication call .-> I[Endpoints remain unpublished]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[General Settings toggle] --> B[ContactPaymentsService.setEnabled]
    B --> C[Sync public endpoints]
    B --> D[Prepare or remove private endpoints]
    C --> E[Persist publication state]
    D --> E
    B -->|failure| F[Restore previous state]
    G[Unconfirmed preference] --> H[Toggle displays enabled]
    H -. no publication call .-> I[Endpoints remain unpublished]
Loading

Comments Outside Diff (1)

  1. Bitkit/Views/Settings/GeneralSettingsView.swift, line 47-48 (link)

    P1 Enabled State Is Not Published

    For an authenticated user with no confirmed preference and both publication flags false, this fallback displays the toggle as enabled without calling setEnabled(true). If the user leaves it untouched, no endpoints are published and contacts still cannot pay them despite General Settings showing the feature as on.

Reviews (1): Last reviewed commit: "fix: harden contact payment settings" | Re-trigger Greptile

Comment thread Bitkit/Services/ContactPaymentsService.swift
Comment thread Bitkit/Views/Settings/GeneralSettingsView.swift

Copy link
Copy Markdown
Contributor Author

Addressed the remaining Greptile review observations in 1006451:

  • An unconfirmed contact-payment preference is no longer rendered as already active. General Settings actively provisions the default-on state, shows the pending value while it runs, and only reports enabled after publication succeeds.
  • Contact publication now waits for the authenticated contact list to finish loading.
  • Public endpoint publication/removal is the final fallible transition, and local state is committed only after the complete operation succeeds.

Verification: SwiftFormat/diff checks pass, and all 8 focused ContactPaymentsServiceTests pass on the iOS simulator.

@ben-kaufman
ben-kaufman force-pushed the codex/pubky-paykit-figma-alignment branch from 1006451 to 03acbcd Compare July 22, 2026 13:01
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.

1 participant