Skip to content

WS-3083 - Implement watch and listen URL routing behaviour - #14315

Draft
holchris wants to merge 15 commits into
latestfrom
WS-3083-implement-watch-and-listen-url-routing-behaviour-simorgh
Draft

WS-3083 - Implement watch and listen URL routing behaviour#14315
holchris wants to merge 15 commits into
latestfrom
WS-3083-implement-watch-and-listen-url-routing-behaviour-simorgh

Conversation

@holchris

@holchris holchris commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: WS-3083

Summary

Adds routing to support /watch/ and /listen/ URLs so Optimo content can be accessed through this new route

Code changes

  • Updates regex to support /watch/ and /listen/
  • Supports variants being appended to /watch/ and /listen/ URLs
  • Adds a rewrite to ensure /watch/ and /listen/ URLs to be routed to the /articles/ request

Testing

  1. List the steps required to test this PR.

Useful Links

@holchris holchris self-assigned this Aug 13, 2026
Comment thread ws-nextjs-app/next.config.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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',
},
{
Comment thread ws-nextjs-app/utilities/derivePageType/index.test.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants