Skip to content

Conversation

@caseBread
Copy link
Member

Reverts #146

@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fe Ready Ready Preview Comment Nov 28, 2025 5:12pm

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @caseBread, 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 reverts a previous change (#146) that aimed to fix the display of the photo detail bottom swiper on PC. The revert restores the previous behavior by reactivating a useEffect hook for swiper control and adjusting the Swiper component's configuration, specifically by adding slide offsets and removing the centeredSlides property. This suggests the original fix might have introduced regressions or did not achieve its intended purpose.

Highlights

  • Reverted useEffect Activation: The useEffect hook responsible for controlling the thumbSwiper's active slide and position based on activeIndex and thumbOffset has been reactivated, undoing its previous commented-out state.
  • Swiper Configuration Adjustment: The Swiper component now includes slidesOffsetBefore and slidesOffsetAfter properties, both set to thumbOffset, and the centeredSlides property has been removed.
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.

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 reverts a previous change that aimed to fix the photo detail swiper on PC. The revert re-enables a manual implementation for centering the active thumbnail, which involves a useEffect hook to calculate and apply a translation. The change also replaces the centeredSlides Swiper property with slidesOffsetBefore and slidesOffsetAfter. My review focuses on a potential issue with this manual implementation. I've identified that using both slidesOffset... properties and programmatically setting the translation via setTranslate is redundant and could lead to performance degradation and visual bugs. I've recommended simplifying the implementation by removing the slidesOffset... properties and relying only on the useEffect for dynamic positioning.

Comment on lines +123 to +124
slidesOffsetBefore={thumbOffset}
slidesOffsetAfter={thumbOffset}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Using both slidesOffsetBefore/slidesOffsetAfter and programmatically calling thumbSwiper.setTranslate() in the useEffect hook seems redundant and may lead to conflicting behavior or visual glitches. The useEffect hook that calls setTranslate is designed to dynamically adjust the swiper's position, which is the correct approach for centering a dynamically selected active slide. The slidesOffset... props are generally for static offsets. Using a dynamic thumbOffset value here will cause the Swiper component to re-render whenever the active slide changes, which is less performant than just updating the transform via setTranslate.

It's recommended to remove slidesOffsetBefore and slidesOffsetAfter and rely solely on the useEffect to handle the translation.

@caseBread caseBread merged commit 1919e18 into main Nov 28, 2025
4 checks passed
@caseBread caseBread deleted the revert-146-fix/swiper-ui branch November 28, 2025 17:17
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.

2 participants