WS-3083 - Implement watch and listen URL routing behaviour - #14315
Draft
holchris wants to merge 15 commits into
Draft
WS-3083 - Implement watch and listen URL routing behaviour#14315holchris wants to merge 15 commits into
holchris wants to merge 15 commits into
Conversation
alex-magana
reviewed
Aug 13, 2026
…ting-behaviour-simorgh
…ting-behaviour-simorgh
Contributor
There was a problem hiding this comment.
Pull request overview
Implements World Service routing support for /watch/ and /listen/ URLs so Optimo content can be accessed via these alternative URL prefixes while still being treated as article content within Simorgh/Next.js routing and utilities.
Changes:
- Extends Optimo URL detection to treat
/watch/and/listen/paths as article/Optimo IDs. - Adds Next.js rewrites for
/watch/and/listen/to route requests to the/articles/handler. - Updates promo URL handling and unit tests to support variant swapping on
/watch/and/listen/Optimo promo URIs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ws-nextjs-app/utilities/derivePageType/index.test.ts | Adds tests asserting /watch/ and /listen/ Optimo paths derive ARTICLE_PAGE. |
| ws-nextjs-app/next.config.js | Introduces rewrites intended to route /watch/ and /listen/ requests to /articles/. |
| src/app/routes/utils/constructPageFetchUrl/index.ts | Updates Optimo ID regex to include /watch/ and /listen/ as valid Optimo platforms. |
| src/app/lib/utilities/getStoryPromoInfo/index.jsx | Extends variant URL swapping logic to support /watch/ and /listen/ URIs. |
| src/app/lib/utilities/getStoryPromoInfo/index.test.jsx | Adds unit tests covering variant URL swapping for /watch/ and /listen/ promo items. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
68
to
+72
| { | ||
| source: '/:service/og/:id', | ||
| destination: '/api/:service/og/:id', | ||
| source: '/:service/watch/:id', | ||
| destination: '/:service/articles/:id', | ||
| }, | ||
| { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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: WS-3083
Summary
Adds routing to support
/watch/and/listen/URLs so Optimo content can be accessed through this new routeCode changes
/watch/and/listen//watch/and/listen/URLs/watch/and/listen/URLs to be routed to the/articles/requestTesting
Useful Links