Skip to content

Conversation

@kean
Copy link
Contributor

@kean kean commented Jan 21, 2026

Reader will now collapse long comments. You can tap "Show More" to expand.

Screenshot 2026-01-22 at 1 43 22 PM

@kean kean added this to the 26.6 milestone Jan 21, 2026
@kean kean added the Reader label Jan 21, 2026
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 21, 2026

1 Warning
⚠️ This PR is assigned to the milestone 26.6. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 21, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30546
VersionPR #25156
Bundle IDorg.wordpress.alpha
Commit2ea2c53
Installation URL64cs06gkdkve8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 21, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30546
VersionPR #25156
Bundle IDcom.jetpack.alpha
Commit2ea2c53
Installation URL63j7272pon03o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

contentView.addSubview(overlay)
overlay.pinEdges([.horizontal, .bottom], to: contentContainerView)
NSLayoutConstraint.activate([
overlay.heightAnchor.constraint(equalToConstant: 70)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this constraint may cause conflicts if the font is super large? Instead of hard-code a height here, would setting the button.contentInsets or the margins between the button and its parent view work?

@IBOutlet private weak var contentContainerView: UIView!
@IBOutlet private weak var contentContainerHeightConstraint: NSLayoutConstraint!

private var showMoreOverlay: ShowMoreOverlay!
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: use a lazy var to avoid optional


override func layoutSubviews() {
super.layoutSubviews()
gradientLayer.frame = bounds
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick:

Suggested change
gradientLayer.frame = bounds
gradientLayer.frame = layer.bounds

@kean
Copy link
Contributor Author

kean commented Jan 21, 2026

Oh, sorry I didn't mean to send it for a review yet. Let me fix a couple of things, and re-send it.

@kean kean requested review from crazytonyli and removed request for crazytonyli January 21, 2026 23:18
@kean kean marked this pull request as draft January 21, 2026 23:23
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 21, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@kean kean modified the milestones: 26.6, 26.7 Jan 22, 2026
@kean kean force-pushed the task/reader-comments-collapsed branch 2 times, most recently from 6fd7d19 to 99e73ca Compare January 22, 2026 18:24
@kean kean modified the milestones: 26.7, 26.6 Jan 22, 2026
@kean kean force-pushed the task/reader-comments-collapsed branch from 99e73ca to 216532a Compare January 22, 2026 18:26
@kean
Copy link
Contributor Author

kean commented Jan 22, 2026

I reworked and retested the implementation.

I think this constraint may cause conflicts if the font is super large? Instead of hard-code a height here, would setting the button.contentInsets or the margins between the button and its parent view work?

I set maximum supported category size for the button, so it looks acceptable under all conditions.

Nitpick: use a lazy var to avoid optional

Made overlay optional.

Additional changes:

  • Fix race condition in WebCommentContentRenderer where it would sometimes call delegate with a old height for the previous comment
  • Tweak the "collapse" behavior so if it only collapses comments if there is enough stuff to put under the fold (120 pt+)

@kean kean marked this pull request as ready for review January 22, 2026 18:28
@kean kean requested a review from crazytonyli January 22, 2026 18:28
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants