Skip to content

Conversation

@codebestia
Copy link

Description

This PR introduces social media sharing capabilities and SEO with OpenGraph for key pages in the application.

Changes

New Components

  • SeoHead: Manages meta tags for Open Graph (Facebook/LinkedIn) and Twitter Cards using react-helmet-async.
  • ShareButtons: Reusable component with buttons for X (Twitter), LinkedIn, and Copy Link.

Integration

  • Added SeoHead and ShareButtons to Vulnerability Details and Report Details pages.
  • Wrapped the application root in HelmetProvider to support dynamic head tag management.
  • Added react-helmet-async for managing document head tags.

Screenshots

report-details social-preview vulnerability-details

Related Issue

Closes #99

@SurfingBowser
Copy link
Collaborator

thank you for the contribution and for including a preview screenshot as well!

We will take a look at the code soon.

@codebestia
Copy link
Author

GM @SurfingBowser
Still awaiting the review.

@0xGeorgii 0xGeorgii requested a review from Copilot January 28, 2026 06:38
Copy link

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

This PR adds social media sharing capabilities and SEO optimization with OpenGraph meta tags to enhance content discoverability and shareability. It introduces two new reusable components for managing SEO metadata and social sharing buttons, integrating them into the Vulnerability Details and Report Details pages.

Changes:

  • Added SeoHead component for managing OpenGraph and Twitter Card meta tags
  • Added ShareButtons component with X (Twitter), LinkedIn, and Copy Link functionality
  • Integrated both components into Vulnerability Details and Report Details pages
  • Wrapped the application in HelmetProvider to enable dynamic head tag management

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
UI/src/main.tsx Wrapped app root in HelmetProvider to support dynamic meta tag management
UI/src/features/pages/regular/vulnerability-details/vulnerability-details.tsx Added SeoHead and ShareButtons components to vulnerability detail view
UI/src/features/pages/regular/report-details/report-details.tsx Added SeoHead and ShareButtons components to report detail view
UI/src/components/common/ShareButtons.tsx New component providing social media sharing buttons with clipboard copy functionality
UI/src/components/common/SeoHead.tsx New component for managing SEO meta tags including OpenGraph and Twitter Cards
UI/package.json Added react-helmet-async dependency for meta tag management
Files not reviewed (1)
  • UI/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 106 to 110
<SeoHead
title={vulnerability.title}
description={vulnerability.description?.substring(0, 160)}
url={window.location.href}
/>
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The SeoHead component is placed inside the page content rather than in the document head section. This component should be moved outside the main content Box, ideally near the top of the component's return statement, to ensure meta tags are properly rendered in the document .

Copilot uses AI. Check for mistakes.
Comment on lines 28 to 30
navigator.clipboard.writeText(shareUrl).then(() => {
setSnackbarOpen(true);
});
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The clipboard write operation lacks error handling. If the copy fails (e.g., due to permissions or browser compatibility), the user receives no feedback. Add a .catch() block to handle failures and show an appropriate error message to the user.

Copilot uses AI. Check for mistakes.
@SurfingBowser
Copy link
Collaborator

@codebestia please restore UI/package-lock.json and take a look at the co-pilot suggestions please

@codebestia
Copy link
Author

@SurfingBowser
I have applied the co-pilot reviews and restored the package-lock.json.
Though as the package-lock.json file is restored, npm ci command (which i noticed in your workflow) will fail because there is package (react-helmet-async) in the package.json file that is not accounted for in the package-lock.json file.

@codebestia
Copy link
Author

@SurfingBowser @0xGeorgii
Please review

Copy link

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{vulnerability && (
<SeoHead
title={vulnerability.title}
description={vulnerability.description?.substring(0, 160) ?? ""}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

The magic number 160 should be extracted as a named constant (e.g., MAX_DESCRIPTION_LENGTH) to improve code maintainability and make its purpose clear.

Copilot uses AI. Check for mistakes.
const metaDescription = description || 'Soroban security portal - audits, reports, and vulnerabilities.';
const metaUrl = url || window.location.href;
// Fallback image could be a generic logo if not provided
const metaImage = image || `${window.location.origin}/static/images/logo.png`;
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

The hardcoded image path '/static/images/logo.png' should be extracted as a constant, preferably in a configuration file, to make it easier to update and maintain.

Copilot uses AI. Check for mistakes.
Comment on lines 31 to 32
console.error('Failed to copy link');
alert('Failed to copy link');
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

Using window.alert() for error handling provides poor user experience. Consider using the existing Snackbar component with severity='error' to display the error message consistently with the success case.

Copilot uses AI. Check for mistakes.
@codebestia
Copy link
Author

@0xGeorgii co-pilot review implemented

@0xGeorgii 0xGeorgii requested a review from Copilot February 1, 2026 09:56
Copy link

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +36
const handleCopyLink = () => {
navigator.clipboard.writeText(shareUrl).then(() => {
setSnackbarOpen(true);
}).catch(() => {
console.error('Failed to copy link');
setSnackbarOpen(true);
setShareError(true);
});
};
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The shareError state is not reset when successfully copying a link. If a user encounters an error and then successfully copies a link, the success message will incorrectly show as an error. Add setShareError(false) in the success handler before setSnackbarOpen(true).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@codebestia, please address this comment. I think it makes sense

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.

Add Social Sharing with OpenGraph Previews

3 participants