Skip to content

Keep URL params when fetching posts, fix incorrect page parameters and improve infinite scroll#57

Merged
nate-allen merged 3 commits into
a8cteam51:trunkfrom
robrobsn:fix/keep-existing-url-parameters
Jan 28, 2026
Merged

Keep URL params when fetching posts, fix incorrect page parameters and improve infinite scroll#57
nate-allen merged 3 commits into
a8cteam51:trunkfrom
robrobsn:fix/keep-existing-url-parameters

Conversation

@robrobsn
Copy link
Copy Markdown
Contributor

@robrobsn robrobsn commented Jan 20, 2026

Thank you for for creating issues and offering solutions:
@agarciar
@TCCJackson
@jbouganim

Summary by CodeRabbit

  • New Features

    • Clarified/expanded "Update URL" option to update the browser URL when loading more posts.
  • Bug Fixes

    • Corrected page parameter handling for inherited queries.
    • Preserve existing URL parameters when fetching/updating loaded posts.
    • Improved infinite-scroll/load-more reliability and history updates.
  • Chores

    • Version bumped to 1.0.17; updated WordPress compatibility (tested up to 6.9).

✏️ Tip: You can customize this high-level summary in your review settings.

…t the bottom of the viewport;

- Fix - Page parameter for inherited queries;
- Fix - Page parameter for custom query page when not set;
- Fix - Keep current URL parameters when fetching new posts and updating the location URL.
- Updated version to 1.0.17
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 20, 2026

Walkthrough

This pull request updates package and metadata to version 1.0.17, updates documentation/changelog, adds a PHP_CodeSniffer exclude-pattern to skip /tests/, introduces a top-level JS helper getUrlWithParam() and refactors frontend pagination to use dataset attributes and a document-level click handler, changes IntersectionObserver rootMargin from 100px to 0px, updates build asset hashes, and modifies Plugin.php to resolve current page from the global $wp_query for inherited queries and from $_GET for non-inherited queries.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: preserving URL parameters, fixing page parameter issues, and improving infinite scroll behavior.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/Plugin.php`:
- Around line 252-266: The expression setting $query_id can trigger an
undefined-index notice because the (int) cast has higher precedence than the ??
operator; change the assignment to cast the result of the null-coalescing
expression (e.g. (int) ($block->context['queryId'] ?? 0)) so the array access is
protected by ?? before casting, and verify related uses ($page_key, $inherit,
and the $page calculation) still use $query_id / isset checks consistently.
🧹 Nitpick comments (1)
assets/js/src/index.js (1)

243-246: LGTM - improved help text with practical example.

The updated help text provides clearer context for users about what the "Update URL" option does.

Minor style nit: Consider removing the extra spaces inside parentheses ( e.g.: ... )(e.g., ...) for consistency with typical English punctuation conventions.

Comment thread src/Plugin.php Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@README.md`:
- Line 42: The changelog sentence is missing a connector; update the entry "*
Fix - potential issue infinite scroll not triggering if button is at the bottom
of the viewport" to read clearly, e.g. "* Fix - potential issue where infinite
scroll was not triggering if the button is at the bottom of the viewport" (or
insert "where" after "issue" and adjust tense to "was not triggering") so the
sentence is grammatical and clear.
🧹 Nitpick comments (1)
README.md (1)

45-45: Consider using past tense for consistency.

The changelog entry uses "Keep" while other entries use past tense verbs like "Fixed", "Changed", or "Kept" for consistency.

📝 Proposed fix
-* Fix - Keep current URL parameters when fetching new posts and updating the location URL
+* Fix - Kept current URL parameters when fetching new posts and updating the location URL

Comment thread README.md
Copy link
Copy Markdown
Contributor

@nate-allen nate-allen left a comment

Choose a reason for hiding this comment

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

Looks good! No changes needed. Thank you 😄

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