fix: result cards carousel — horizontal scroll, one card per view#213
fix: result cards carousel — horizontal scroll, one card per view#213
Conversation
Reverts PR #211 vertical-stack approach. Correct layout per Markus design spec: - .results-cards-scroll: flex-direction:row, overflow-x:auto - .result-card: flex:0 0 100%, width:100% Result: horizontal slider/carousel — each player card fills the full container width, scroll right to see more players.
Summary of ChangesHello @mholzi, 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 addresses a UI display issue where result cards were incorrectly stacked vertically. The changes transform the card presentation into a horizontal, scrollable carousel, allowing users to view one card at a time and scroll to see additional content. This aligns the component with the intended design for improved user experience. Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly changes the result cards from a vertical stack to a horizontal carousel. The CSS changes use flexbox to lay out the cards in a row and ensure each card takes up the full width of the container, with horizontal scrolling enabled. My feedback includes suggestions to implement CSS scroll snapping for a more polished carousel experience, which will make the cards snap into place when scrolling, and a minor code cleanup to remove a redundant CSS property.
| .results-cards-scroll { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: var(--space-sm); | ||
| flex-direction: row; | ||
| overflow-x: auto; | ||
| width: 100%; | ||
| } |
There was a problem hiding this comment.
To improve the carousel experience, consider adding scroll-snap-type. This will make the scroll container snap to the cards, ensuring one card is always neatly in view after scrolling. It provides a more polished feel than free scrolling.
.results-cards-scroll {
display: flex;
flex-direction: row;
overflow-x: auto;
width: 100%;
scroll-snap-type: x mandatory;
}| flex: 0 0 100%; | ||
| width: 100%; |
There was a problem hiding this comment.
To complement the scroll snapping on the container, you should add scroll-snap-align: start; to the card. This tells the browser where to align the card within the scroll container.
Also, the width: 100% is redundant because flex: 0 0 100% already sets the flex-basis to 100%, which effectively controls the width in a horizontal flex container. You can safely remove it.
flex: 0 0 100%;
scroll-snap-align: start;
Problem
PR #211 stacked cards vertically (one per row). This was incorrect.
Correct Design (per Markus)
A horizontal carousel/slider:
CSS Changes
.results-cards-scrollflex-directioncolumnrow.results-cards-scrolloverflow-xauto.results-cards-scrollgapvar(--space-sm).result-cardflex0 0 100%Closes #213