Skip to content

Conversation

@avivkeller
Copy link
Member

image

For api-docs-tooling, HTTP documentations are being mis-interpreted as outgoing links. We should instead check the full protocol.

Signed-off-by: Aviv Keller <me@aviv.sh>
Copilot AI review requested due to automatic review settings June 7, 2025 13:37
@avivkeller avivkeller requested a review from a team as a code owner June 7, 2025 13:37
@vercel
Copy link

vercel bot commented Jun 7, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jun 7, 2025 2:16pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Update the sidebar link logic to detect outgoing links based on a full protocol pattern rather than a simple prefix check.

  • Replace link.startsWith('http') with a regex test for http: or https: protocols.
  • Ensure only actual external URLs render the external-link icon.
Comments suppressed due to low confidence (1)

packages/ui-components/Containers/Sidebar/SidebarItem/index.tsx:39

  • Add unit tests for this new outgoing link detection regex to verify both matching cases (e.g., http://, https://) and non-matching paths (e.g., /http-docs/).
{/^https?:/.test(link) && <ArrowUpRightIcon className={styles.icon} />}

@codecov
Copy link

codecov bot commented Jun 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.47%. Comparing base (ab61d45) to head (39edd67).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7844      +/-   ##
==========================================
+ Coverage   75.44%   75.47%   +0.02%     
==========================================
  Files         101      101              
  Lines        8305     8305              
  Branches      218      218              
==========================================
+ Hits         6266     6268       +2     
+ Misses       2037     2035       -2     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM

@ovflowd
Copy link
Member

ovflowd commented Jun 7, 2025

I believe this fix can be fast-tracked. Simple enough.

@ovflowd ovflowd added fast-track Fast Tracking PRs github_actions:pull-request Trigger Pull Request Checks labels Jun 7, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jun 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 96 🟢 100 🟠 82 🔗
/en/about/previous-releases 🟢 99 🟢 96 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@avivkeller avivkeller added this pull request to the merge queue Jun 7, 2025
Merged via the queue into main with commit 9592ede Jun 7, 2025
19 checks passed
@avivkeller avivkeller deleted the fix/sidebar/regex branch June 7, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track Fast Tracking PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants