-
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
Reader: Add announcement card #23197
Conversation
I've noticed that `configureStreamHeader()` had too many layout constraints juggling, so this simplifies it a bit. * `ReaderSiteHeaderView` now inherits from `UITableViewHeaderFooterView`, so that it has the same readableContentGuide of table views. This removes the need to put the SwiftUI view in a container view and align the horizontal anchors manually to the table view. * Moved the border-adding logic to each own views.
This is a workaround that avoids unsatisfiable constraint warnings in the console. By reducing the constraint priority to 999, this allows the the layout engine to prioritize the constraints from `UIView-Encapsulated-Layout-Width` (or height).
The `configureStreamHeader()` method is currently only called when the `readerTopic` is not nil. This needs to be modified because there are streams without a topic (Saved, Tags).
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23197-be6ec3d | |
Version | 24.8 | |
Bundle ID | com.jetpack.alpha | |
Commit | be6ec3d | |
App Center Build | jetpack-installable-builds #8941 |
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.
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.
Looks like this file needs to be added to the WordPress target.
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.
Good catch. I've added it in e2a312a.
Good catch! I've manually excluded the image views in be6ec3d. Thanks for the review! 👍 |
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23197-be6ec3d | |
Version | 24.8 | |
Bundle ID | org.wordpress.alpha | |
Commit | be6ec3d | |
App Center Build | WPiOS - One-Offs #9892 |
Part of #23069
Adds the announcement card to the Reader stream. The card is only shown when:
reader_announcement_card
needs to be enabled.Preview:
To test
Tip
To avoid dismissing the card and never seeing it again, you could temporarily disable the dismiss logic by commenting out the line in
ReaderStreamViewController+Helper.swift:L179
:This way, the announcement card will reappear on the next stream after you dismiss it.
readerAnnouncementCard
flag is enabled.Subscriptions
orYour Tags
and filter the stream.Offline case
Spam test
Context
During development, I stumbled on some crashes while switching to
Discover
, and it crashed with this message:WordPress-iOS/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift
Line 93 in c055c21
However, after a while, it seems like the crash stopped happening... I'm guessing it may be related to this commit: 45d58e4 since the refresh method calls
layoutIfNeeded
on the table view, and perhaps there might be a retain cycle somewhere.Regression Notes
Potential unintended areas of impact
Should be none. The card is hidden behind a flag.
What I did to test those areas of impact (or what existing automated tests I relied on)
Manually tested the changes.
What automated tests I added (or what prevented me from doing so)
N/A.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: