-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend App: Add presenter to encapsulate display logic #17006
Conversation
You can trigger an installable build for these changes by visiting CircleCI here. |
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
…re-app-content-presenter
…re-app-content-presenter
WordPress/Classes/ViewRelated/Sharing/ShareAppTextActivityItemSource.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Howdy @dvdchr 👋
I tested on my iPhone X and everything worked great. Thanks for showing all the examples in the PR description. It was nice to have something to compare my results to. :)
Code looks good to me. I had just one suggestion about the subject text.
Otherwise :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spotted an issue so I've added another note and marked this request changes since we need to address an exception. Sorry I missed it in the first round!
…app-content-presenter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya @dvdchr 👋
The exception is resolved. Thanks for the changes! Marking approved so as to not block the rest of the work.
However, I think we might want to see if we can improve the popover presentation on iPad. The solution I suggested was something I hadn't tested, and now that I see it in action I think we might need to make an adjustment.
Depending on which way I orient the iPad, the popover appears away from where I tapped. The size also varies depending on orientation so sometimes there are more visible options than others. I'm wondering if sharing the frame of the cell (or maybe just the cell as the view) that was tapped rather than the controller view would help improve the experience. We'd also need to make the change before the code freeze. What do you think?
Hey @aerych. I wasn't very aware of the design guidelines for iPad before, so thank you for the help and tips on this. Really appreciate it! 🙂
Noted. I just realized that since the popover is anchored to the view controller's view, there's not enough space on the side and the system puts the popover on the top side, which makes the content a bit cramped. Addressed in 6a07b6d, I've confirmed that passing the cell as the
Since the code review for #17007 and #17020 is blocked by this one, I'll apply the changes on this PR. Then, I'll merge up the changes to both #17007 and #17020, so you can proceed with reviewing both of them. I'll aim to merge everything to P.S.: I've updated the code sample in the description to fill the |
Generated by 🚫 dangerJS |
Tested with the changes and they look great! Thanks @dvdchr! again! |
Thanks @aerych ! |
Refs #16995
Closes #17003
Based on #17005
Summary
This change introduces a presenter object that encapsulates content fetching and presentation logic for the share app flow, along with a subclass of
UIActivityItemSource
to help format the text contents depending on the activity type. As described in #17003, I think it's worth it to encapsulate this since it's possible to have multiple entry points in the future.Some notes for this change:
UIActivityItemSource
subclass is necessary to provide additional information – specifically a subject string provided throughactivityViewController:subjectForActivityType
. This information is used when sharing to mail. I'll share some screenshots below on how it looks when it's shared in various apps.Screenshots
To Test
Manually editing the source + compiling to device
Since there are no visual components hooked up to this component, we'll have to wire this up manually in Xcode AND compile it to a device 😅 .
Here's how I modified the code to test the share functionality:
MeViewController
, add a private instance variable like so:pushHelp()
method, comment out the code in the return block, and change it to this:Unit tests
Make sure that the tests are 🟢 !
Regression Notes
Potential unintended areas of impact
None.
What I did to test those areas of impact (or what existing automated tests I relied on)
This component is not used yet.
What automated tests I added (or what prevented me from doing so)
Added some unit tests for the presenter.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.