Skip to content

Polish mobile carousel: reset animations on swipe, improve arrows, distinct bg#5

Merged
kushal238 merged 2 commits into
mainfrom
feat/pr-screenshots
Feb 8, 2026
Merged

Polish mobile carousel: reset animations on swipe, improve arrows, distinct bg#5
kushal238 merged 2 commits into
mainfrom
feat/pr-screenshots

Conversation

@kushal238

Copy link
Copy Markdown
Owner
  • Was needed to fix the feature card issue on mobile.

  • Add isActive prop to all 5 demo components so animations reset and replay from the beginning when a slide becomes visible via swipe

  • Make navigation arrows always visible (opacity-30 on edges instead of hidden), larger (w-10 h-10), solid background, stronger shadow

  • Change section background from bg-muted/20 to bg-muted for visual separation from adjacent sections

…stinct bg

- Add isActive prop to all 5 demo components so animations reset and
  replay from the beginning when a slide becomes visible via swipe
- Make navigation arrows always visible (opacity-30 on edges instead of
  hidden), larger (w-10 h-10), solid background, stronger shadow
- Change section background from bg-muted/20 to bg-muted for visual
  separation from adjacent sections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Feb 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ariamed Ready Ready Preview, Comment Feb 8, 2026 7:53am

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @kushal238, 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 significantly refines the user experience of the feature showcase section, particularly on mobile devices. It introduces a dynamic carousel for mobile, ensuring smoother transitions and clearer navigation between features. Additionally, it addresses animation behavior to provide a consistent and engaging presentation of each feature, while also making minor visual and layout improvements for both mobile and desktop views.

Highlights

  • Mobile Carousel Redesign: The mobile feature showcase has been completely revamped from expandable cards to an interactive, swipeable carousel, enhancing user experience on smaller screens.
  • Animation Reset on Swipe: All five demo components now correctly reset and replay their animations from the beginning when a new slide becomes visible via a swipe, thanks to a new isActive prop.
  • Improved Carousel Navigation: Navigation arrows for the mobile carousel are now always visible (with reduced opacity at edges), larger, have a solid background, and stronger shadow. Progress dots have also been added for direct slide access.
  • Visual Separation: The main section background has been updated from bg-muted/20 to bg-muted to provide better visual separation from adjacent sections.
  • Desktop Layout Adjustment: The desktop layout for the feature showcase has been reordered, placing the feature description on the left and the interactive demo component on the right.

🧠 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
  • src/components/FeatureShowcase.tsx
    • Added ChevronLeft and ChevronRight imports from lucide-react.
    • Modified all five demo components (SmartDictationDemo, SmartMedicationSearchDemo, AggregatedHistoryDemo, ComplaintBasedDiagnosisDemo, PatientRAGChatbotDemo) to accept compact and isActive props.
    • Implemented logic within each demo component's useEffect to reset its state when isActive is false, ensuring animations restart correctly when a slide is no longer active.
    • Adjusted styling and conditional rendering in demo components based on the compact prop for mobile optimization, including padding and hiding header sections.
    • Removed previous mobile state management (expandedMobile, isTransitioning, mobileCardRefs) and associated click handling logic.
    • Introduced new mobile carousel state (mobileActive, carouselRef) and associated handleCarouselScroll and scrollToSlide functions.
    • Replaced the mobile expandable card layout with a swipeable carousel, incorporating dynamic feature info, navigation arrows, and progress indicators.
    • Updated the main section's background from bg-muted/20 to bg-muted for improved visual contrast.
    • Reordered desktop layout elements, moving the feature description to the left (order-2) and the demo component to the right (order-1).
    • Added whitespace-nowrap utility class to desktop tab buttons to prevent text wrapping.
Activity
  • The author kushal238 created this pull request to address a feature card issue on mobile and enhance the overall presentation.
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.

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

Copy link
Copy Markdown

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 significantly improves the mobile user experience by replacing the expandable cards with a swipeable carousel for the feature showcase. The changes include resetting animations on swipe using an isActive prop, enhancing the navigation arrows, and adjusting the background for better visual distinction. The implementation is solid, and my feedback focuses on further polishing the code for better maintainability, readability, and accessibility. I've suggested creating a reusable type for component props, simplifying some logic and markup, improving button accessibility, and adhering more closely to common React patterns for rendering components.

Comment on lines +1227 to +1235
<button
key={index}
onClick={() => scrollToSlide(index)}
className={`rounded-full transition-all duration-300 ${
mobileActive === index
? "w-6 h-2.5 bg-primary"
: "w-2.5 h-2.5 bg-border hover:bg-muted-foreground/50"
}`}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

These buttons are missing type="button" and an accessible name. For accessibility, buttons without visible text should have an aria-label to describe their purpose to screen reader users. Also, adding type="button" is a good practice to prevent unintended form submissions.

Example:

<button
  type="button"
  key={index}
  onClick={() => scrollToSlide(index)}
  aria-label={`Go to slide ${index + 1}`}
  // ... className
/>

Comment thread src/components/FeatureShowcase.tsx Outdated

// Smart Dictation Demo Component
const SmartDictationDemo = () => {
const SmartDictationDemo = ({ compact, isActive }: { compact?: boolean; isActive?: boolean }) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The props type { compact?: boolean; isActive?: boolean } is repeated across all five demo components (e.g., SmartDictationDemo, SmartMedicationSearchDemo, etc.) and in the Feature interface (line 1021). To improve reusability and maintainability, consider defining a shared type alias:

type DemoComponentProps = { compact?: boolean; isActive?: boolean };

You can then use this type in all component signatures, for example:
const SmartDictationDemo = ({ compact, isActive }: DemoComponentProps) => { ... }

And in the Feature interface:
component: React.ComponentType<DemoComponentProps>;

"Patient complains of fever and headache for 3 days. Prescribing Paracetamol 500mg and Cetirizine 10mg for symptom relief.";

useEffect(() => {
if (isActive === false) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For conciseness and idiomatic code, you can use the logical NOT operator ! to check for a false value. This pattern is repeated in the useEffect hooks of the other demo components as well.

Suggested change
if (isActive === false) {
if (!isActive) {


{compact ? (
<div className="flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground">
<span><span className="font-medium text-foreground">Hypertension</span></span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The outer <span> element appears to be unnecessary here as it doesn't have any attributes and only wraps another <span>. You can remove it for cleaner markup.

Suggested change
<span><span className="font-medium text-foreground">Hypertension</span></span>
<span className="font-medium text-foreground">Hypertension</span>

Comment on lines +1168 to +1171
{(() => {
const IconComp = features[mobileActive].icon;
return <IconComp className="w-5 h-5 text-white" />;
})()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

While this IIFE (Immediately Invoked Function Expression) works for rendering a dynamic component, a more conventional and readable approach in React is to define the component in a variable before the return statement. This pattern is also used on line 1327.

For example:

const IconComp = features[mobileActive].icon;
// ... in JSX
<div ...>
  <IconComp className="w-5 h-5 text-white" />
</div>

Comment on lines +1204 to +1212
<button
onClick={() => scrollToSlide(mobileActive - 1)}
className={`absolute left-2 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-background flex items-center justify-center border border-border shadow-md z-10 ${
mobileActive === 0 ? "opacity-30 pointer-events-none" : ""
}`}
aria-label="Previous feature"
>
<ChevronLeft className="w-5 h-5 text-foreground" />
</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

It's a good practice to add type="button" to buttons to prevent them from submitting a form if they happen to be rendered inside one. This also applies to the 'Next feature' button.

Comment on lines +1327 to +1330
{(() => {
const DemoComponent = features[activeFeature].component;
return <DemoComponent />;
})()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This IIFE (Immediately Invoked Function Expression) can be simplified. A more conventional approach in React is to assign the component to a variable before the return statement and then render it. This improves readability.

For example:

const DemoComponent = features[activeFeature].component;
// ... in your JSX ...
<DemoComponent />

Since ActiveDemoComponent was removed earlier, you can re-introduce it or a similar variable before the main return statement of FeatureShowcase.

- Simulate press (scale 0.95) on prescription card before expanding
- Change carousel slide from overflow-hidden to overflow-y-auto so
  tall content doesn't clip at the top
- Extract shared DemoComponentProps type for all 5 demo components
- Add type="button" and aria-label to progress dot buttons (a11y)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kushal238

Copy link
Copy Markdown
Owner Author

/gemini review

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

Copy link
Copy Markdown

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 refactors the FeatureShowcase component, primarily by replacing the mobile expandable card layout with an Instagram-style swipeable carousel. This involved introducing compact and isActive props to all individual demo components (SmartDictationDemo, SmartMedicationSearchDemo, AggregatedHistoryDemo, ComplaintBasedDiagnosisDemo, PatientRAGChatbotDemo) to enable state resetting when inactive and to adjust their styling for the new compact mobile view. The desktop layout was also updated to reorder the demo component and feature description. Review comments suggest improving boolean checks to !isActive for conciseness and refactoring verbose Immediately Invoked Function Expressions (IIFEs) used for rendering icon components into a more idiomatic React pattern.

Comment on lines +35 to +39
if (isActive === false) {
setText("");
setHighlights([]);
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For boolean checks, it's more idiomatic in JavaScript/TypeScript to use the negation operator !. This makes the code slightly more concise and is a common convention. This feedback applies to the other similar checks in this file.

Suggested change
if (isActive === false) {
setText("");
setHighlights([]);
return;
}
if (!isActive) {
setText("");
setHighlights([]);
return;
}

Comment on lines +1180 to +1183
{(() => {
const IconComp = features[mobileActive].icon;
return <IconComp className="w-5 h-5 text-white" />;
})()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This IIFE (Immediately Invoked Function Expression) to render the icon component is a bit verbose and not a common pattern in React. For better readability, you could destructure icon into a PascalCased variable (e.g., const { icon: Icon } = features[mobileActive]) before this block and then use <Icon ... /> directly. This would make the JSX cleaner. This pattern is used in a few other places in this file (e.g., lines 1314, 1341) and could be refactored for consistency.

@kushal238
kushal238 merged commit 07f34c6 into main Feb 8, 2026
3 checks passed
@kushal238
kushal238 deleted the feat/pr-screenshots branch February 8, 2026 20:36
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.

1 participant