Skip to content

Fix paginated comments button not showing on comment injection/creation #2426

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

Merged
merged 3 commits into from
Aug 17, 2025

Conversation

Soxasora
Copy link
Member

@Soxasora Soxasora commented Aug 17, 2025

Description

Pagination is determined by item.comments.comments.length < item.nDirectComments, as comments get injected, the comments array can get bigger than nDirectComments causing the view all n replies button to disappear.
This PR fixes this by also updating nDirectComments on injection.

also your own replies

This bug is present also when creating replies because the ancestors cache update lacked nDirectComments. This PR also fixes this.

Screenshots

pagination.mp4
  • video shows an already fixed nDirectComments update for own replies (right side)

Additional Context

n/a

Checklist

Are your changes backward compatible? Please answer below:
Yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
7, multiple levels of pagination, own replies, live replies.

For frontend changes: Tested on mobile, light and dark mode? Please answer below:
n/a

Did you introduce any new environment variables? If so, call them out explicitly here:
n/a

@Soxasora Soxasora changed the title Fix paginated comments button not showing on comment injection Fix paginated comments button not showing on comment injection/creation Aug 17, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@huumn huumn merged commit a3c5a33 into stackernews:master Aug 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants