Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO: a11y + open external links in new tabs #1463

Merged
merged 3 commits into from
Aug 6, 2024
Merged

SEO: a11y + open external links in new tabs #1463

merged 3 commits into from
Aug 6, 2024

Conversation

SutuSebastian
Copy link
Collaborator

@SutuSebastian SutuSebastian commented Aug 6, 2024

Result

Before
Screenshot 2024-08-06 at 15 49 36

After
Screenshot 2024-08-06 at 15 44 32

Summary by CodeRabbit

  • New Features
    • Consolidated navigation links for improved accessibility and user experience.
    • Enhanced security for external links across various components.
  • Accessibility Improvements
    • Added descriptive aria-label attributes to navigation links for screen reader compatibility.
  • User Experience Enhancements
    • Updated links to open in new tabs, maintaining the application context.
    • Improved semantic structure of navigation elements throughout the application.

@SutuSebastian SutuSebastian added the 📚 documentation Improvements or additions to documentation label Aug 6, 2024
@SutuSebastian SutuSebastian self-assigned this Aug 6, 2024
Copy link

vercel bot commented Aug 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 1:19pm
flowbite-react-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 1:19pm

Copy link

changeset-bot bot commented Aug 6, 2024

⚠️ No Changeset found

Latest commit: 9096829

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Aug 6, 2024

Walkthrough

The recent updates primarily enhance the accessibility, security, and semantic structure of the web application. Key changes include consolidating navigation links for better screen reader support, improving external link handling by adding rel attributes, and ensuring consistent use of target="_blank" to open links in new tabs. These improvements collectively aim to create a more user-friendly and secure navigation experience across various components.

Changes

Files Change Summary
apps/web/app/docs/layout.tsx, apps/web/components/homepage/home-navbar.tsx Consolidated <Link> components to improve accessibility by including both logo and text in single elements. Removed visually hidden elements and added descriptive alt text.
apps/web/app/layout.tsx Removed maximumScale property from the viewport configuration, allowing greater zoom flexibility on devices.
apps/web/components/code-demo.tsx, apps/web/components/homepage/contributors-section.tsx, apps/web/components/homepage/featured-section.tsx, apps/web/components/homepage/figma-section.tsx, apps/web/components/homepage/react-section.tsx, apps/web/components/homepage/social-proof-section.tsx, apps/web/components/homepage/tailwind-section.tsx, apps/web/components/navbar.tsx Updated anchor tags to include rel="noopener" and target="_blank" attributes, enhancing security and user experience. Added aria-label attributes for improved accessibility in navigation components, making the links more descriptive for screen readers.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Navbar
    participant ExternalSite

    User->>Navbar: Click on external link
    Navbar->>ExternalSite: Open link in new tab
    ExternalSite->>Navbar: No access to original page
Loading

🐰 In a world so bright and new,
I hop and skip, with joy in view!
Links now safe, and pathways clear,
A better web for all, I cheer!
With each small change, we grow and learn,
Hop along, it’s our turn! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SutuSebastian SutuSebastian merged commit c47d3a8 into main Aug 6, 2024
8 checks passed
@SutuSebastian SutuSebastian deleted the seo branch August 6, 2024 13:23
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d536caf and 9096829.

Files selected for processing (11)
  • apps/web/app/docs/layout.tsx (1 hunks)
  • apps/web/app/layout.tsx (1 hunks)
  • apps/web/components/code-demo.tsx (1 hunks)
  • apps/web/components/homepage/contributors-section.tsx (1 hunks)
  • apps/web/components/homepage/featured-section.tsx (4 hunks)
  • apps/web/components/homepage/figma-section.tsx (2 hunks)
  • apps/web/components/homepage/home-navbar.tsx (1 hunks)
  • apps/web/components/homepage/react-section.tsx (2 hunks)
  • apps/web/components/homepage/social-proof-section.tsx (4 hunks)
  • apps/web/components/homepage/tailwind-section.tsx (1 hunks)
  • apps/web/components/navbar.tsx (5 hunks)
Files skipped from review due to trivial changes (1)
  • apps/web/app/docs/layout.tsx
Additional comments not posted (31)
apps/web/components/homepage/home-navbar.tsx (2)

20-21: Improved accessibility by consolidating navigation links.

The change consolidates the navigation links into a single <Link> component, improving accessibility by associating the logo with its text label.


21-21: Descriptive alt text for better screen reader support.

Adding a descriptive alt text ("Flowbite React logo") to the image improves accessibility for screen readers.

apps/web/app/layout.tsx (1)

Line range hint 28-28:
Greater flexibility in zooming by removing maximumScale.

The removal of the maximumScale property allows for greater flexibility in zooming, which can enhance user experience.

However, verify the impact on layout and accessibility to ensure there are no unintended consequences.

apps/web/components/navbar.tsx (3)

24-25: Enhanced security for external links.

Adding rel="noopener" and target="_blank" attributes ensures that the link opens in a new tab without giving the new page access to the original page's context, enhancing security.


32-33: Enhanced security for external links.

Adding rel="noopener" and target="_blank" attributes ensures that the link opens in a new tab without giving the new page access to the original page's context, enhancing security.


66-66: Enhanced security and accessibility for external links.

Adding rel="nofollow noopener noreferrer", target="_blank", and aria-label attributes ensures that the link opens in a new tab without giving the new page access to the original page's context, enhances security, and improves accessibility for screen readers.

apps/web/components/homepage/tailwind-section.tsx (2)

46-46: Approved: Enhanced security for external link.

The addition of rel="nofollow noopener noreferrer" is a good practice to enhance security and SEO.


55-55: Approved: Enhanced security for external link.

The addition of rel="noopener" is a good practice to enhance security by preventing reverse tabnabbing.

apps/web/components/homepage/react-section.tsx (2)

42-47: Approved: Improved semantic structure and routing integration.

Replacing the anchor tag with a Link component pointing to the root path (/) enhances semantic structure and routing integration.


84-90: Approved: Enhanced security and user experience for external link.

The addition of rel="noopener" and target="_blank" to the Button component is a good practice to enhance security and user experience.

apps/web/components/homepage/contributors-section.tsx (1)

75-76: Approved: Enhanced security and user experience for external link.

The addition of rel="noopener" and target="_blank" to the Link component is a good practice to enhance security and user experience.

apps/web/components/homepage/social-proof-section.tsx (8)

93-93: Approved: Security enhancement with rel="noopener".

The addition of rel="noopener" improves security by preventing the new page from accessing the window object of the original page.


94-94: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.


119-119: Approved: Security and SEO enhancement with rel="nofollow noopener noreferrer".

The addition of rel="nofollow noopener noreferrer" improves security by preventing the new page from accessing the window object of the original page and prevents referrer information from being passed. It also improves SEO by preventing search engines from following the link.


120-120: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.


138-138: Approved: Security and SEO enhancement with rel="nofollow noopener noreferrer".

The addition of rel="nofollow noopener noreferrer" improves security by preventing the new page from accessing the window object of the original page and prevents referrer information from being passed. It also improves SEO by preventing search engines from following the link.


139-139: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.


178-178: Approved: Security and SEO enhancement with rel="nofollow noopener noreferrer".

The addition of rel="nofollow noopener noreferrer" improves security by preventing the new page from accessing the window object of the original page and prevents referrer information from being passed. It also improves SEO by preventing search engines from following the link.


179-179: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.

apps/web/components/code-demo.tsx (2)

275-275: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.


276-276: Approved: Security and SEO enhancement with rel="nofollow noopener noreferrer".

The addition of rel="nofollow noopener noreferrer" improves security by preventing the new page from accessing the window object of the original page and prevents referrer information from being passed. It also improves SEO by preventing search engines from following the link.

apps/web/components/homepage/figma-section.tsx (4)

23-23: Approved: Security and SEO enhancement with rel="nofollow noopener noreferrer".

The addition of rel="nofollow noopener noreferrer" improves security by preventing the new page from accessing the window object of the original page and prevents referrer information from being passed. It also improves SEO by preventing search engines from following the link.


24-24: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.


70-70: Approved: Security enhancement with rel="noopener".

The addition of rel="noopener" improves security by preventing the new page from accessing the window object of the original page.


71-71: Approved: Usability enhancement with target="_blank".

The addition of target="_blank" ensures that the link opens in a new tab, enhancing usability for external links.

apps/web/components/homepage/featured-section.tsx (6)

10-14: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.


35-39: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.


48-52: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.


69-73: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.


123-127: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.


123-127: Accessibility and security improvements.

The addition of aria-label, rel, and target attributes enhances accessibility and security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant