Skip to content

[2.0] fix(ui): open BlockEditor mention links with noopener - #38089

Merged
harsh-vador merged 1 commit into
2.0from
backport/2.0/pr-38086
Nov 18, 2026
Merged

harsh-vador merged 1 commit into
2.0from
backport/2.0/pr-38086

Conversation

@gh-bot-collate

@gh-bot-collate gh-bot-collate Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Automated backport of #38086 to 2.0.

Source PR #38086
Author @harsh-vador
Merge commit 5fd9b6c167aee8d4683c22e1f34d4594ac725c6b
Method Conflicts resolved by Claude — worth a read of the diff.

Resolution notes

Backport notes: PR #38086 → 2.0

Source change: add noopener,noreferrer to the window.open call used when a
BlockEditor mention/hashtag link is clicked, so the new tab can't reach back
into the opener via window.opener.

Conflicts and resolution

On main this logic lives in a standalone openMentionLink(target) helper
(added by a later, unrelated refactor that also handles an "AI shell /
settings-modal" link case via getSettingsHashForHref). That helper and
getSettingsHashForHref do not exist on 2.0 — the equivalent logic on
2.0 is still inline inside handleLinkPopup in
EditorSlots.tsx, where mention/hashtag links are opened with
window.open(href, linkTarget); (no helper extraction, no settings-hash
check).

  • EditorSlots.tsx: Dropped the incoming openMentionLink helper
    entirely (it depends on getSettingsHashForHref, which isn't present on
    2.0, and the refactor that introduced the helper is out of scope for this
    backport). Instead applied the actual fix in place, on 2.0's existing
    inline code path:

    -window.open(href, linkTarget);
    +window.open(href, linkTarget, 'noopener,noreferrer');
  • EditorSlots.test.tsx: Kept the new describe('EditorSlots mention links', ...) test case from the source PR, which exercises exactly this
    behavior via ref.current.onMouseDown(...) and asserts
    window.open was called with 'noopener,noreferrer'. Dropped the
    trailing describe('EditorSlots menus', ...) block that appeared in the
    same conflict hunk — it tests an editable prop on EditorSlots that
    doesn't exist on 2.0 (2.0's EditorSlots only destructures { editor, menuType }), so that block belongs to a separate, unbackported main-only
    change and isn't part of PR fix(ui): open BlockEditor mention links with noopener #38086.

What a reviewer should check

  • EditorSlots.tsx: confirm the window.open call inside the
    ['mention', 'hashtag'].includes(dataType) branch of handleLinkPopup is
    the only change, and no openMentionLink/getSettingsHashForHref
    reference was left behind.
  • EditorSlots.test.tsx: confirm only the mention links describe block was
    added, and the file still ends after it (no menus describe block, no
    editable prop reference).
  • Tests were not run in this environment (node_modules not installed); a
    follow-up CI run of yarn test src/components/BlockEditor/EditorSlots.test.tsx
    should be the first signal to watch.

Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38086 is asked to look.

resolver run

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Backports the mention-link safety fix without bringing in unrelated editor changes.

  • BlockEditor mention and hashtag links open without giving the new tab an opener.

No actionable issues found. Tests were not run.

Reviews (1) · Last reviewed commit: "fix(ui): open BlockEditor mention links ..." · Reviewed by Greptile

@gh-bot-collate
gh-bot-collate Bot requested a review from a team as a code owner November 18, 2026 07:29
@gh-bot-collate
gh-bot-collate Bot requested review from ShaileshParmar11 and removed request for a team November 18, 2026 07:29
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 18, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.0 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@harsh-vador
harsh-vador merged commit c4f6335 into 2.0 Nov 18, 2026
57 of 62 checks passed
@harsh-vador
harsh-vador deleted the backport/2.0/pr-38086 branch November 18, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants