WS-2563 UAS: Update My News page to use TanStack Query with pagination#14054
Open
elvinasv wants to merge 10 commits into
Open
WS-2563 UAS: Update My News page to use TanStack Query with pagination#14054elvinasv wants to merge 10 commits into
elvinasv wants to merge 10 commits into
Conversation
elvinasv
commented
May 21, 2026
Member
Author
There was a problem hiding this comment.
Note: Using the existing MyNewsPage with small tweaks. The UX is out of scope of this task
…ews-page-to-use-tan-stack-query-with-pagination
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the WS Next.js My News page to fetch UAS saved resources using TanStack Query and to restructure rendering via lazy-loaded client-only content (including pagination support).
Changes:
- Introduces a new
MyNewsPagecomponent structure (MyNewsPage/folder) with separate loading/guest/content components and client-only lazy loading. - Migrates
useUASRecentActivityfromuseEffect/local state to @tanstack/react-query with new UAS query keys. - Updates SSR props to pass the
pagequery param through to the client for pagination.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ws-nextjs-app/pages/[service]/my-news/types.ts | Adds My News page prop typing used by the new component structure. |
| ws-nextjs-app/pages/[service]/my-news/styles.ts | Removes the old empty state styling used by the deleted implementation. |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage/MyNewsPageLoading.tsx | Adds a loading placeholder component for lazy-loaded content. |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage/MyNewsPageGuest.tsx | Adds a guest placeholder component when personalization is disabled. |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage/MyNewsPageContent.tsx | Implements client-side fetching + pagination rendering using useUASRecentActivity. |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage/index.tsx | New wrapper page that gates on AccountContext and lazy-loads content. |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage/index.test.tsx | Updates import to new entrypoint (tests require further updates). |
| ws-nextjs-app/pages/[service]/my-news/MyNewsPage.tsx | Removes the previous all-in-one My News page implementation. |
| ws-nextjs-app/pages/[service]/my-news/index.page.tsx | Passes page query param into SSR props for the new pagination flow. |
| src/app/lib/uasApi/queryKeys.ts | Adds a React Query key helper for paged favourites. |
| src/app/lib/uasApi/getRecentActivity.ts | Extracts and exports a RecentActivityData type for hook/tests. |
| src/app/hooks/useUASRecentActivity/index.ts | Migrates recent activity fetching to TanStack Query. |
| src/app/hooks/useUASRecentActivity/index.test.ts | Rewrites tests to validate React Query configuration and behavior. |
Comments suppressed due to low confidence (1)
ws-nextjs-app/pages/[service]/my-news/MyNewsPage/index.test.tsx:9
- After switching the component entrypoint to
.(and moving logic into the newMyNewsPage/dynamic content components), these tests need their setup updated:MyNewsPagenow depends onAccountContext(personalization availability/enabled) and the mockeduseUASRecentActivityreturn type/UI copy have changed (e.g.erroris nowError | null, and empty/error messages differ). As written, the default providers (idctaConfigisnull) will cause the page to returnnulland assertions will fail.
…query-with-pagination
…query-with-pagination
LukasFrm
approved these changes
May 22, 2026
jinidev
approved these changes
May 22, 2026
Contributor
jinidev
left a comment
There was a problem hiding this comment.
Looks good and tested all scenarios including analytics , working fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: https://bbc.atlassian.net/browse/WS-2563
Summary
Testing
x-id-oidc-signedin: 1as a Request HeaderUseful Links