Skip to content

Conversation

@crazytonyli
Copy link
Contributor

@crazytonyli crazytonyli commented Nov 6, 2024

Note

This PR is built on top of #23768.

Before After
Simulator Screenshot - iPhone 16 Pro - 2024-11-06 at 20 36 14 Simulator Screenshot - iPhone 16 Pro - 2024-11-06 at 20 38 46

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.6 milestone Nov 6, 2024
@crazytonyli crazytonyli requested review from jkmassel and kean November 6, 2024 07:40
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 6, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23777-c8778ba
Version25.4.2
Bundle IDorg.wordpress.alpha
Commitc8778ba
App Center BuildWPiOS - One-Offs #11009
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 6, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23777-c8778ba
Version25.4.2
Bundle IDcom.jetpack.alpha
Commitc8778ba
App Center Buildjetpack-installable-builds #10049
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@dangermattic
Copy link
Collaborator

dangermattic commented Nov 6, 2024

2 Warnings
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 25.6. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@crazytonyli crazytonyli mentioned this pull request Nov 6, 2024
14 tasks
@crazytonyli crazytonyli force-pushed the fix/self-hosted-site-users branch from d876f7d to 5fbfd0c Compare November 7, 2024 08:47
@kean
Copy link
Contributor

kean commented Nov 7, 2024

The web-based login crashes on iPad when I invoke it from the "Application Passwords" screen:

Screenshot 2024-11-07 at 10 14 48 AM

}
)
if let url {
AsyncImage(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace this with AvatarView. AsyncImage should basically never be used.

AvatarView or AsyncImageView are currently unavailable in WordPressUI as they are part of the app target. But UserProfile* don't belong to WordPressUI as it's designed for reusable components. It should be small and should compile fast as, in the long term, more modules will depend on it.

I suggest the following changes:

  • Create a WordPressMedia framework (or similar name) with ImageDownloader – other media-related stuff could go there later too.
  • Move AvatarView and AsyncImageView to either WordPressUI or WordPressMedia
  • (If you want to keep the previews) Create a separate module for user management.

If we keep adding everything to WordPressUI, it will eventually stop working well for Xcode Previews as these tend to become unusable with 10K+ lines in a module. The only long-term option if we want to facilitate Xcode Previews is to create feature-based modules (aka app micro modules). Since we are now fully in the SPM world, it should be feasible, so it might be a good time to start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I forgot to reply to your original comment about AsyncImage.

Shall I just move the new user management code to the app target for now? So that the AvatarView and ImageDownloader stuff (I don't think we need it for this particular feature) will be available. /cc @jkmassel

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's address it separately. I'm going to add the approval as is.


let dummyDataUrl = URL(string: "https://my.api.mockaroo.com/users.json?key=067c9730")!
enum Scenario {
case inifitLoading
Copy link
Contributor

Choose a reason for hiding this comment

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

typo – "infinite"


if viewModel.currentUserCanModifyUsers {
Section(Strings.accountManagementSectionTitle) {
NavigationLink {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's show these as modal screens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In follow-up PRs, I'll use an alert for the "set new password" feature and a modal/sheet for deleting users.

Base automatically changed from add/self-hosted-site-users-list-view to trunk November 7, 2024 20:53
@crazytonyli
Copy link
Contributor Author

crazytonyli commented Nov 7, 2024

@kean I couldn't reproduce that crash, neither on an iPad nor on an iPad simulator. Can you produce it consistently?

I wonder if that has something to do with the new window (instead of an existing window from a view controller) used here:

let success = try await authenticator.authentication(site: url, from: nil)

Note: when passing nil, a UIWindow instance will be created internally to present the authentication web view.

@crazytonyli crazytonyli force-pushed the fix/self-hosted-site-users branch from 5fbfd0c to 2caa0ae Compare November 7, 2024 21:12
@crazytonyli
Copy link
Contributor Author

⬆️ Rebased without any code changes.

}
)
if let url {
AsyncImage(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's address it separately. I'm going to add the approval as is.

@crazytonyli crazytonyli added this pull request to the merge queue Nov 13, 2024
Merged via the queue into trunk with commit 6d67d85 Nov 13, 2024
24 checks passed
@crazytonyli crazytonyli deleted the fix/self-hosted-site-users branch November 13, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants