Skip to content

(ios) Contacts v1.0#600

Merged
robbiehanson merged 13 commits intomasterfrom
ios-contacts-rebase
Jul 31, 2024
Merged

(ios) Contacts v1.0#600
robbiehanson merged 13 commits intomasterfrom
ios-contacts-rebase

Conversation

@robbiehanson
Copy link
Copy Markdown
Contributor

The first version of contacts for iOS:

Notes:

Lots of work was done optimizing for photos. For example, on an iPhone 12 Mini, if a user selects a photo they took, that will be a 12 megapixel (MP) photo (≈ 4,000 * 3,000 = 12,000,000). In terms of file size, it's somewhere around 1.5-3Mb (assuming HEIC format).

But we don't need full size photos for our use case. And we probably want to backup the contacts list to the cloud (encrypted) in the future. So we resize these down to 1MP, which results in a file size of around 100K.

Plus there's a caching mechanism that will resize the photo to the desired size (e.g. 32*32), and store that in a temp cache for the UI.

@robbiehanson robbiehanson requested a review from dpad85 July 24, 2024 17:40
Copy link
Copy Markdown
Member

@dpad85 dpad85 left a comment

Choose a reason for hiding this comment

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

A few issues on my iPhoneX device with iOS 16.7.8 :

  • there is some flickering when opening the Address Book screen (it seems it's caused by the Search bar disappearing for a few dozen millisecs when the screen opens).
  • In all contacts screen: the placeholder user image has too much contrast with the background, which makes it very visible and does not look good. This image should be more muted.
  • In the New Contact screen, "Trusted contact" should be "Pay with your offer key" and the subtitle: enabled: If they know your own Bolt12 payment code, they will be able to tell when payments are from you + disabled: Use a throwaway id when you pay this contact
  • In the Edit contact screen (from the Address Book), the discard icon is hard to understand (especially since it does not do anything if you have not done any changes). Why not have the back button behave like this "discard" button, and have a "Save changes" button at the bottom of the screen? It would feel more natural to me, and also consistent with the other "Edit contact" screen that you get when editing a contact from a payment screen.
  • When opening the Send screen, only the Paste... button is displayed and the user has to tap the chevron-up icon to access the other buttons. The Contacts button should be displayed by default. Note that this is a temporary workaround since this whole screen will need to be completely reworked (see #590)
  • In the Confirm payment screen, the "Send to" and "Message" labels are in full caps which is not consistent with the other screens (visible in the screenshot in the PR description). Also the Contact details is not aligned with the "Send to" label.

On my device, I also noticed some UI freezes (there's a badge displayed at the top of the screen with the freeze duration -- badge which I suppose comes from iOS). The freeze can last from 500ms up to 4500ms in one case (I used the Take Photo button in the Edit contact screen). This issue actually started to happen a while ago, I think when we merged #577 and added the SKIE stuff back again, though I'm not 100% sure. Unfortunately these freezes happen randomly and cannot be reproduced easily.

Small issue that can be fixed in a later PR:

  • a button to scan an offer when creating a new contact

Comment thread phoenix-ios/phoenix-ios/views/transactions/TransactionsView.swift
Comment thread phoenix-ios/phoenix-ios/officers/PhotosManager.swift
@robbiehanson
Copy link
Copy Markdown
Contributor Author

there is some flickering when opening the Address Book screen (it seems it's caused by the Search bar disappearing for a few dozen millisecs when the screen opens).

I think this is fixed in 5c39416. Please confirm

@robbiehanson
Copy link
Copy Markdown
Contributor Author

In all contacts screen: the placeholder user image has too much contrast with the background, which makes it very visible and does not look good. This image should be more muted.

Done in 5c6f43b

@robbiehanson
Copy link
Copy Markdown
Contributor Author

robbiehanson commented Jul 25, 2024

In the Edit contact screen (from the Address Book), the discard icon is hard to understand (especially since it does not do anything if you have not done any changes). Why not have the back button behave like this "discard" button, and have a "Save changes" button at the bottom of the screen? It would feel more natural to me, and also consistent with the other "Edit contact" screen that you get when editing a contact from a payment screen.

In 127bdca I changed the design to match Apple's own Contacts app:

They do the following:

  • the "< Back" button is replaced with a "Cancel" button. If you tap it without making any changes, the view is immediately dismissed. If there are changes, you're prompted to confirm that you want to discard those changes.
  • the "Done" button works as a save button. It's disabled when there aren't any changes to save.
  • the "Delete contact" button is at the bottom. If you tap it, you get the usual confirmation sheet.

@robbiehanson
Copy link
Copy Markdown
Contributor Author

When opening the Send screen, only the Paste... button is displayed and the user has to tap the chevron-up icon to access the other buttons. The Contacts button should be displayed by default.

Done in 3a900b3

@robbiehanson
Copy link
Copy Markdown
Contributor Author

robbiehanson commented Jul 25, 2024

In the Confirm payment screen, the "Send to" and "Message" labels are in full caps which is not consistent with the other screens (visible in the screenshot in the PR description). Also the Contact details is not aligned with the "Send to" label.

Done in 523da71

@robbiehanson
Copy link
Copy Markdown
Contributor Author

On my device, I also noticed some UI freezes (there's a badge displayed at the top of the screen with the freeze duration -- badge which I suppose comes from iOS). The freeze can last from 500ms up to 4500ms in one case

I haven't been able to reproduce this yet. It may only be occurring on iOS 16 (and not 17). I'll keep testing on my older devices (with iOS 15 & 16).

@robbiehanson robbiehanson requested a review from dpad85 July 25, 2024 21:36
@dpad85
Copy link
Copy Markdown
Member

dpad85 commented Jul 29, 2024

On my device, I also noticed some UI freezes (there's a badge displayed at the top of the screen with the freeze duration -- badge which I suppose comes from iOS). The freeze can last from 500ms up to 4500ms in one case

I haven't been able to reproduce this yet. It may only be occurring on iOS 16 (and not 17). I'll keep testing on my older devices (with iOS 15 & 16).

Alright, I'll let you know if it happens again, for now things are ok. It could be related to the Debug mode (I don't think I got freezes in Release mode).

@dpad85
Copy link
Copy Markdown
Member

dpad85 commented Jul 29, 2024

I changed the design to match Apple's own Contacts app:

It looks much better that way. Is it possible to apply this design to the Edit Screen as well ?

Also, it would be useful to be able to pay an offer from the Contacts details/menu. On Android, I did two things:

  1. Tapping on an offer in the offer list starts the payment flow.
  2. in Settings > Contacts, tapping on a contact starts the payment flow (not the Edit flow). To edit the contact, there's a "Edit button" to the right.

But i'm not very happy with this. I think tapping on a contact should open the details screen, and there should be a prominent "Pay" button. I just could not a find a good place for this button.

@robbiehanson
Copy link
Copy Markdown
Contributor Author

Is it possible to apply this design to the Edit Screen as well ?

Done in 0721576

@robbiehanson
Copy link
Copy Markdown
Contributor Author

I think tapping on a contact should open the details screen, and there should be a prominent "Pay" button.

Here's what I came up with:

Note that this is less than ideal because we need to remove animated navigation on iOS (#552), but will require dropping support for iOS 15...

@dpad85
Copy link
Copy Markdown
Member

dpad85 commented Jul 30, 2024

Note that this is less than ideal because we need to remove animated navigation on iOS (#552), but will require dropping support for iOS 15...

Do you mean that adding this new contact -> send payment navigation path means we need to upgrade the min iOS version? That sounds like a big change, so if that's the case, we can skip this new navigation path and not have the "Send payment" button in this PR, and add it later with other fixes (like #552).

Last small issue:

  • open a payment's details
  • edit the contact (change the name)
  • the name is not updated in the payment's details
  • go to the home (or edit again)
  • the name is now up-to-date

…tsList, which lead to out-of-sync issues in the UI in certain contexts
@robbiehanson
Copy link
Copy Markdown
Contributor Author

Do you mean that adding this new contact -> send payment navigation path means we need to upgrade the min iOS version?

No. I didn't explain that well. I mean that it works now, and is compatible with iOS 15. But it will be improved in the future when we fix #552 (and that future work will require dropping support for 15)

@robbiehanson
Copy link
Copy Markdown
Contributor Author

Last small issue:

Fixed in bffc585

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.

2 participants