Skip to content

Fix post template max per page to stay within query limits#3

Merged
roborourke merged 4 commits intomainfrom
claude/fix-post-pagination-limits-012TsfPWTvCW9aRg2oABs38K
Jan 15, 2026
Merged

Fix post template max per page to stay within query limits#3
roborourke merged 4 commits intomainfrom
claude/fix-post-pagination-limits-012TsfPWTvCW9aRg2oABs38K

Conversation

@roborourke
Copy link
Collaborator

No description provided.

When multiple post templates exist within a query loop, each subsequent template now correctly limits its maximum posts per page based on remaining posts from the query loop total.

Editor changes:
- Calculate remaining posts available for each post template
- Set max value for per page input based on remaining posts
- Use UsedPostsContext to track preceding post templates

Server-side changes:
- Track post template per page settings per query loop
- Calculate remaining posts for templates without explicit per page setting
- Apply remaining post limit to prevent exceeding query loop total
@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Playwright test results

passed  8 passed

Details

stats  8 tests across 2 suites
duration  35.4 seconds
commit  800ebeb

This test verifies that when a query loop has a posts per page limit
and post templates don't have explicit per page settings, the server-side
calculation automatically limits them to the remaining posts.

Test scenario:
- Query loop with 6 posts per page
- First post template: 1 post (explicit)
- Second post template: 2 posts (explicit)
- Third post template: no setting (auto-calculates to 3 remaining)
- Result: exactly 6 unique posts displayed
Remove the query loop posts per page configuration step that was causing
timeouts and update assertions to expect 10 total posts using the default
posts_per_page setting. This still validates the automatic calculation:
- First template: 1 post (explicit)
- Second template: 2 posts (explicit)
- Third template: 7 posts (auto-calculated: 10 - 1 - 2)
- Total: 10 unique posts
@tomjn
Copy link
Contributor

tomjn commented Jan 15, 2026

LGTM 🚀

@roborourke roborourke merged commit e62af2d into main Jan 15, 2026
1 check 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.

3 participants