Skip to content

Conversation

@aniirathod
Copy link
Contributor

Summary

This PR implements an image modal feature that enhances the user experience when viewing images.
Instead of navigating to the image URL, users can now click on an image to view it in a modal overlay.

Changes Made

  • Added a new JavaScript implementation to handle image modal logic.
  • Applied Tailwind CSS-based styling for the modal and transition animations.
  • Restricted modal functionality only to relevant content images (excluding avatars, icons, and logos).
  • Clicking outside the image or pressing the close button dismisses the modal.

Issue Reference

Fixes #819

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @aniirathod, 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 introduces a significant user experience improvement by adding an image modal feature. Instead of opening images in a new tab, users can now click on main content images to view them in a sleek, full-screen overlay. This change streamlines image consumption, making the site more interactive and visually engaging.

Highlights

  • Image Modal Feature: Implemented a new image modal feature that allows users to click on content images to view them in an overlay, enhancing the viewing experience without navigating away from the page.
  • JavaScript Logic: A new JavaScript file (image.js) was added to handle the core functionality of the image modal, including opening, closing, and event listeners for user interaction.
  • Styling and Animations: Tailwind CSS is utilized for styling the modal overlay and its content, including transition animations for a smoother user experience. A new fade-in keyframe animation was added.
  • Targeted Application: The modal functionality is specifically applied to relevant content images by adding a modal-image class, ensuring that elements like avatars, icons, and logos are excluded.
  • Modal Dismissal: Users can dismiss the modal by clicking outside the image, pressing a dedicated close button, or using the 'Escape' key, providing multiple intuitive ways to exit the view.
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
Copy link

deepsource-io bot commented Oct 5, 2025

Here's the code health analysis summary for commits 885edf6..85b5da1. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

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

Copy link
Contributor

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

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 introduces a valuable image modal feature, improving the user experience for viewing images. The implementation is mostly solid, with appropriate changes to the HTML and CSS to support the new functionality. However, the core JavaScript logic in frontend/assets/scripts/image.js has a few areas for improvement regarding robustness, security, and event handling. I've provided specific comments and suggestions to address these points.

@jbampton
Copy link
Member

jbampton commented Oct 7, 2025

/gemini review

Copy link
Contributor

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

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 introduces a great image modal feature, enhancing the user experience. The JavaScript implementation is efficient, using event delegation. My review focuses on several key areas for improvement: critical accessibility enhancements for the modal (like focus trapping and ARIA attributes), preventing body scroll when the modal is active, and a couple of code refinements in both the JavaScript and CSS for better maintainability and correctness. Overall, this is a solid addition.

@jbampton jbampton marked this pull request as draft October 8, 2025 00:03
@jbampton jbampton self-assigned this Oct 9, 2025
@jbampton jbampton added this to Chess Oct 9, 2025
@jbampton jbampton added this to the Hacktoberfest milestone Oct 9, 2025
@jbampton jbampton moved this to In Progress in Chess Oct 9, 2025
@aniirathod
Copy link
Contributor Author

/gemini review

@aniirathod aniirathod marked this pull request as ready for review October 9, 2025 10:09
Copy link
Contributor

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

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 introduces a nice image modal feature, improving the image viewing experience. The implementation is solid, especially regarding accessibility features like focus management and ARIA attributes. I've left a few comments with suggestions for improvement, mainly focusing on a regression for users without JavaScript, a bug with the modal animation, and some points on code style and robustness. Overall, great work on this feature.

@aniirathod
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 successfully adds a new image modal feature, which is a great enhancement for user experience. The JavaScript implementation is particularly well-done, with excellent attention to accessibility details like focus management and ARIA attributes.

My review includes a few suggestions to improve the code further:

  • A fix for the modal's fade-in animation, which is currently not working due to incorrect CSS structure.
  • A couple of suggestions to improve long-term maintainability by separating data from presentation in a Nunjucks template and extracting long strings of utility classes from JavaScript into dedicated CSS classes.

@aniirathod
Copy link
Contributor Author

Hey @jbampton All requested changes have been implemented. Gemini bot is now suggesting additional improvements—if we decide to include those, I can open a PR for them.

@jbampton
Copy link
Member

/gemini review

Copy link
Contributor

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

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 introduces a well-implemented image modal feature, enhancing the user experience for viewing images. The JavaScript is clean and includes excellent accessibility considerations, such as focus trapping and ARIA attributes. The changes in the markdown files correctly apply the new functionality to the intended images.

I have a few suggestions to improve the implementation. One is a critical fix related to the Tailwind CSS configuration, which may break site styling. The others are aimed at improving the robustness and maintainability of the new JavaScript module by using the higher-resolution image source and refactoring the DOM creation to use an HTML <template>.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@aniirathod
Copy link
Contributor Author

Hey @jbampton, the Tailwind config currently used on the website is from an older version. In Tailwind CSS v4, there are new ways to structure and create CSS. Right now, everything is working fine, but in the future, this setup could break.

Please merge this PR, and I’ll create a follow-up PR to migrate our CSS to the modular Tailwind v4 version.

@aniirathod
Copy link
Contributor Author

Hey @jbampton can you review ?

@aniirathod
Copy link
Contributor Author

Hey @jbampton is there any update on this PR ?

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Create nice image display for when clicking on images for the whole site

2 participants