Skip to content

feat(SidebarItem): hover effect #7934

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Mohit5Upadhyay
Copy link

Description

This PR adds a hover effect to the links in the website’s left sidebar navigation. This PR resolves issue #7893 by introducing a hover effect for links both for dark-mode and light-mode

Validation

sidebar-hover-effect-resolve.mp4

Related Issues

Fixes #7893

Check List

  • [✅] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [✅] I have run pnpm format to ensure the code follows the style guide.
  • [✅] I have run pnpm test to check if all tests are passing.
  • [✅] I have run pnpm build to check if the website builds without errors.
  • [✅] I've covered new added functionality with unit tests if necessary.

@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 12:18
@Mohit5Upadhyay Mohit5Upadhyay requested a review from a team as a code owner July 2, 2025 12:18
Copy link

vercel bot commented Jul 2, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jul 5, 2025 7:06am

Copy link
Contributor

@Copilot 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 interactive hover effects to sidebar links, ensuring distinct visual feedback in both light and dark modes.

  • Introduces hover background, text, and shadow styles for non-active sidebar items
  • Adds smooth transitions and rounded corners to the sidebar item container and its nested elements
  • Updates label, icon, and progressionIcon classes with consistent transition settings

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

Why can't we do something like

&:hover {
    &:not(.progression) .label {
      @apply rounded-sm
        bg-whatever-600
        text-white;
    }
  }

@Mohit5Upadhyay
Copy link
Author

Hi @avivkeller,

Thank you for the feedback! I understand you're suggesting to restructure the hover effects like this:

&:hover {
  &:not(.progression) .label {
    @apply rounded-sm
      bg-whatever-600
      text-white;
  }
}

The new hover styling targets .label only, instead of the entire .item background for hover.


I’ve implemented your suggested changes as follows:

&:hover {
    &:not(.progression) .label {
      @apply rounded-sm
        bg-green-600
        text-white
        dark:bg-green-400;
    }

    .icon {
      @apply scale-110
        text-green-600
        dark:text-green-400;
    }
  }

on the place of current PR code :

&:not(.active):hover {
    @apply bg-neutral-100
      text-neutral-900
      shadow-sm
      dark:bg-neutral-800
      dark:text-neutral-100;

    .icon {
      @apply scale-110
        text-green-600
        dark:text-green-400;
    }

    .label {
      @apply text-neutral-900
        dark:text-neutral-100;
    }
  }

Updated Hover Style:

hover

The only differnce is that 🡥 , it appear outside the hover.

Please let me know if this matches with your suggested intention, or if there are any further tweaks or improvements you’d like me to make!

Also, should I update the existing one , if these chages are Okay ?

Thanks again for the guidance and review!

@avivkeller
Copy link
Member

I think you should use the grey color you were using again

@AugustinMauroy

This comment has been minimized.

@Mohit5Upadhyay
Copy link
Author

Hi @avivkeller & @AugustinMauroy,

I’ve updated the sidebar hover to use the greyish background, matching the nav hover style as suggested.

After Chages:

grey-hover-left-sidebar

I'd pushed all the chages. Let me know if there’s anything else you’d like me to adjust!
Thanks for the feedback.

@Mohit5Upadhyay
Copy link
Author

I’ve reverted all unnecessary edits and kept only:

  • rounded-md: since on the learn tab from nav the links needed this property on the left-sidebar
  • margin-bottom: 1px;: to ensure proper spacing between items

All other unintended changes have been removed.
Please let me know if this looks good or if you’d prefer any further adjustments.
Thanks again for the thorough review!

@ovflowd
Copy link
Member

ovflowd commented Jul 4, 2025

Hovering on the Learn pages feels a bit odd now in some circumstances:

image

image

image

Looks like an unrelated bug? The hexagons seem to be weird on last and first entries apparently. We could address that on separate PRs

image

I've also noticed, these menus on the blog page don't have an hover effect, would you mind, @Mohit5Upadhyay to make another contribution on a separate PR with that? Thanks!

image

Also OOC, does it make sense to not include the arrow as part of the hover? (cc @avivkeller, maybe not, but just wondering...)

image

@avivkeller
Copy link
Member

avivkeller commented Jul 4, 2025

+1 on including the arrow, my guess would be to wrap them in a div

Comment on lines 37 to 40
text-sm
transition-colors
duration-200
ease-in-out;
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated

Comment on lines 16 to 17
margin-bottom: 1px;

Copy link
Member

Choose a reason for hiding this comment

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

Unrelated

@Mohit5Upadhyay
Copy link
Author

I've also noticed, these menus on the blog page don't have an hover effect, would you mind, @Mohit5Upadhyay to make another contribution on a separate PR with that? Thanks!

Thanks! @ovflowd
Yes, I’d be happy to make another PR for that specific issue. Would you prefer that I create a new issue first to track it, or should I go ahead and open a PR directly? Thanks for the suggestion!

…nded corners, and clean unrelated styles as per review
@Mohit5Upadhyay
Copy link
Author

hi @avivkeller & @ovflowd ,

Regarding Arrow icon included in hover:

  • I made changes so the intended behaviour can be achieved

Intended Behaviour Hover:
arrrow-hover

Also as per the suggestion I also removed unrelated chages but it causes:

  • Not proper vertical spacing between active-link & hovered link (does it intended?) - due to margin
    margin-cause

  • removing rounded from .item will affect on Learn Tab links
    round-cause

I pushed my changes for review , please suggest me more tweaks if they required to be!
Thanks


{/^https?:/.test(link) && <ArrowUpRightIcon className={styles.icon} />}
<div className={`${styles.label} flex items-center gap-1.5`}>
Copy link
Member

Choose a reason for hiding this comment

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

Let's put these styles in the CSS file

Comment on lines 32 to 33
@apply font-regular
p-2
text-sm;
p-2;
Copy link
Member

Choose a reason for hiding this comment

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

Can we revert this, unless it's important?

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.36%. Comparing base (6ce9ac9) to head (1785286).
Report is 25 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7934      +/-   ##
==========================================
- Coverage   75.42%   75.36%   -0.06%     
==========================================
  Files          96       96              
  Lines        8354     8354              
  Branches      219      220       +1     
==========================================
- Hits         6301     6296       -5     
- Misses       2051     2056       +5     
  Partials        2        2              

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

@avivkeller
Copy link
Member

Noted! Feel free to re-add those, as they are important, but please use tailwind to apply the margin

@Mohit5Upadhyay
Copy link
Author

Hi @avivkeller,
Thanks again for the great feedback!

  • I’ve moved the flex, items-center, and gap-1.5 styles from JSX into the CSS .label class as suggested.

Noted! Feel free to re-add those, as they are important, but please use tailwind to apply the margin

  • I added these properties also as per suggestion

Let me know if there’s anything else you’d like me to refine!
Thanks!

@avivkeller avivkeller dismissed their stale review July 5, 2025 10:59

Dismissed

@avivkeller avivkeller changed the title fix: add hover effect to sidebar links (#7893) feat(SidebarItem): hover effect Jul 5, 2025
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.

Links in the site's left sidebar don't have a hover effect
4 participants