Skip to content

fix: add rel to block viewer new-tab link#802

Open
sabraman wants to merge 1 commit intoncdai:mainfrom
sabraman:codex/add-rel-to-block-viewer-link
Open

fix: add rel to block viewer new-tab link#802
sabraman wants to merge 1 commit intoncdai:mainfrom
sabraman:codex/add-rel-to-block-viewer-link

Conversation

@sabraman
Copy link
Contributor

@sabraman sabraman commented Mar 17, 2026

Summary

This PR adds the missing rel attribute to the block viewer link that opens a preview in a new tab.

The link already used target="_blank", but it did not include rel="noopener noreferrer". This aligns it with the safer pattern already used elsewhere in the codebase.

Changes

  • add rel="noopener noreferrer" to the new-tab link in BlockViewerToolbar

Verification

  • ran pnpm check-types

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced security for external links by preventing newly opened pages from accessing the opener window.

@vercel
Copy link

vercel bot commented Mar 17, 2026

@sabraman is attempting to deploy a commit to the React Wheel Picker OSS Program Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3124a4ff-611b-48b0-9a22-46749299d138

📥 Commits

Reviewing files that changed from the base of the PR and between 3087393 and dc51081.

📒 Files selected for processing (1)
  • src/components/block-viewer.tsx

📝 Walkthrough

Walkthrough

Added the rel="noopener noreferrer" security attribute to an anchor element with target="_blank" in the block viewer component. This prevents the opened page from accessing the opener window reference, enhancing security without affecting functionality.

Changes

Cohort / File(s) Summary
Security Enhancement
src/components/block-viewer.tsx
Added rel="noopener noreferrer" attribute to anchor element with target="_blank" to prevent opened page from accessing the opener window.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A link once opened to the wide web's view,
Could peek back homeward—oh no, that won't do!
With noopener guards and noreferrer shield,
Our rabbit-built walls leave invaders revealed! 🛡️

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the rel attribute to the block viewer new-tab link for improved security.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants