Skip to content

Conversation

@cloudsamrajya
Copy link
Contributor

@cloudsamrajya cloudsamrajya commented Oct 26, 2025

Issue Reference

Closes #50


What Was Changed

  • gap between the integration,
  • Display top 4 integration by default on Mobile screen
  • Added Viewmore and viewless button for Mobile screen

Screenshots

VID_20251026_062001.1.mp4

Summary by CodeRabbit

  • New Features

    • Integrations section is mobile-responsive, showing 4 items by default with a "View more / View less" toggle to expand/collapse the full list.
    • Integration cards now surface icons, refined title/description layout, and a styled "Learn More" link with an external-link indicator.
  • Style

    • Minor spacing and visual refinements for section headers and card presentation.

@vercel
Copy link

vercel bot commented Oct 26, 2025

@cloudsamrajya is attempting to deploy a commit to the idan lodzki's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

Walkthrough

Implemented mobile-responsive behavior in the IntegrationsSection: detect mobile viewport, show only the first four integrations by default on small screens, and add a "View more"/"View less" toggle to expand/collapse the full list; updated integration card rendering and link styling.

Changes

Cohort / File(s) Summary
Mobile-responsive integrations section
components/IntegrationsSection.tsx
Added isMobile and showAll state with resize effect; slice integrations to first 4 on mobile unless expanded; replaced direct mapping with items array; added mobile "View more"/"View less" toggle; adjusted integration card markup to use integration.icon, title/description structure, and updated Learn More link with ExternalLink indicator; minor formatting/SVG tweaks.

Assessment against linked issues

Objective Addressed Explanation
Display only a few integrations by default (e.g., top 4–6) [#50]
Add a "Show more" or "View all" button to expand the full list [#50]
Reduce spacing between cards and optimize image sizes [#50] Summary notes formatting tweaks but code changes do not explicitly show spacing or image-size adjustments.
Optional horizontal scroll or carousel layout [#50] Implementation uses expand/collapse rather than horizontal scroll/carousel, which was optional.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added ExternalLink indicator and styling in Learn More link (components/IntegrationsSection.tsx) This styling/UI enhancement is not part of the stated objectives in issue #50 and does not affect the mobile compacting requirements.

Suggested labels

hacktoberfest, hacktoberfest-accepted


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a5049a and b0d0e50.

📒 Files selected for processing (1)
  • components/IntegrationsSection.tsx (4 hunks)
🔇 Additional comments (3)
components/IntegrationsSection.tsx (3)

1-9: LGTM!

The imports are appropriate for the mobile-responsive functionality being implemented.


259-259: LGTM!

The slicing logic correctly implements the requirement to display only the first 4 integrations on mobile by default, while showing all items on desktop or when "View more" is clicked.


314-323: Good implementation of the View more/less button!

The button is now correctly positioned outside the grid and includes proper accessibility attributes (aria-expanded and aria-controls). The conditional rendering ensures it only appears on mobile when there are more than 4 integrations.

Note: The aria-controls attribute references integrations-grid, so ensure the grid has this id (as flagged in a separate comment).


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

@github-actions
Copy link

Thanks for your contribution! Join our Slack: https://join.slack.com/t/opsimate/shared_invite/zt-39bq3x6et-NrVCZzH7xuBGIXmOjJM7gA Please make sure to include an image with your PR — it really helps us review and understand the changes better. Only in rare cases will we accept a PR without one. Also, take a moment to review your code to ensure it’s clear, readable, and easy to follow. PRs from contributors who haven’t joined our Slack community or starred the repository won’t be reviewed — we’d love to see you join and be part of the project!

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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
components/IntegrationsSection.tsx (1)

291-291: Remove unnecessary blank lines.

Extra blank lines at lines 291, 297, and 301 create inconsistent spacing. Consider removing them for cleaner formatting.

Also applies to: 297-297, 301-301

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53deb1f and 1a5049a.

📒 Files selected for processing (1)
  • components/IntegrationsSection.tsx (4 hunks)
🔇 Additional comments (4)
components/IntegrationsSection.tsx (4)

1-9: LGTM!

The imports are appropriate for the new mobile optimization functionality.


242-245: Verify unrelated SVG path modification.

The Systemd icon's SVG path was modified, but this change appears unrelated to the mobile optimization feature. Please confirm this modification is intentional.


259-259: LGTM!

The conditional rendering logic correctly displays the first 4 integrations on mobile by default and all integrations when showAll is toggled or on desktop.

Also applies to: 282-282


281-281: LGTM!

The responsive gap adjustment (gap-3 md:gap-6) correctly reduces spacing on mobile as per the PR objectives.

Comment on lines +12 to +20
const [isMobile, setIsMobile] = useState(false);
const [showAll, setShowAll] = useState(false);

useEffect(() => {
const checkScreen = () => setIsMobile(window.innerWidth < 768);
checkScreen();
window.addEventListener("resize", checkScreen);
return () => window.removeEventListener("resize", checkScreen);
}, []);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Address SSR hydration mismatch and optimize resize handler.

Two issues to address:

  1. SSR Hydration Mismatch: Initializing isMobile as false can cause a hydration mismatch in SSR environments (Next.js). The server renders the desktop view, but if the client is mobile, it flashes desktop content before switching to mobile.

  2. Performance: The resize listener fires on every pixel change, causing unnecessary re-renders even when the viewport doesn't cross the 768px threshold.

Apply this diff to fix both issues:

-  const [isMobile, setIsMobile] = useState(false);
+  const [isMobile, setIsMobile] = useState(() => {
+    if (typeof window !== 'undefined') {
+      return window.innerWidth < 768;
+    }
+    return false;
+  });
   const [showAll, setShowAll] = useState(false);

   useEffect(() => {
-    const checkScreen = () => setIsMobile(window.innerWidth < 768);
+    const checkScreen = () => {
+      const mobile = window.innerWidth < 768;
+      setIsMobile(prev => prev !== mobile ? mobile : prev);
+    };
     checkScreen();
     window.addEventListener("resize", checkScreen);
     return () => window.removeEventListener("resize", checkScreen);
   }, []);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [isMobile, setIsMobile] = useState(false);
const [showAll, setShowAll] = useState(false);
useEffect(() => {
const checkScreen = () => setIsMobile(window.innerWidth < 768);
checkScreen();
window.addEventListener("resize", checkScreen);
return () => window.removeEventListener("resize", checkScreen);
}, []);
const [isMobile, setIsMobile] = useState(() => {
if (typeof window !== 'undefined') {
return window.innerWidth < 768;
}
return false;
});
const [showAll, setShowAll] = useState(false);
useEffect(() => {
const checkScreen = () => {
const mobile = window.innerWidth < 768;
setIsMobile(prev => prev !== mobile ? mobile : prev);
};
checkScreen();
window.addEventListener("resize", checkScreen);
return () => window.removeEventListener("resize", checkScreen);
}, []);

Comment on lines 313 to 320
{isMobile && integrations.length > 4 && (
<button
className="mt-2 text-blue-600 hover:text-blue-700 text-sm font-medium "
onClick={() => setShowAll(!showAll)}
>
{!showAll ? "View more" : "View less"}
</button>
)}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Move button outside grid and add accessibility attributes.

Two issues:

  1. Incorrect Placement: The button is inside the grid, making it render as a grid item. This creates awkward layout where the button appears in a card-like position.

  2. Missing Accessibility: The button lacks aria-expanded to indicate its state to screen readers.

Apply this diff:

-        {/* Integrations Grid */}
-        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 mb-16">
+        {/* Integrations Grid */}
+        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6">
           {items.map((integration, index) => (
             <div
               key={index}
               className="bg-surface-50 dark:bg-surface-800 border border-surface-200 dark:border-surface-700 rounded-xl p-6 hover:shadow-lg dark:hover:shadow-white/10 hover:border-blue-200 dark:hover:border-gray-300 transition-all duration-300 group"
             >
               {/* Integration Icon */}
               <div className="w-12 h-12 bg-surface-200 dark:bg-surface-700 rounded-lg mb-4 flex items-center justify-center group-hover:bg-blue-50 dark:group-hover:bg-gray-600 transition-colors duration-300">
                 {integration.icon}
               </div>

               <div className="mb-2 ">
                 <h3 className="font-semibold text-surface-900 dark:text-surface-100">
                   {integration.name}
                 </h3>
               </div>

               <div className="text-surface-600 dark:text-surface-400 text-sm mb-4 leading-relaxed ">
                 {integration.description}
               </div>

               <a
                 href={integration.link}
                 target="_blank"
                 rel="noopener noreferrer"
                 className="text-blue-600 hover:text-blue-700 text-sm font-medium flex items-center gap-1 transition-colors duration-200"
               >
                 Learn More
                 <ExternalLink className="h-3 w-3" />
               </a>
             </div>
           ))}
-          {isMobile && integrations.length > 4 && (
+        </div>
+
+        {/* View More/Less Button */}
+        {isMobile && integrations.length > 4 && (
+          <div className="text-center mt-6 mb-16">
             <button
-              className="mt-2 text-blue-600 hover:text-blue-700 text-sm font-medium  "
+              className="text-blue-600 hover:text-blue-700 text-sm font-medium"
               onClick={() => setShowAll(!showAll)}
+              aria-expanded={showAll}
+              aria-controls="integrations-grid"
             >
               {!showAll ? "View more" : "View less"}
             </button>
-          )}
-        </div>
+          </div>
+        )}
       </div>
     </section>

Also add an id to the grid:

-        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6">
+        <div id="integrations-grid" className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6">

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In components/IntegrationsSection.tsx around lines 313 to 320, the "View
more/View less" button is currently rendered inside the grid (making it a grid
item) and lacks accessibility attributes; move the button markup so it sits
immediately after the grid container (outside the element that has the grid
classes) so it no longer becomes a grid child, add an id attribute to the grid
container (e.g., id="integrations-grid") and update the button to include
aria-expanded={showAll} and aria-controls="integrations-grid" to reflect and
link its state for screen readers.

@yjrathod
Copy link
Contributor

Hey @cloudsamrajya, thanks for your contribution! I noticed two potential issues:

  1. Move the button outside the grid and add accessibility attributes
  2. Address SSR hydration mismatch and optimize the resize handler

Please try to resolve them following the guidance provided by CodeRabbit's review.

Copy link
Contributor

@yjrathod yjrathod left a comment

Choose a reason for hiding this comment

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

These two suggested changes are needed, Initialize state properly so mobile users don't see a flash of desktop content, Optimize the resize handler properly!

@idanlodzki idanlodzki closed this Oct 29, 2025
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.

[Feature] Optimize “Integrations” Section for Mobile View

3 participants