Skip to content

Conversation

@AdityaRajSinghRanawat
Copy link

@AdityaRajSinghRanawat AdityaRajSinghRanawat commented Dec 14, 2025

Summary by CodeRabbit

  • New Features

    • Added reusable Button component for consistent call-to-action styling across the site.
    • Introduced Projects dropdown menu in navigation for easier project browsing.
    • Added project selector on homepage to quickly access individual projects.
    • Enabled smooth scrolling behavior site-wide.
  • UI/UX Improvements

    • Redesigned footer with updated social links and dynamic copyright year.
    • Enhanced project cards with improved interactivity and hover effects.
    • Refactored Apply and Ideas pages with standardized button components.
    • Updated project descriptions for clarity and consistency across all pages.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 14, 2025

@AdityaRajSinghRanawat is attempting to deploy a commit to the AOSSIE Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Dec 14, 2025

Walkthrough

This PR introduces a new Button component and refactors existing Link-based buttons across multiple pages to use it. It adds a ProjectsDropdown to the Header navigation with imported project data, enhances project cards with href props and hover effects, updates project descriptions to concise standardized text across multiple years, adds smooth scrolling to the document root, introduces a no-scrollbar CSS utility, and enhances project selection interactivity on the homepage.

Changes

Cohort / File(s) Summary
Button Component & Refactoring
src/components/Button.jsx, src/components/Banner.jsx, src/pages/apply.jsx, src/pages/ideas/index.jsx, src/pages/ideas/2024/index.jsx
New Button component created as a styled Next.js Link-based button with primary/light variants and arrow adornment. Refactored Banner, apply page, and ideas pages to replace Link-based buttons with the new Button component.
Header Navigation Enhancement
src/components/Header.jsx, src/helper/projects.js
Added ProjectsDropdown component to Header with router-based active state and responsive grid of project links. Updated project helper descriptions across multiple entries to concise, standardized phrasing.
Component Enhancements
src/components/CardEffect.jsx, src/components/Footer.jsx
CardEffect enhanced with href prop, target, rel attributes, and improved hover/transition styling on inner container. Footer updated with decorative SVG arc, dynamic copyright year, LinkedIn link addition, replaced Twitter icon with custom X/Twitter SVG, and background styling adjustments.
Homepage & Projects Page
src/pages/index.jsx, src/pages/projects.jsx
Homepage adds selectedProject state with project picker, replaces Twitter icon with custom SVG, injects project selector UI with scroll-mounted ID, replaces inline Link button with Button component. Projects page wraps cards with anchor tags for full-card clickability, adds interactive styling, increases height/border-radius, removes direct Button imports.
Global Styling & Configuration
src/pages/_document.jsx, src/style/tailwind.css
Added "scroll-smooth" Tailwind class to Html element for smooth scrolling. Added .no-scrollbar CSS utility class to hide scrollbars across browsers.
Project Description Updates (2022)
src/pages/ideas/2022/agora-vote-android.mdx, agora-vote-ios.mdx, aossie-scholar.mdx, monumento.mdx, p2p-messaging-flutter.mdx
Condensed meta.description strings to concise, standardized phrasing with grammar/capitalization corrections.
Project Description Updates (2023)
src/pages/ideas/2023/agora-vote-ios.mdx, monumento-iPad.mdx, monumento.mdx, p2p-messaging-flutter.mdx
Updated meta.description fields to concise, standardized text emphasizing platform and core features.
Project Description Updates (2024)
src/pages/ideas/2024/agora-vote-ios.mdx, monumento-iPad.mdx, monumento.mdx
Condensed meta.description strings from verbose descriptions to concise AR/feature-focused text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

Areas requiring extra attention:

  • src/components/Button.jsx — New component; verify variant logic, prop spreading, and aria-label accessibility
  • src/components/Header.jsx — ProjectsDropdown adds new interactive logic with dropdown state and routing; review active state detection and link rendering
  • src/pages/index.jsx — Project selection state management, link-opening behavior, and integration with CardEffect href prop
  • src/pages/projects.jsx — Full-card clickability wrapping; ensure accessibility and link behavior consistency
  • src/components/CardEffect.jsx — New href prop and enhanced hover effects; verify transition performance and styling consistency

Poem

🐰 A button is born, so dapper and fine,
Projects dropdown dazzle in the Header's design,
Cards click and hover with elegant grace,
Smooth scrolling flows through every space—
Descriptions polished, brief and bright,
The web grows sleeker, a pure delight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title lists 15 issue numbers without summarizing what changes were made. It provides no meaningful information about the actual modifications across components, styling, or functionality. Replace with a concise, descriptive title that summarizes the main changes, such as 'Refactor UI components and update project descriptions' or 'Add Button component and improve navigation UI'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@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: 5

🧹 Nitpick comments (2)
src/pages/ideas/2022/aossie-scholar.mdx (1)

3-7: Consider whether omitting "Chrome extension" from the description aligns with your standardization goals.

The meta description has been simplified and is now more concise and clear. However, the project is fundamentally a Chrome extension (as detailed in the body on line 14), and removing this key identifier from the description could cause user confusion if they encounter the meta description independently.

If this omission is intentional for SEO or consistency across all standardized descriptions in the PR, that's fine. Otherwise, consider:

  export const meta = {
    title: 'Aossie Scholar',
    description:
-     'AOSSIE Scholar analyzes Google Scholar profiles to calculate performance metrics for researchers.',
+     'AOSSIE Scholar is a Chrome extension that analyzes Google Scholar profiles to calculate performance metrics for researchers.',
  }
src/pages/projects.jsx (1)

42-52: Consider extracting the long className string for readability.

The className on line 42 is quite long and reduces code maintainability. Consider extracting it to a constant or using a utility function.

Example refactor:

+const cardClasses = clsx(
+  "dark:bg-[#2A2A2A] dark:border-white",
+  "transition-transform duration-300",
+  "group-hover:scale-[1.02]",
+  "hover:shadow-lg hover:ring-2 hover:ring-[#FED41E]",
+  "dark:hover:ring-yellow-400 hover:ring-offset-2",
+  "hover:border-[#FED41E] dark:hover:border-yellow-400"
+)
+
 <MuiCard
-  className="dark:bg-[#2A2A2A] dark:border-white transition-transform duration-300 group-hover:scale-[1.02] hover:shadow-lg hover:ring-2 hover:ring-[#FED41E] dark:hover:ring-yellow-400 hover:ring-offset-2 hover:border-[#FED41E] dark:hover:border-yellow-400"
+  className={cardClasses}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfb8668 and 0e66a18.

📒 Files selected for processing (25)
  • src/components/Banner.jsx (2 hunks)
  • src/components/Button.jsx (1 hunks)
  • src/components/CardEffect.jsx (1 hunks)
  • src/components/Footer.jsx (2 hunks)
  • src/components/Header.jsx (3 hunks)
  • src/helper/projects.js (3 hunks)
  • src/pages/_document.jsx (1 hunks)
  • src/pages/apply.jsx (3 hunks)
  • src/pages/ideas/2022/agora-vote-android.mdx (1 hunks)
  • src/pages/ideas/2022/agora-vote-ios.mdx (1 hunks)
  • src/pages/ideas/2022/aossie-scholar.mdx (1 hunks)
  • src/pages/ideas/2022/monumento.mdx (1 hunks)
  • src/pages/ideas/2022/p2p-messaging-flutter.mdx (1 hunks)
  • src/pages/ideas/2023/agora-vote-ios.mdx (1 hunks)
  • src/pages/ideas/2023/monumento-iPad.mdx (1 hunks)
  • src/pages/ideas/2023/monumento.mdx (1 hunks)
  • src/pages/ideas/2023/p2p-messaging-flutter.mdx (1 hunks)
  • src/pages/ideas/2024/agora-vote-ios.mdx (1 hunks)
  • src/pages/ideas/2024/index.jsx (3 hunks)
  • src/pages/ideas/2024/monumento-iPad.mdx (1 hunks)
  • src/pages/ideas/2024/monumento.mdx (1 hunks)
  • src/pages/ideas/index.jsx (3 hunks)
  • src/pages/index.jsx (5 hunks)
  • src/pages/projects.jsx (1 hunks)
  • src/style/tailwind.css (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
src/components/Banner.jsx (1)
src/components/Button.jsx (1)
  • Button (3-25)
src/components/Footer.jsx (1)
src/components/Container.jsx (2)
  • Container (30-39)
  • Container (30-39)
src/pages/index.jsx (3)
src/helper/projects.js (1)
  • projects (12-85)
src/components/Button.jsx (1)
  • Button (3-25)
src/components/Container.jsx (2)
  • Container (30-39)
  • Container (30-39)
src/components/Header.jsx (1)
src/helper/projects.js (1)
  • projects (12-85)
src/pages/apply.jsx (1)
src/components/Button.jsx (1)
  • Button (3-25)
🔇 Additional comments (39)
src/pages/ideas/2024/monumento-iPad.mdx (1)

6-6: LGTM! Concise and focused description.

The updated description is more concise and clearly emphasizes the AR and social platform aspects of Monumento. This aligns well with similar standardization updates across other year versions.

src/pages/ideas/2023/p2p-messaging-flutter.mdx (1)

6-6: LGTM! Improved clarity and conciseness.

The updated description effectively summarizes the app's core functionality while removing verbose technical details that are better suited for the body content below.

src/pages/_document.jsx (1)

40-40: LGTM! Good UX enhancement.

Adding scroll-smooth provides a better user experience for anchor link navigation and aligns well with modern web standards.

src/pages/ideas/2023/monumento-iPad.mdx (1)

6-6: LGTM! Consistent with other versions.

The description update maintains consistency with the 2024 version and provides a clear, concise summary of Monumento's capabilities.

src/pages/ideas/2022/monumento.mdx (1)

6-6: LGTM! Consistent standardization.

The description update aligns with the 2023 and 2024 versions, ensuring consistent messaging about Monumento across all project years.

src/pages/ideas/2022/agora-vote-ios.mdx (1)

6-6: LGTM! Cleaner and more professional description.

The updated description is more concise and user-friendly while still conveying the core functionality of the Agora Vote iOS app.

src/pages/ideas/2022/p2p-messaging-flutter.mdx (1)

6-6: LGTM! Consistent with 2023 version.

The description update maintains consistency with the 2023 version and effectively summarizes the cross-platform messaging capabilities.

src/helper/projects.js (9)

16-16: LGTM! Clear and concise description.

The updated description for Agora Blockchain effectively communicates its democratic election capabilities with multiple voting algorithms.


26-26: LGTM! Improved clarity.

The updated description clearly communicates that this is an Android app leveraging Agora's Web API for elections with multiple voting algorithms.


36-36: LGTM! Professional and precise.

The description effectively highlights Djed's key characteristics: formal verification and algorithmic stablecoin protocol backed by crypto.


43-43: LGTM! Comprehensive feature summary.

The description clearly conveys PictoPy's privacy focus, desktop platform, and smart tagging capabilities for objects, faces, and scenes.


50-50: LGTM! Clear value proposition.

The description effectively communicates EduAid's educational purpose and target audience (teachers and students) along with its quiz generation capability.


57-57: LGTM! Strong security messaging.

The description emphasizes OpenChat's decentralized, secure, and blockchain-backed nature, which are key differentiators for the platform.


64-64: LGTM! Clear positioning.

The description effectively positions Resonate as an open-source alternative to Clubhouse with a focus on community growth.


71-71: LGTM! Comprehensive feature description.

The description effectively communicates Monumento's AR integration, social features, landmark discovery, check-in capability, and connection features. This aligns well with the updated descriptions in the MDX files.


78-78: LGTM! Clear problem and solution.

The description clearly identifies the problem (abusive language online) and the solution (detection and intervention) that Social Street Smart provides.

src/pages/ideas/2022/agora-vote-android.mdx (1)

6-6: LGTM! Concise description improves readability.

The updated description is clearer and more concise while retaining all essential information about the app's functionality.

src/pages/ideas/2023/monumento.mdx (1)

6-6: LGTM! Improved description clarity.

The updated description effectively communicates the AR social platform nature while being more concise.

src/pages/ideas/2024/agora-vote-ios.mdx (1)

6-6: LGTM! Consistent description standardization.

The description update aligns with the broader standardization effort across project pages.

src/pages/ideas/2023/agora-vote-ios.mdx (1)

6-6: LGTM! Consistent with other iOS page updates.

The description update maintains consistency across different year versions of the same project.

src/style/tailwind.css (1)

5-13: LGTM! Cross-browser scrollbar hiding utility.

The .no-scrollbar utility correctly implements scrollbar hiding across all major browsers using appropriate vendor-specific properties.

src/components/Banner.jsx (2)

2-2: LGTM! Button component import.

The import statement correctly brings in the new centralized Button component.


21-21: LGTM! Consistent Button component adoption.

The refactoring to use the Button component maintains the same navigation behavior while leveraging centralized styling and hover effects.

src/pages/ideas/index.jsx (3)

3-3: LGTM! CTAButton import.

The import correctly brings in the Button component as CTAButton for call-to-action usage.


43-43: LGTM! Removed redundant text-base class.

The text-base class was redundant since text-lg is already applied, so its removal is appropriate.


123-123: LGTM! Consistent CTAButton adoption.

The migration to CTAButton aligns with the broader refactoring effort across the codebase.

src/pages/ideas/2024/index.jsx (2)

3-3: LGTM! CTAButton import.

The import correctly brings in the Button component as CTAButton.


43-43: LGTM! Removed redundant text-base class.

The text-base class removal is appropriate since text-lg is already present.

src/pages/apply.jsx (1)

4-4: LGTM!

The Button component is being used correctly with an external href. The refactoring from Link to Button provides consistent styling across the application.

Also applies to: 146-146

src/components/Header.jsx (1)

160-224: LGTM!

The ProjectsDropdown component is well-implemented with proper accessibility attributes, smooth transitions, and responsive grid layout. The use of anchor tags for external project links with target="_blank" and rel="noopener noreferrer" is appropriate.

src/pages/projects.jsx (1)

33-92: Good enhancement: entire card is now clickable.

Wrapping the card in an anchor makes the entire surface area interactive, which improves accessibility and user experience. The hover effects (scale, shadow, ring) provide clear visual feedback.

src/pages/ideas/2024/monumento.mdx (1)

6-6: LGTM!

The description is now more concise and focused on the core AR functionality, improving clarity for users browsing project ideas.

src/components/Footer.jsx (3)

21-34: Decorative arc enhances visual design.

The SVG arc provides a smooth visual transition into the footer. The absolute positioning with -top-8 works well with the current layout.


45-45: Dynamic year keeps copyright current.

Using new Date().getFullYear() ensures the copyright year stays up to date automatically, eliminating the need for manual updates.


57-67: Social links updated with LinkedIn and X icons.

The addition of LinkedIn and the replacement of the Twitter icon with X aligns with current platform branding. Both links include proper accessibility labels.

src/pages/index.jsx (3)

101-114: Updated to X icon aligns with current branding.

The replacement of the Twitter icon with the X logo reflects the platform's rebranding. The custom SVG is properly sized and accessible.


138-155: Project selector enhances discoverability.

The dropdown in the Active Projects band provides a quick way for users to access specific projects. The styling is consistent with the design system.


158-166: Smooth scrolling is already properly configured via the scroll-smooth Tailwind class applied to the <Html> element in _document.jsx, so anchor navigation to #active-projects will function as expected.

src/components/CardEffect.jsx (1)

5-10: No action needed — all CardEffect usages pass external URLs only.

All href values in the projects data are external links (GitHub/GitLab URLs) or a placeholder (#). The target="_blank" behavior is appropriate for this component's current use case.

Comment on lines +12 to +13
aria-label={ariaLabel}
className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid rendering empty aria-label attribute.

When ariaLabel is an empty string (the default), the component still renders aria-label="", which is semantically incorrect and can confuse screen readers.

Apply this diff to conditionally render the attribute:

       <a
-        aria-label={ariaLabel}
+        {...(ariaLabel && { 'aria-label': ariaLabel })}
         className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
aria-label={ariaLabel}
className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
{...(ariaLabel && { 'aria-label': ariaLabel })}
className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
🤖 Prompt for AI Agents
In src/components/Button.jsx around lines 12 to 13, the component always renders
aria-label even when ariaLabel is an empty string; change the JSX to only
include the aria-label attribute when ariaLabel is non-empty (e.g.,
conditionally spread or render aria-label={ariaLabel} only if ariaLabel) so
empty strings are not emitted and screen readers are not confused.

<Link href={href} legacyBehavior>
<a
aria-label={ariaLabel}
className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Active state styling doesn't adapt to variant.

The active:bg-[#00843D] class is hardcoded but should respect the variant prop. For the 'light' variant, this green active state may not provide appropriate contrast or visual feedback.

Apply this diff to make the active state variant-aware:

+  const activeClasses =
+    variant === 'light'
+      ? 'active:bg-zinc-100 dark:active:bg-zinc-900'
+      : 'active:bg-[#006830]'
+
   return (
     <Link href={href} legacyBehavior>
       <a
         aria-label={ariaLabel}
-        className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
+        className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none ${activeClasses} ${variantClasses} ${className}`}
         {...props}
       >

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/components/Button.jsx around line 13, the className currently hardcodes
active:bg-[#00843D] which doesn't respect the variant prop; change this so the
active background is determined by the variant—either extend the variantClasses
object/utility to include the appropriate active:... class for each variant
(e.g., 'primary', 'secondary', 'light', etc.) and remove the hardcoded active
class from the template, or compute a small activeClass variable from the
variant prop and append it to the className; ensure the final className
concatenation uses that variant-aware active class so each variant has correct
active styling and contrast.

Comment on lines +16 to +20
<span className="absolute right-0 flex-shrink-0 translate-x-full rounded-full border border-current bg-white p-1 text-black transition-transform group-hover:-translate-x-4">
<svg className="h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M17 8l4 4m0 0l-4 4m4-4H3" />
</svg>
</span>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Arrow icon colors don't adapt to the button variant.

The arrow adornment is hardcoded to bg-white text-black, which doesn't adapt when the button uses the 'light' variant. This creates a visual inconsistency where the arrow may not have sufficient contrast against the button background.

Apply this diff to make the arrow styling variant-aware:

+  const arrowClasses =
+    variant === 'light'
+      ? 'bg-[#00843D] text-white dark:bg-yellow-400 dark:text-zinc-900'
+      : 'bg-white text-black'
+
   return (
     <Link href={href} legacyBehavior>
       <a
         aria-label={ariaLabel}
         className={`group relative inline-flex items-center overflow-hidden rounded-lg px-8 py-3 focus:outline-none active:bg-[#00843D] ${variantClasses} ${className}`}
         {...props}
       >
-        <span className="absolute right-0 flex-shrink-0 translate-x-full rounded-full border border-current bg-white p-1 text-black transition-transform group-hover:-translate-x-4">
+        <span className={`absolute right-0 flex-shrink-0 translate-x-full rounded-full border border-current p-1 transition-transform group-hover:-translate-x-4 ${arrowClasses}`}>
           <svg className="h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines 103 to 107
<div className="text-center mt-16">
<Link
href="/ideas"
className="mx-auto group rounded-lg items-center overflow-hidden bg-zinc-800 dark:bg-white px-8 py-3 text-white focus:outline-none dark:text-black"
>
<span className="font-mono font-semibold">Go Back</span>
</Link>
<div className="text-center mt-16">
<CTAButton href="/ideas">Go Back</CTAButton>
</div>
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove duplicate wrapper div.

There are nested div elements with identical classes (text-center mt-16), creating redundant markup. This appears to be a copy-paste error during the refactoring.

Apply this diff to remove the redundant wrapper:

-    <div className="text-center mt-16">
-                        <div className="text-center mt-16">
-                            <CTAButton href="/ideas">Go Back</CTAButton>
-                        </div>
+    <div className="text-center mt-16">
+        <CTAButton href="/ideas">Go Back</CTAButton>
     </div>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/pages/ideas/2024/index.jsx around lines 103 to 107 there are two nested
divs both using the same classes "text-center mt-16", creating redundant markup;
remove the extra wrapper by deleting the inner or outer duplicate div so only a
single <div className="text-center mt-16"> remains that directly contains the
CTAButton, keeping structure and spacing intact.

Comment on lines +24 to +31
const handleProjectSelect = (e) => {
const name = e.target.value
setSelectedProject(name)
const proj = projects.find((p) => p.name === name)
if (proj?.link?.href) {
window.open(proj.link.href, '_blank', 'noopener,noreferrer')
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Immediate window.open on select may be blocked by browsers.

The handleProjectSelect function calls window.open immediately when a project is selected from the dropdown. Modern browsers often block popup windows opened without a direct user click on a button/link, which could result in the link not opening and a confusing user experience.

Consider revising the UX to use a button or link approach:

-  const handleProjectSelect = (e) => {
-    const name = e.target.value
-    setSelectedProject(name)
-    const proj = projects.find((p) => p.name === name)
-    if (proj?.link?.href) {
-      window.open(proj.link.href, '_blank', 'noopener,noreferrer')
-    }
-  }
+  const handleProjectSelect = (e) => {
+    setSelectedProject(e.target.value)
+  }
+
+  const handleViewProject = () => {
+    const proj = projects.find((p) => p.name === selectedProject)
+    if (proj?.link?.href) {
+      window.open(proj.link.href, '_blank', 'noopener,noreferrer')
+    }
+  }

Then add a "View Project" button next to the select that calls handleViewProject.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/pages/index.jsx around lines 24 to 31, the handler currently calls
window.open immediately on select which can be blocked by browsers; instead stop
opening the window in the select handler and only setSelectedProject (and the
selected project object), add a separate "View Project" button or link next to
the dropdown that calls a new handleViewProject function on click; implement
handleViewProject to read the selected project, verify proj?.link?.href, and
open it via window.open(proj.link.href, '_blank', 'noopener,noreferrer') (or
render an anchor with target="_blank" rel="noopener noreferrer") so the open
happens on an explicit user click.

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.

1 participant