Skip to content

fix(ptdatax): new tab link on Portal requires CMS nav ready#538

Merged
wesleyboar merged 2 commits into
mainfrom
feat/cms-nav-ready-event
May 26, 2026
Merged

fix(ptdatax): new tab link on Portal requires CMS nav ready#538
wesleyboar merged 2 commits into
mainfrom
feat/cms-nav-ready-event

Conversation

@wesleyboar

@wesleyboar wesleyboar commented May 26, 2026

Copy link
Copy Markdown
Member

Overview

Wrap findLinksAndSetTargets, and defer until CMS nav signals it is ready.

open-certain-links-in-new-tab.js was calling findLinksAndSetTargets immediately at load time. On Portal pages the CMS nav is injected asynchronously, so the target links don't exist yet.

Related

Changes

  • refactored link query and findLinksAndSetTargets call into initLinks function

Testing

  1. On CMS page: Confirm internal-docs links still open in a new tab.
  2. On Portal: Confirm internal-docs links newly open in a new tab.

UI

CMS.mov
Portal.mov

Made with Cursor

Extract link initialization into `initLinks` and branch on whether
`#s-cms-nav` exists: call immediately on plain CMS pages, or wait for
the `cms-nav:ready` event (with a `data-nav-ready` flag fallback to
catch the case where the event already fired).

Co-authored-by: Cursor <cursoragent@cursor.com>
@wesleyboar wesleyboar changed the title fix(nav): defer link init until CMS nav is ready on Portal pages fix(ptdatax): defer link init until CMS nav is ready on Portal pages May 26, 2026
@wesleyboar wesleyboar changed the title fix(ptdatax): defer link init until CMS nav is ready on Portal pages fix(ptdatax): new tab link on Portal requires CMS nav ready May 26, 2026
@wesleyboar
wesleyboar marked this pull request as draft May 26, 2026 21:13
@wesleyboar
wesleyboar marked this pull request as ready for review May 26, 2026 21:42
@wesleyboar
wesleyboar merged commit bf743fd into main May 26, 2026
@wesleyboar
wesleyboar deleted the feat/cms-nav-ready-event branch May 26, 2026 21:42
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