Skip to content

Fix im feeling lucky button#158

Merged
BaseMax merged 5 commits into
john-bampton:mainfrom
NssGourav:fix-im-feeling-lucky-button
Dec 21, 2025
Merged

Fix im feeling lucky button#158
BaseMax merged 5 commits into
john-bampton:mainfrom
NssGourav:fix-im-feeling-lucky-button

Conversation

@NssGourav

Copy link
Copy Markdown
Contributor

Final Fixes

  • The "I'm Feeling Lucky" button now scrolls to a random user

…ofile

- Changed pickRandomUser() function to navigate to user's GitHub profile
- Removed scroll/highlight behavior in favor of direct navigation
- Opens random user profile in new tab based on current filters
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @NssGourav, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the user experience of the 'I'm Feeling Lucky' feature. It ensures that when a random user is selected, the page scrolls smoothly to their card, and any interactive elements within that card are temporarily neutralized to prevent accidental clicks during the highlight period. This provides a more controlled and user-friendly interaction with the feature.

Highlights

  • Enhanced 'I'm Feeling Lucky' Button: The 'I'm Feeling Lucky' button now includes more robust event prevention, ensuring its click action is handled without unintended side effects.
  • Improved User Card Scrolling: The scrolling behavior when a random user is selected has been refined to use window.scrollTo with an offset, providing a smoother and more visually appealing experience than scrollIntoView.
  • Temporary Link Disabling in Highlighted Cards: Links within the randomly selected and highlighted user card are now temporarily disabled to prevent accidental navigation while the card is in focus, re-enabling them after the highlight fades.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io

deepsource-io Bot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Here's the code health analysis summary for commits 57f0fa4..fb8961d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource JavaScript LogoJavaScript❌ Failure
❗ 3 occurences introduced
🎯 2 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request fixes the "I'm Feeling Lucky" button by making it scroll to a random user and highlight their card. The changes are quite comprehensive, adding robust logic to prevent accidental navigation during the highlight animation.

My review focuses on simplifying some of the new logic, which appears to be overly defensive in a couple of places. I've suggested removing redundant event handling code to make it cleaner and easier to maintain. Specifically:

  • The event listener for the button can be simplified as the pickRandomUser function already handles the event.
  • The temporary disabling of links on the user card can be simplified by removing a redundant click listener, as setting pointer-events: none is sufficient.

Overall, these are good improvements to the feature's user experience.

Comment thread docs/script.js Outdated
Comment thread docs/script.js Outdated
@NssGourav

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

The pull request modifies docs/script.js to enhance the pickRandomUser function and update setupEventListeners. The pickRandomUser function now includes event prevention, adjusts scrolling to a user card with an offset, and temporarily disables links within the selected card during a highlight animation. The setupEventListeners function was updated to explicitly set the random button's type to 'button'. Review comments suggest maintaining consistent coding style by using double quotes for strings and 2-space indentation, replacing return false with return for early exits, extracting magic numbers into named constants, and using CSS classes for styling concerns like disabling pointer events instead of direct DOM manipulation.

Comment thread docs/script.js
Comment thread docs/script.js
Comment thread docs/script.js
Comment thread docs/script.js
Comment thread docs/script.js
@NssGourav

Copy link
Copy Markdown
Contributor Author

@BaseMax I’ve opened a new PR with all the final changes consolidated.
I double checked everything on my end checks are passing and the issues discussed earlier are addressed.
Please have a look when you’re free. Thanks!

@BaseMax

BaseMax commented Dec 21, 2025

Copy link
Copy Markdown
Member

What is new PR URL? Please share.

@BaseMax BaseMax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok

@BaseMax

BaseMax commented Dec 21, 2025

Copy link
Copy Markdown
Member

cc #137

@BaseMax BaseMax merged commit 6ac7ca8 into john-bampton:main Dec 21, 2025
5 of 6 checks passed
@jbampton jbampton self-assigned this Dec 22, 2025
@jbampton jbampton added the help wanted Extra attention is needed label Dec 22, 2025
@jbampton jbampton added this to Turbo Dec 22, 2025
@github-project-automation github-project-automation Bot moved this to Done in Turbo Dec 22, 2025
@jbampton jbampton added this to the December 2025 milestone Dec 22, 2025
@jbampton jbampton linked an issue Dec 22, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug in "🎲 I'm Feeling Lucky" button - seems not working for me here

3 participants