Skip to content

Comments

🐛 Fix: related projects hover appears dark in light mode#1202

Closed
Copilot wants to merge 2 commits intofix/related-projects-hover-dark-light-modefrom
copilot/sub-pr-1195
Closed

🐛 Fix: related projects hover appears dark in light mode#1202
Copilot wants to merge 2 commits intofix/related-projects-hover-dark-light-modefrom
copilot/sub-pr-1195

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Hover effects on related project links rendered with dark-mode styling in light mode due to Tailwind dark:hover:bg-gray-800 being applied during SSR hydration before the theme was resolved. Additionally, isProduction was computed at render time via typeof window !== 'undefined', causing a hydration mismatch.


📝 Summary of Changes

  • Replaced dark:hover:bg-gray-800 Tailwind class with React hover state (hoveredProject) and programmatic bgColor based on resolved theme
  • Moved isProduction from render-time typeof window check into useState(true) + useEffect (aligns with 🐛 Fix: resolve hydration mismatch in RelatedProjects links #1190)
  • Added suppressHydrationWarning to project <a> tags
  • Restored Moon/Sun className template literals to original 3-line format

Changes Made

  • Fixed hover background color bleeding into light mode by replacing Tailwind dark: variant with JS state-driven inline styles
  • Refactored isProduction to useState/useEffect pattern to eliminate SSR/client hydration mismatch
  • Reverted unrelated Moon/Sun className reformatting introduced in original PR

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.

Screenshots or Logs (if applicable)


👀 Reviewer Notes

Rebased onto main after #1190 merged. Conflict in RelatedProjects.tsx resolved by keeping #1190's isProduction state pattern and layering the hover fix on top. No functional changes to isProduction behavior — only the hover styling fix is net-new.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@kubestellar-prow kubestellar-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: no Indicates the PR's author has not signed the DCO. labels Feb 24, 2026
@netlify
Copy link

netlify bot commented Feb 24, 2026

Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit 04d2640
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/699d1e08d60783000881ec9c
😎 Deploy Preview https://deploy-preview-1202--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow kubestellar-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 24, 2026
@kubestellar-prow
Copy link

Hi @Copilot. Thanks for your PR.

I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

…matting

- Add isProduction as useState(true) + useEffect (from #1190) to avoid render-time window check
- Remove render-time typeof window !== 'undefined' isProduction check
- Restore Moon/Sun className to original 3-line format (revert unrelated reformatting)
- Add suppressHydrationWarning to <a> tag (from #1190)
- Keep hover fix: hoveredProject state, onMouseEnter/onMouseLeave, bgColor logic

Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from clubanderson. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
Copy link

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@kubestellar-prow kubestellar-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 24, 2026
Copilot AI changed the title [WIP] Fix related projects hover appearance in light mode 🐛 Fix: related projects hover appears dark in light mode Feb 24, 2026
Copilot AI requested a review from clubanderson February 24, 2026 03:42
Copy link
Contributor

@clubanderson clubanderson left a comment

Choose a reason for hiding this comment

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

1195 🐛 Fix: related projects hover appears dark in light mode btwshivam

@clubanderson
Copy link
Contributor

Closing — this is a Copilot-generated duplicate of #1195 which is the human-authored fix for the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: no Indicates the PR's author has not signed the DCO. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants