fix: align Pubky and Paykit flows#636
Conversation
fb7d862 to
12ab412
Compare
Greptile SummaryThis PR aligns the Pubky and Paykit contact flows with the v61 designs. The main changes are:
Confidence Score: 4/5The unified payment flow needs fixes for displayed state, unloaded contacts, and failed endpoint rollback.
Bitkit/Views/Settings/GeneralSettingsView.swift; Bitkit/Services/ContactPaymentsService.swift
|
| 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]
%%{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]
Comments Outside Diff (1)
-
Bitkit/Views/Settings/GeneralSettingsView.swift, line 47-48 (link)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
|
Addressed the remaining Greptile review observations in 1006451:
Verification: SwiftFormat/diff checks pass, and all 8 focused |
1006451 to
03acbcd
Compare
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.
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
regression:Pubky Ring authorization and watch-only account flows remain unchanged.Automated Checks
ContactPaymentsServiceTests.swiftcovers default enablement, unified public/private publication, cleanup, partial failures, and rollback to both enabled and disabled states.ContactsManagerTests.swiftverifies raw truncated Pubky key display;PublicPaykitServiceTests.swiftverifies the unified preference key cleanup.git diff --checkpasses.masterartifact graph could not be re-fetched locally, so CI remains the authoritative locked-dependency build.