- Notifications
You must be signed in to change notification settings - Fork397
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(example/pager): Preserve query params when usingPicker
#3760
Conversation
🛠 PR Checks SummaryAllAutomated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
The CI is failing in lint. Could you please resolve this? Thank you. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report?Let us know! |
Hi, several days ago, there was a problem with the CI, and I was told to leave it for the time being. It fixed itself when merged with master in this commit:458a825. |
Picker
It seems to me that there is something wrong with this PR, but I cannot put a finger on it without more digging. If you can try and actually use this in a realm, with specific render paths, or query params, it fails. I created a simple asc/desc query rendering for r/docs/minisocial and the picker didn't work properly. |
Please also look into the txtar tests and add the Picker argument to the source there (to fix the CI). |
Done in commit:42bad09 |
} | ||
}) | ||
t.Run("reversed ordering", func(t *testing.T) { |
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.
why removing this test?
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.
I was editing a lot of tests to call Picker properly, I probably accidentally deleted these. I apologize, I will return them very soon.
…ng#3760)# Query Parameter Preservation in AVL PagerThis PR is necessary for the [Hall of Fame ImprovementPR](gnolang#3674) which adds sortingfunctionality to realms. Currently, when users navigate through pages,the sort parameter is lost because the pager doesn't preserve queryparameters. This enhancement ensures that sorting preferences (and otherquery parameters) persist during pagination.## GoalEnhance the current Pager implementation to preserve URL queryparameters when navigating between pages. The Picker function shouldmaintain all existing query parameters while only updating the pagenumber.## Changes1. Modify the `Picker` function signature to accept the current path: ```go func (p *Page) Picker(path string) string ```2. Update the Picker implementation to: - Parse query parameters from the provided path - Generate pagination UI that preserves existing query parameters - Maintain consistent link format across all pagination buttons## Implementation Details- Parse URL query parameters using `url.Parse`- Preserve all existing query parameters except `page`- Generate pagination links that include all preserved parameters- Handle edge cases (invalid paths, empty queries)## Development Checklist- [x] Update Pager implementation - [x] Modify Picker function signature - [x] Add query parameter parsing - [x] Implement parameter preservation in link generation- [x] Update tests - [x] Add tests for query parameter preservation - [x] Test edge cases and invalid inputs- [x] Update dependent code - [x] Modify all Picker function calls---------Co-authored-by: Ivan Ursulovic <ivan@Ivans-MacBook-Air.local>Co-authored-by: Ivan Ursulovic <ivan@MacBookAir.localdomain>Co-authored-by: Ivan Ursulovic <ivan@pop-os.localdomain>
### Restoring Missing TestsThis PR restores tests that were unintentionally removed while workingon [thisPR](#3760 (comment)). Itdoes not introduce any new features; it simply reinstates the missingtests in `gno.land/p/demo/avl/pager/pager_test.gno`.---------Co-authored-by: Ivan Ursulovic <ivan@Ivans-MacBook-Air.local>Co-authored-by: Ivan Ursulovic <ivan@MacBookAir.localdomain>Co-authored-by: Ivan Ursulovic <ivan@pop-os.localdomain>
Query Parameter Preservation in AVL Pager
This PR is necessary for theHall of Fame Improvement PR which adds sorting functionality to realms. Currently, when users navigate through pages, the sort parameter is lost because the pager doesn't preserve query parameters. This enhancement ensures that sorting preferences (and other query parameters) persist during pagination.
Goal
Enhance the current Pager implementation to preserve URL query parameters when navigating between pages. The Picker function should maintain all existing query parameters while only updating the page number.
Changes
Modify the
Picker
function signature to accept the current path:Update the Picker implementation to:
Implementation Details
url.Parse
page
Development Checklist