Skip to content

fix(article): return readers to the page they opened the article from - #121

Merged
EagleFox31 merged 6 commits into
mainfrom
fix/article-back-to-origin-20261014
Oct 14, 2026
Merged

EagleFox31 merged 6 commits into
mainfrom
fix/article-back-to-origin-20261014

Conversation

@EagleFox31

Copy link
Copy Markdown
Owner

Correction

  • Replaces hardcoded /${locale}/posts back link with a reusable, accessible <ArticleBackLink>.
  • A persistent client-side navigation context remembers an in-app previous page and uses browser Back (including scroll restoration).
  • If opened in a new tab or via a same-site hard navigation, falls back to the validated, same-origin referrer.
  • If coming from search engines, social networks or pasted URLs, returns to the same-language homepage instead of leaving Trigenys Insight.
  • Rejects external, foreign-language, and self-referential return targets.
  • Adds FR/EN unit coverage; leaves Article JSON-LD breadcrumb hierarchy unchanged.

Tests

pnpm test:unit, pnpm lint, TypeScript checks through Quality GitHub workflow.

Manual QA after release

  1. FR homepage → article → Retour => homepage
  2. Tech & IA / other rubric → article => originating rubric
  3. Open external share link/new tab => Trigenys homepage, not external site
  4. EN homepage → EN article => English homepage
  5. Native browser back behavior remains unchanged.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
trigenys-insight Ready Ready Preview Oct 14, 2026 8:20am UTC

@EagleFox31
EagleFox31 merged commit a3ac85c into main Oct 14, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
Preview — ebc5c526 Deployed Oct 14, 2026 by vercel[bot]
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.

1 participant