-
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
[Notifications P1] Replace Notifications Cell Content #22593
[Notifications P1] Replace Notifications Cell Content #22593
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
func host(_ view: Content, parent: UIViewController) { | ||
if let controller = controller { | ||
controller.rootView = view | ||
controller.view.layoutIfNeeded() |
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.
[Discussion] I'm not sure if you ran into an issue where the cell doesn't resize to fit its content. From experience, the only method that worked for me is controller.view.invalidateIntrinsicContentSize
.
There is another approach, but I haven't tried it yet:
tableView.selfSizingInvalidation = .enabledIncludingConstraints
Source https://appcircle.io/blog/using-swiftui-inside-uicollectionview-and-uitableview
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.
I didn't notice any problems about the cell sizing. Did you?
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.
Resolved ee81dd7
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.
[Nit] layoutIfNeeded()
is no longer needed when calling invalidateIntrinsicContentSize
controller.view.layoutIfNeeded() |
) | ||
), | ||
parent: self | ||
) |
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.
[Question] I guess we don't handle the "Altered" state yet? Are you planning to work on that in this PR or a separate PR?
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.
No I actually should've done it. I'll look into the old code now to see the conditions it is displayed.
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.
Resolved: 2b1626e
title: note.renderSubject()?.string ?? "", | ||
description: note.renderSnippet()?.string, | ||
shouldShowIndicator: !note.read, | ||
avatarStyle: .init(urls: note.allAvatarURLs) ?? .single(note.iconURL!), |
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.
.single(note.iconURL!)
[Suggestion] Honestly I wouldn't be confident force unwrapping a value that comes from the Backend. In my opinion, the avatarStyle
can be nil
, and in that case, we should display some placeholder.
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.
Yeah we shouldn't force unwrap for sure. I'll fix it
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.
Resolved 9abb1cc
I've shared feedback with Alp internally because it included screenshots and recordings of the app showing information about the company. |
return UITableViewCell() | ||
} | ||
cell.selectionStyle = .none | ||
if let deletionRequest = notificationDeletionRequests[note.objectID] { |
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.
[Nit] This if-else is a little bit hard to read, also, the cell.host
method call is redundant. Why not do this if-else logic only for the style
computation, because it is the only dynamic part in this logic?
let style = {
if let deletionRequest {
// return altered style
}
// return regular style
}()
cell.host(...)
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.
Resolved 9abb1cc
WordPress/Classes/ViewRelated/Views/List/NotificationsList/HostingTableViewCell.swift
Outdated
Show resolved
Hide resolved
WordPress/Classes/ViewRelated/Views/List/NotificationsList/HostingTableViewCell.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.
All good 🚀
37a3215
into
feature/notifications_refresh_p1
Fixes #22465 | #22472
Description
Utilises the newly added
NotificationsTableViewCellContent
to replace the old cells used in NotificationsViewController.Also contains improvements to
AvatarsView
like placeholder image and parsing multiple image urls from theNotification
response.Testing Steps
Notifications
tab.Regression Notes
Potential unintended areas of impact
N/A
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: