Skip to content
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

Newswires UI: add pagination #108

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Newswires UI: add pagination #108

merged 2 commits into from
Jan 24, 2025

Conversation

sb-dev
Copy link
Contributor

@sb-dev sb-dev commented Jan 23, 2025

What does this change?

Add a load more button to view older stories.

How to test

How can we measure success?

Have we considered potential risks?

Images

Accessibility

@sb-dev sb-dev force-pushed the ui-add-pagination branch 4 times, most recently from 9f268bf to 3fad1a0 Compare January 23, 2025 15:04
@sb-dev sb-dev marked this pull request as ready for review January 23, 2025 15:04
@sb-dev sb-dev requested a review from a team as a code owner January 23, 2025 15:04
@sb-dev sb-dev force-pushed the ui-add-pagination branch from 3fad1a0 to 54a1357 Compare January 23, 2025 15:31
@sb-dev sb-dev force-pushed the ui-add-pagination branch from 54a1357 to 6b19f70 Compare January 23, 2025 15:37
@@ -167,15 +180,34 @@ export function SearchContextProvider({ children }: PropsWithChildren) {
});
}

if (state.status === 'success' || state.status === 'offline') {
if (state.status === 'loading-more') {
fetchResults(currentConfig.query, {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder whether it would be more straightforward to put the fetch().then().catch() into the body of the loadMoreResults function? It will hopefully keep the number of branches in the status state machine simpler, and as far as I can tell it's only the load more button itself that needs to know about whether the fetch is underway, so we could perhaps have 'loading-more' as a piece of more local state. What do you think?

@sb-dev sb-dev force-pushed the ui-add-pagination branch 2 times, most recently from b856e3d to 7f1c1e0 Compare January 24, 2025 15:31
@sb-dev sb-dev force-pushed the ui-add-pagination branch 3 times, most recently from 2aec945 to a5c5ad9 Compare January 24, 2025 16:10
Copy link
Contributor

@bryophyta bryophyta left a comment

Choose a reason for hiding this comment

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

this looks great to me! Added a couple of small suggestions but not blocking 👍

@sb-dev sb-dev force-pushed the ui-add-pagination branch from a5c5ad9 to 0fe356d Compare January 24, 2025 17:13
@sb-dev sb-dev merged commit a4f6a28 into main Jan 24, 2025
3 checks passed
@sb-dev sb-dev deleted the ui-add-pagination branch January 24, 2025 17:23
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