Skip to content

fix: Gallery Features overflow and hover delay#14

Open
VasuS609 wants to merge 1 commit intoAOSSIE-Org:mainfrom
VasuS609:fix-gallery-feature-cards
Open

fix: Gallery Features overflow and hover delay#14
VasuS609 wants to merge 1 commit intoAOSSIE-Org:mainfrom
VasuS609:fix-gallery-feature-cards

Conversation

@VasuS609
Copy link

@VasuS609 VasuS609 commented Mar 2, 2026

Fixes: #13

Small UX polish focused on the How It Works gallery section: quicker hover response, cleaner text behavior, and more stable responsive layout.

Screen.Recording.2026-03-03.034239.mp4

Small UX polish focused on the How It Works gallery section: quicker hover response, cleaner text behavior, and more stable responsive layout.

Changes (Very Brief)

  • Adjusted card grid breakpoints for better responsive fit.
  • Reduced hover activation delay from 1000ms to 200ms.
  • Added overflow handling to expanded detail content.

Scope is intentionally minimal: 1 file updated, 5 insertions / 5 deletions.
File: [HowItWorks.tsx]

Checklist

Summary by CodeRabbit

  • New Features
    • Redesigned responsive layout for "How It Works" page with better column organization across all device sizes, from tablets to large displays.
    • Faster, more responsive hover interactions when exploring workflow steps.
    • Improved text wrapping and content overflow management for better display of longer content descriptions.

@github-actions github-actions bot added bug Something isn't working frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/XS Extra small PR (≤10 lines changed) first-time-contributor First PR of an external contributor pending-coderabbit-review labels Mar 2, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Walkthrough

Optimized the HowItWorks gallery component's responsive grid layout with enhanced breakpoint coverage (xl, 2xl), reduced hover delay from 1000ms to 200ms for improved UX, and added overflow containment with text wrapping to prevent content spillover in feature cards.

Changes

Cohort / File(s) Summary
HowItWorks Component Updates
src/Pages/HowItWorks/HowItWorks.tsx
Enhanced grid responsiveness with additional breakpoints and column adjustments; optimized hover interaction timing (1000ms → 200ms); improved onMouseLeave handler with timer cleanup and deactivation logic; added overflow constraints and break-words text handling to prevent content overflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

Typescript Lang

Poem

🐰 A hop, a skip, a hover so quick,
Gallery cards no longer overflow—a fix!
Responsive columns dance with grace,
200ms keeps the perfect pace,
No more spillage, just pure delight,
The Feature Cards now shine so bright!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main fixes: gallery feature overflow prevention and hover delay reduction from 1000ms to 200ms.
Linked Issues check ✅ Passed All three primary objectives from issue #13 are addressed: overflow prevention via overflow-hidden, grid layout adjustments at lg/xl/2xl breakpoints, and hover delay reduced from 1000ms to 200ms.
Out of Scope Changes check ✅ Passed All changes in HowItWorks.tsx are directly scoped to fixing the reported overflow and hover delay issues; no unrelated modifications were introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Pages/HowItWorks/HowItWorks.tsx (1)

57-72: ⚠️ Potential issue | 🟠 Major

Add cleanup for pending hover timers on component unmount.

Timers scheduled in onMouseEnter (line 59) lack unmount cleanup. A pending timeout can call setActiveStep after the component unmounts, causing stale state update warnings. Add a useEffect cleanup to clear all pending timers:

Fix
-import { useState, useRef } from "react";
+import { useState, useRef, useEffect } from "react";
@@
   const [activeStep, setActiveStep] = useState<number | null>(null);
   const hoverTimers = useRef<Record<number, number | null>>({});
+
+  useEffect(() => {
+    return () => {
+      Object.values(hoverTimers.current).forEach((t) => {
+        if (t != null) clearTimeout(t);
+      });
+    };
+  }, []);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Pages/HowItWorks/HowItWorks.tsx` around lines 57 - 72, Add an unmount
cleanup that clears any pending hover timeouts stored in hoverTimers to prevent
setActiveStep being called after the component unmounts: create a useEffect in
the component (referencing hoverTimers and setActiveStep/activeStep) that
returns a cleanup function which iterates hoverTimers.current, calls
clearTimeout for any non-null timer, and sets those entries to null; this
ensures all pending timers set in the onMouseEnter handler are cancelled on
unmount.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/Pages/HowItWorks/HowItWorks.tsx`:
- Around line 57-72: Add an unmount cleanup that clears any pending hover
timeouts stored in hoverTimers to prevent setActiveStep being called after the
component unmounts: create a useEffect in the component (referencing hoverTimers
and setActiveStep/activeStep) that returns a cleanup function which iterates
hoverTimers.current, calls clearTimeout for any non-null timer, and sets those
entries to null; this ensures all pending timers set in the onMouseEnter handler
are cancelled on unmount.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1496367 and a3ba150.

📒 Files selected for processing (1)
  • src/Pages/HowItWorks/HowItWorks.tsx

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

Labels

bug Something isn't working first-time-contributor First PR of an external contributor frontend Changes to frontend code javascript JavaScript/TypeScript code changes pending-coderabbit-review size/XS Extra small PR (≤10 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Gallery Features Cards Overflow and Time Delay

1 participant