From c4901bceccb29521ca8ea1bdc88f8dc8b6d097e2 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Thu, 1 Oct 2026 23:34:13 +0530 Subject: [PATCH 01/10] fix(integrations): support dark mode whiteIcon and standardize component card styling - Map and select whiteIcon under dark mode with fallback to colorIcon or integrationIcon - Reactively update component icons on dark/light theme switch using useStyledDarkMode - Standardize fixed 48x48 icon wrapper and consistent card min-height across items - Fix unclosed styled component selector and undefined item key in list rendering Closes #8146 Signed-off-by: tejaswiverma --- .../Component.style.js | 39 +++++--- .../Individual-Integrations/ComponentsGrid.js | 91 +++++++++++++------ 2 files changed, 86 insertions(+), 44 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js index c63a6ce3e05c99..582b9e4ce49b9d 100755 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js @@ -12,15 +12,6 @@ export const ComponentsWrapper = styled.div` font-weight: normal; } } - .componentimg { - width: 80px; - height: 80px; - } - .componentimg img { - width: 100%; - height: 100%; - object-fit: contain; - } .componentsSection { display: flex; @@ -29,24 +20,42 @@ export const ComponentsWrapper = styled.div` padding: 3rem 2rem 5rem 2rem; justify-content: center; } + + .componentimg { + width: 48px; + height: 48px; + min-width: 48px; + display: grid; + place-items: center; + border-radius: 12px; + background: rgba(255, 255, 255, 0.04); + } + + .componentimg img { + width: 100%; + height: 100%; + object-fit: contain; + display: block; + } + .maincontainer { display: flex; align-items: center; gap: 1rem; background-color: ${(props) => props.theme.grey212121ToGreyEEEEEE}; - padding: 0.5rem 1rem; + padding: 0.75rem 1rem; border-radius: 0.85rem; width: 100%; flex: 30%; max-width: 350px; + min-height: 72px; } .items { - border-radius: 0.625rem; - text-transform: uppercase; + margin: 0; color: ${(props) => props.theme.text}; font-size: 0.875rem; - transition: all .1s ease-in-out; - line-height: 1.1875rem; - width: 100%; + line-height: 1.2; + text-transform: uppercase; + } `; diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index e1bf17205dbe86..f8fc6a82a0e7fc 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -1,56 +1,89 @@ import React, { useEffect, useState } from "react"; import { ComponentsWrapper } from "./Component.style"; import { checkImageUrlValidity } from "../../../../utils/imageValidate"; +import { useStyledDarkMode } from "../../../../theme/app/useStyledDarkMode"; + +const getPreferredIcon = (component, isDarkActive) => { + const preferred = isDarkActive ? component.whiteIcon : component.colorIcon; + return ( + preferred?.publicURL || + component.colorIcon?.publicURL || + component.whiteIcon?.publicURL || + "" + ); +}; const ComponentsGrid = ({ frontmatter }) => { - const components = frontmatter.components.map((component) => { - const { name, colorIcon } = component; // currently we don't have description for components - return { name, colorIcon }; - }); + const { isDark } = useStyledDarkMode(); + + const prefersDark = + typeof window !== "undefined" && + window.matchMedia && + window.matchMedia("(prefers-color-scheme: dark)").matches; + + const darkModeActive = + typeof isDark === "boolean" ? isDark : Boolean(prefersDark); + + const components = (frontmatter?.components || []).map((component) => ({ + ...component, + preferredIcon: getPreferredIcon(component, darkModeActive), + })); + const [validComponents, setValidComponents] = useState([]); + useEffect(() => { - const fetchData = async () => { - const promises = components.map(async (item) => { - const isSvgPathValid = await checkImageUrlValidity( - item.colorIcon.publicURL - ); - if (isSvgPathValid) { + let mounted = true; + + const loadIcons = async () => { + const validItems = await Promise.all( + components.map(async (item) => { + const iconUrl = item.preferredIcon || item.colorIcon?.publicURL; + if (!iconUrl) return null; + + const isValid = await checkImageUrlValidity(iconUrl); + if (!isValid) { + const fallbackIcon = + (iconUrl !== item.colorIcon?.publicURL && + item.colorIcon?.publicURL) || + frontmatter?.integrationIcon?.publicURL || + ""; + + return { + ...item, + preferredIcon: fallbackIcon, + }; + } + return item; - } else { - item.colorIcon.publicURL = frontmatter.integrationIcon.publicURL; - return item; // Return fallback image - } - }); - - const validItems = await Promise.all(promises); - // Filter out null values (items that are not valid) - const filteredValidComponents = validItems.filter( - (item) => item !== null + }), ); - setValidComponents(filteredValidComponents); + if (mounted) { + setValidComponents(validItems.filter(Boolean)); + } }; - fetchData(); - }, []); + loadIcons(); + return () => { + mounted = false; + }; + }, [frontmatter, darkModeActive]); return (

- {frontmatter.title} Components ({components.length}) + {frontmatter?.title} Components ({components.length})

{validComponents.map((item) => ( -
+
- {item.name} + {item.name}
-

{item.name.replaceAll("-", " ")}

- {/*
-
*/} +

{item.name?.replaceAll("-", " ") || ""}

))}
From 66a1879f16a777c021d31967243af5d6f056a1aa Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 11:53:25 +0530 Subject: [PATCH 02/10] fix(integrations): circular icon badges, expand card size, and align light mode SVG Signed-off-by: tejaswiverma --- .../icons/color/node-feature-group-color.svg | 5 +---- .../Individual-Integrations/Component.style.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg b/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg index b89948f134f25a..cf727a91a137fa 100644 --- a/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg +++ b/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg @@ -1,4 +1 @@ - - - - + diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js index 582b9e4ce49b9d..98d3542c16cbe4 100755 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/Component.style.js @@ -27,8 +27,9 @@ export const ComponentsWrapper = styled.div` min-width: 48px; display: grid; place-items: center; - border-radius: 12px; - background: rgba(255, 255, 255, 0.04); + border-radius: 50%; + background-color: ${(props) => props.theme.blackToWhite}; + padding: 8px; } .componentimg img { @@ -43,11 +44,11 @@ export const ComponentsWrapper = styled.div` align-items: center; gap: 1rem; background-color: ${(props) => props.theme.grey212121ToGreyEEEEEE}; - padding: 0.75rem 1rem; + padding: 0.85rem 1.25rem; border-radius: 0.85rem; width: 100%; - flex: 30%; - max-width: 350px; + flex: 1 1 360px; + max-width: 400px; min-height: 72px; } @@ -55,7 +56,8 @@ export const ComponentsWrapper = styled.div` margin: 0; color: ${(props) => props.theme.text}; font-size: 0.875rem; - line-height: 1.2; + line-height: 1.25; text-transform: uppercase; + word-break: break-word; } `; From 334737d049f2d5e0664601a56660973160c90c1d Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 12:16:48 +0530 Subject: [PATCH 03/10] fix(integrations): improve icon fallback robustness, initial render, and theme detection Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index f8fc6a82a0e7fc..9bfdf73a73e0e4 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -3,58 +3,64 @@ import { ComponentsWrapper } from "./Component.style"; import { checkImageUrlValidity } from "../../../../utils/imageValidate"; import { useStyledDarkMode } from "../../../../theme/app/useStyledDarkMode"; -const getPreferredIcon = (component, isDarkActive) => { - const preferred = isDarkActive ? component.whiteIcon : component.colorIcon; +const getFallbackIcon = (frontmatter) => + frontmatter?.integrationIcon?.publicURL || + frontmatter?.integrationIcon_svg?.publicURL || + frontmatter?.darkModeIntegrationIcon?.publicURL || + ""; + +const getPreferredIcon = (component, isDarkActive, fallbackIcon) => { + const preferred = isDarkActive ? component?.whiteIcon : component?.colorIcon; return ( preferred?.publicURL || - component.colorIcon?.publicURL || - component.whiteIcon?.publicURL || + component?.colorIcon?.publicURL || + component?.whiteIcon?.publicURL || + fallbackIcon || "" ); }; const ComponentsGrid = ({ frontmatter }) => { const { isDark } = useStyledDarkMode(); + const darkModeActive = Boolean(isDark); + const fallbackIcon = getFallbackIcon(frontmatter); + + const candidateComponents = (frontmatter?.components || []).map( + (component) => ({ + ...component, + preferredIcon: getPreferredIcon(component, darkModeActive, fallbackIcon), + }), + ); - const prefersDark = - typeof window !== "undefined" && - window.matchMedia && - window.matchMedia("(prefers-color-scheme: dark)").matches; - - const darkModeActive = - typeof isDark === "boolean" ? isDark : Boolean(prefersDark); - - const components = (frontmatter?.components || []).map((component) => ({ - ...component, - preferredIcon: getPreferredIcon(component, darkModeActive), - })); - - const [validComponents, setValidComponents] = useState([]); + const [validComponents, setValidComponents] = useState(candidateComponents); useEffect(() => { let mounted = true; const loadIcons = async () => { const validItems = await Promise.all( - components.map(async (item) => { - const iconUrl = item.preferredIcon || item.colorIcon?.publicURL; + candidateComponents.map(async (item) => { + const iconUrl = item.preferredIcon || fallbackIcon; if (!iconUrl) return null; const isValid = await checkImageUrlValidity(iconUrl); if (!isValid) { - const fallbackIcon = - (iconUrl !== item.colorIcon?.publicURL && - item.colorIcon?.publicURL) || - frontmatter?.integrationIcon?.publicURL || - ""; - - return { - ...item, - preferredIcon: fallbackIcon, - }; + if (iconUrl !== fallbackIcon && fallbackIcon) { + const isFallbackValid = await checkImageUrlValidity(fallbackIcon); + if (isFallbackValid) { + return { + ...item, + preferredIcon: fallbackIcon, + }; + } + } + return null; } - return item; + return { + ...item, + preferredIcon: iconUrl, + }; }), ); @@ -73,7 +79,7 @@ const ComponentsGrid = ({ frontmatter }) => {

- {frontmatter?.title} Components ({components.length}) + {frontmatter?.title} Components ({candidateComponents.length})

@@ -81,7 +87,9 @@ const ComponentsGrid = ({ frontmatter }) => { {validComponents.map((item) => (
- {item.name} + {item.preferredIcon && ( + {item.name + )}

{item.name?.replaceAll("-", " ") || ""}

From 9bd650d15e9175ec91e32276ef78ea13787f3ff6 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 12:34:56 +0530 Subject: [PATCH 04/10] fix(integrations): use unique key with index in component grid Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index 9bfdf73a73e0e4..df06986b5439e3 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -84,8 +84,8 @@ const ComponentsGrid = ({ frontmatter }) => {
- {validComponents.map((item) => ( -
+ {validComponents.map((item, index) => ( +
{item.preferredIcon && ( {item.name From bead3ba0dae8b0b02bcc36b5c81cf30f8729dc7c Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 17:19:51 +0530 Subject: [PATCH 05/10] fix(integrations): make component icon fallback theme-aware Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 26 ++++++++--- src/templates/integrations.js | 46 +++++++++++-------- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index df06986b5439e3..3b1c166f2e9cdd 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -3,11 +3,23 @@ import { ComponentsWrapper } from "./Component.style"; import { checkImageUrlValidity } from "../../../../utils/imageValidate"; import { useStyledDarkMode } from "../../../../theme/app/useStyledDarkMode"; -const getFallbackIcon = (frontmatter) => - frontmatter?.integrationIcon?.publicURL || - frontmatter?.integrationIcon_svg?.publicURL || - frontmatter?.darkModeIntegrationIcon?.publicURL || - ""; +const getFallbackIcon = (frontmatter, isDarkActive) => { + if (isDarkActive) { + return ( + frontmatter?.darkModeIntegrationIcon?.publicURL || + frontmatter?.integrationIcon?.publicURL || + frontmatter?.integrationIcon_svg?.publicURL || + "" + ); + } + + return ( + frontmatter?.integrationIcon?.publicURL || + frontmatter?.integrationIcon_svg?.publicURL || + frontmatter?.darkModeIntegrationIcon?.publicURL || + "" + ); +}; const getPreferredIcon = (component, isDarkActive, fallbackIcon) => { const preferred = isDarkActive ? component?.whiteIcon : component?.colorIcon; @@ -23,7 +35,7 @@ const getPreferredIcon = (component, isDarkActive, fallbackIcon) => { const ComponentsGrid = ({ frontmatter }) => { const { isDark } = useStyledDarkMode(); const darkModeActive = Boolean(isDark); - const fallbackIcon = getFallbackIcon(frontmatter); + const fallbackIcon = getFallbackIcon(frontmatter, darkModeActive); const candidateComponents = (frontmatter?.components || []).map( (component) => ({ @@ -73,7 +85,7 @@ const ComponentsGrid = ({ frontmatter }) => { return () => { mounted = false; }; - }, [frontmatter, darkModeActive]); + }, [frontmatter, darkModeActive, fallbackIcon]); return ( diff --git a/src/templates/integrations.js b/src/templates/integrations.js index e719aa3ecb84fd..bfa69b6abe68f4 100644 --- a/src/templates/integrations.js +++ b/src/templates/integrations.js @@ -1,9 +1,6 @@ import React from "react"; import { graphql } from "gatsby"; - - import SEO from "../components/seo"; - import IndividualIntegrations from "../sections/Meshery/Meshery-integrations/Individual-Integrations"; const LiteModeNotice = ({ entity }) => ( @@ -20,16 +17,15 @@ const LiteModeNotice = ({ entity }) => ( {`This ${entity} page is skipped when BUILD_FULL_SITE=false to keep local builds fast.`}

- Run make site-full (or set BUILD_FULL_SITE=true) to render the full content. + Run make site-full (or set BUILD_FULL_SITE=true) + to render the full content.

); - export const query = graphql` query IntegrationsBySlug($slug: String!, $name: String!) { - mdx(fields:{slug:{eq: $slug}}) { - + mdx(fields: { slug: { eq: $slug } }) { frontmatter { title subtitle @@ -39,6 +35,10 @@ export const query = graphql` extension publicURL } + darkModeIntegrationIcon { + extension + publicURL + } docURL category components { @@ -64,7 +64,11 @@ export const query = graphql` } } screenshots_raster: allFile( - filter: {relativeDirectory: {eq: $name}, sourceInstanceName: {eq: "integrations"}, extension: {ne: "svg"}} + filter: { + relativeDirectory: { eq: $name } + sourceInstanceName: { eq: "integrations" } + extension: { ne: "svg" } + } ) { nodes { extension @@ -75,7 +79,11 @@ export const query = graphql` } } screenshots_svg: allFile( - filter: {relativeDirectory: {eq: $name}, sourceInstanceName: {eq: "integrations"}, extension: {eq: "svg"}} + filter: { + relativeDirectory: { eq: $name } + sourceInstanceName: { eq: "integrations" } + extension: { eq: "svg" } + } ) { nodes { extension @@ -90,18 +98,10 @@ const Integrations = ({ data, children }) => { return ; } - return ( - <> - - - - {children} - - + {children} - ); }; export default Integrations; @@ -117,5 +117,11 @@ export const Head = ({ data }) => { ); } - return ; -}; \ No newline at end of file + return ( + + ); +}; From f7ac96a49673c56c10c73e641d5f1b3d1aa51ae6 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 17:35:33 +0530 Subject: [PATCH 06/10] fix(integrations): try alternate component icon before integration fallback Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 80 ++++++++++++------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index 3b1c166f2e9cdd..75b111471da672 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -22,14 +22,14 @@ const getFallbackIcon = (frontmatter, isDarkActive) => { }; const getPreferredIcon = (component, isDarkActive, fallbackIcon) => { - const preferred = isDarkActive ? component?.whiteIcon : component?.colorIcon; - return ( - preferred?.publicURL || - component?.colorIcon?.publicURL || - component?.whiteIcon?.publicURL || - fallbackIcon || - "" - ); + const primary = isDarkActive + ? component?.whiteIcon?.publicURL + : component?.colorIcon?.publicURL; + const alternate = isDarkActive + ? component?.colorIcon?.publicURL + : component?.whiteIcon?.publicURL; + + return primary || alternate || fallbackIcon || ""; }; const ComponentsGrid = ({ frontmatter }) => { @@ -50,29 +50,55 @@ const ComponentsGrid = ({ frontmatter }) => { let mounted = true; const loadIcons = async () => { + let isFallbackValid = null; + const checkFallback = async () => { + if (!fallbackIcon) return false; + if (isFallbackValid === null) { + isFallbackValid = await checkImageUrlValidity(fallbackIcon); + } + return isFallbackValid; + }; + const validItems = await Promise.all( candidateComponents.map(async (item) => { - const iconUrl = item.preferredIcon || fallbackIcon; - if (!iconUrl) return null; - - const isValid = await checkImageUrlValidity(iconUrl); - if (!isValid) { - if (iconUrl !== fallbackIcon && fallbackIcon) { - const isFallbackValid = await checkImageUrlValidity(fallbackIcon); - if (isFallbackValid) { - return { - ...item, - preferredIcon: fallbackIcon, - }; - } - } - return null; + const primaryIcon = darkModeActive + ? item.whiteIcon?.publicURL + : item.colorIcon?.publicURL; + const alternateIcon = darkModeActive + ? item.colorIcon?.publicURL + : item.whiteIcon?.publicURL; + + if (primaryIcon && (await checkImageUrlValidity(primaryIcon))) { + return { + ...item, + preferredIcon: primaryIcon, + }; + } + + if ( + alternateIcon && + alternateIcon !== primaryIcon && + (await checkImageUrlValidity(alternateIcon)) + ) { + return { + ...item, + preferredIcon: alternateIcon, + }; + } + + if ( + fallbackIcon && + fallbackIcon !== primaryIcon && + fallbackIcon !== alternateIcon && + (await checkFallback()) + ) { + return { + ...item, + preferredIcon: fallbackIcon, + }; } - return { - ...item, - preferredIcon: iconUrl, - }; + return null; }), ); From c79d1c6278806bfaa7292c14250fddc1604fb046 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Fri, 2 Oct 2026 19:04:53 +0530 Subject: [PATCH 07/10] fix(integrations): initialize component grid as empty until icons validate Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index 75b111471da672..1485be80cd024b 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -44,7 +44,7 @@ const ComponentsGrid = ({ frontmatter }) => { }), ); - const [validComponents, setValidComponents] = useState(candidateComponents); + const [validComponents, setValidComponents] = useState([]); useEffect(() => { let mounted = true; From da49eaf1082eb53eddea11816b58bc07e94af5e3 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Thu, 8 Oct 2026 21:04:58 +0530 Subject: [PATCH 08/10] fix(integrations): prioritize integration fallback icon over alternate component icon Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index 1485be80cd024b..064e5c59e21970 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -29,7 +29,7 @@ const getPreferredIcon = (component, isDarkActive, fallbackIcon) => { ? component?.colorIcon?.publicURL : component?.whiteIcon?.publicURL; - return primary || alternate || fallbackIcon || ""; + return primary || fallbackIcon || alternate || ""; }; const ComponentsGrid = ({ frontmatter }) => { @@ -75,26 +75,28 @@ const ComponentsGrid = ({ frontmatter }) => { }; } + // 1. Fallback to the theme-aware integration icon if ( - alternateIcon && - alternateIcon !== primaryIcon && - (await checkImageUrlValidity(alternateIcon)) + fallbackIcon && + fallbackIcon !== primaryIcon && + (await checkFallback()) ) { return { ...item, - preferredIcon: alternateIcon, + preferredIcon: fallbackIcon, }; } + // 2. Last resort: opposite-theme component icon if ( - fallbackIcon && - fallbackIcon !== primaryIcon && - fallbackIcon !== alternateIcon && - (await checkFallback()) + alternateIcon && + alternateIcon !== primaryIcon && + alternateIcon !== fallbackIcon && + (await checkImageUrlValidity(alternateIcon)) ) { return { ...item, - preferredIcon: fallbackIcon, + preferredIcon: alternateIcon, }; } From b072c7fb11927ed73daf4dc4af25672fc060ded4 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Thu, 15 Oct 2026 23:54:43 +0530 Subject: [PATCH 09/10] fix(integrations): add onError safety net and use validComponents count - Handle runtime image error to remove failed card and prevent loop - Align heading component count to validComponents.length Signed-off-by: tejaswiverma --- .../Individual-Integrations/ComponentsGrid.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index 064e5c59e21970..a0c335749ade20 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -115,11 +115,17 @@ const ComponentsGrid = ({ frontmatter }) => { }; }, [frontmatter, darkModeActive, fallbackIcon]); + const handleImageError = (indexToRemove) => { + setValidComponents((prev) => + prev.filter((_, idx) => idx !== indexToRemove), + ); + }; + return (

- {frontmatter?.title} Components ({candidateComponents.length}) + {frontmatter?.title} Components ({validComponents.length})

@@ -128,7 +134,14 @@ const ComponentsGrid = ({ frontmatter }) => {
{item.preferredIcon && ( - {item.name + {item.name { + e.currentTarget.onerror = null; + handleImageError(index); + }} + /> )}

{item.name?.replaceAll("-", " ") || ""}

From 293fd50d789e5f386c98cf9c54e7a2d8195ce233 Mon Sep 17 00:00:00 2001 From: tejaswiverma Date: Sun, 25 Oct 2026 20:03:55 +0530 Subject: [PATCH 10/10] fix(integrations): revert unrelated formatting, drop svg swap, and filter image errors by name Signed-off-by: tejaswiverma --- .../icons/color/node-feature-group-color.svg | 5 +- .../Individual-Integrations/ComponentsGrid.js | 10 +- .../Resources-error/emptyStateTemplate.js | 8 +- .../Resources-grid/resourceGrid.style.js | 216 +++++++----------- src/templates/integrations.js | 42 ++-- 5 files changed, 112 insertions(+), 169 deletions(-) diff --git a/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg b/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg index cf727a91a137fa..b89948f134f25a 100644 --- a/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg +++ b/src/collections/integrations/amd-gpu/icons/components/node-feature-group/icons/color/node-feature-group-color.svg @@ -1 +1,4 @@ - + + + + diff --git a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js index a0c335749ade20..e61afb4d120240 100644 --- a/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js +++ b/src/sections/Meshery/Meshery-integrations/Individual-Integrations/ComponentsGrid.js @@ -115,9 +115,9 @@ const ComponentsGrid = ({ frontmatter }) => { }; }, [frontmatter, darkModeActive, fallbackIcon]); - const handleImageError = (indexToRemove) => { + const handleImageError = (nameToRemove) => { setValidComponents((prev) => - prev.filter((_, idx) => idx !== indexToRemove), + prev.filter((item) => item.name !== nameToRemove), ); }; @@ -130,8 +130,8 @@ const ComponentsGrid = ({ frontmatter }) => {
- {validComponents.map((item, index) => ( -
+ {validComponents.map((item) => ( +
{item.preferredIcon && ( { alt={item.name || ""} onError={(e) => { e.currentTarget.onerror = null; - handleImageError(index); + handleImageError(item.name); }} /> )} diff --git a/src/sections/Resources/Resources-error/emptyStateTemplate.js b/src/sections/Resources/Resources-error/emptyStateTemplate.js index 968e1348ead089..000e89a6c520e6 100644 --- a/src/sections/Resources/Resources-error/emptyStateTemplate.js +++ b/src/sections/Resources/Resources-error/emptyStateTemplate.js @@ -4,16 +4,16 @@ import serviceMesh from "../../../assets/images/service-mesh-icons/service-mesh. import { ResourcePageWrapper } from "../Resources-grid/resourceGrid.style"; -const NoResources = ({ errorMessage, errorSubtitle }) => { +const NoResources = ({ errorMessage,errorSubtitle }) => { return (
- - + + service meshes - +

{errorMessage}

{errorSubtitle}

diff --git a/src/sections/Resources/Resources-grid/resourceGrid.style.js b/src/sections/Resources/Resources-grid/resourceGrid.style.js index d5d40fb4e5a3e1..25de50edbc8cfc 100644 --- a/src/sections/Resources/Resources-grid/resourceGrid.style.js +++ b/src/sections/Resources/Resources-grid/resourceGrid.style.js @@ -1,160 +1,102 @@ import styled from "styled-components"; export const ResourcePageWrapper = styled.div` - .resource-grid-wrapper { - margin: 0.8rem 0 1.5rem 1.5rem; - } - .search { - display: flex; - justify-content: flex-end; - width: 100%; + .resource-grid-wrapper{ + margin: 0.8rem 0 1.5rem 1.5rem; + } - margin-bottom: 0.8rem; - .searchBox { - flex: 0 0 50%; - @media only screen and (max-width: 990px) { - flex: 0 0 100%; - max-width: 100%; - } + .search{ + display:flex; + justify-content:flex-end; + width:100%; + + margin-bottom: 0.8rem; + .searchBox{ + flex:0 0 50%; + @media only screen and (max-width:990px){ + + flex:0 0 100%; + max-width:100%; + + } + } + } - } - .post-content-block { - height: 7rem; - } - .post-thumb-block { - height: 10.5rem; - } - .post-meta-block { - p { - margin: 0; + .post-content-block{ + height: 7rem; } - } - .btn-container { - display: flex; - justify-content: center; - align-items: center; - gap: 1rem; - margin: 3rem auto 4rem; - - @media screen and (max-width: 768px) { - flex-direction: column; - gap: 1rem; - margin: 2rem auto 3rem; + .post-thumb-block{ + height: 10.5rem; } - } + .post-meta-block{ + p{ + margin:0; + } + } + .btn-container { + display: flex; + justify-content: center; + align-items: center; + gap: 1rem; + margin: 3rem auto 4rem; + + @media screen and (max-width: 768px) { + flex-direction: column; + gap: 1rem; + margin: 2rem auto 3rem; + } + } - .nav-btn { - min-width: 130px; - padding: 0.75rem 1.5rem; - font-size: 1rem; - transition: all 0.3s ease; + .nav-btn { + min-width: 130px; + padding: 0.75rem 1.5rem; + font-size: 1rem; + transition: all 0.3s ease; - &:disabled { - opacity: 0.5; - cursor: not-allowed; - } + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } - @media screen and (max-width: 768px) { - min-width: 160px; - padding: 0.75rem 1.75rem; - } - } + @media screen and (max-width: 768px) { + min-width: 160px; + padding: 0.75rem 1.75rem; + } + } - @media only screen and (max-width: 575px) { - .resource-grid-wrapper { - margin: 0 auto 5rem; + @media only screen and (max-width: 575px) { + .resource-grid-wrapper{ + margin: 0 auto 5rem; + } } - } - .no-resources-page { + .no-resources-page{ padding: 1rem 1rem 4rem; margin: 1rem; - + box-shadow: 0px 3px 10px 1px rgba(0, 179, 159, 0.5); - - .empty-state-row { - flex-wrap: wrap; - } - .errorMessage { - font-size: 2rem; - line-height: 2rem; - overflow-wrap: break-word; - word-break: break-word; + font-size: 2rem; + line-height: 2rem; } - .error-text { - margin-top: 5rem; - overflow-wrap: break-word; - word-break: break-word; + .error-text{ + margin-top: 5rem; } - .errorSubtitle { - font-weight: 400; - font-size: 1.5rem; - color: gray; - font-style: italic; - margin-top: 2.5rem; - overflow-wrap: break-word; - word-break: break-word; - } - img { - display: block; - margin: auto; - margin-top: 3.125rem; - width: 14rem; - max-width: 100%; - height: auto; - object-fit: contain; - } - - @media only screen and (max-width: 992px) { - padding: 2rem 1.5rem 3rem; - text-align: center; - - .empty-state-row { - justify-content: center; - } - - img { - margin: 1rem auto 0; - width: 12rem; - max-width: 100%; - height: auto; - } - - .error-text { - margin-top: 1.5rem; - text-align: center; - } - - .errorMessage { + .errorSubtitle { + font-weight: 400; font-size: 1.5rem; - line-height: 1.3; - } - - .errorSubtitle { - font-size: 1.15rem; - line-height: 1.4; - margin-top: 1rem; - } + color: gray; + font-style: italic; + margin-top: 2.5rem; } - - @media only screen and (max-width: 575px) { - padding: 1.5rem 1rem 2.5rem; - margin: 0.5rem; - - img { - width: 9rem; - max-width: 100%; - } - - .errorMessage { - font-size: 1.25rem; - } - - .errorSubtitle { - font-size: 1rem; - margin-top: 0.75rem; - } + img{ + display: block; + margin:auto; + margin-top: 3.125rem; + width: 14rem; + @media only screen and (max-width:700px){ + max-width: 100%; + } + } } - } `; diff --git a/src/templates/integrations.js b/src/templates/integrations.js index bfa69b6abe68f4..34fcf5910ec69d 100644 --- a/src/templates/integrations.js +++ b/src/templates/integrations.js @@ -1,6 +1,9 @@ import React from "react"; import { graphql } from "gatsby"; + + import SEO from "../components/seo"; + import IndividualIntegrations from "../sections/Meshery/Meshery-integrations/Individual-Integrations"; const LiteModeNotice = ({ entity }) => ( @@ -17,15 +20,16 @@ const LiteModeNotice = ({ entity }) => ( {`This ${entity} page is skipped when BUILD_FULL_SITE=false to keep local builds fast.`}

- Run make site-full (or set BUILD_FULL_SITE=true) - to render the full content. + Run make site-full (or set BUILD_FULL_SITE=true) to render the full content.

); + export const query = graphql` query IntegrationsBySlug($slug: String!, $name: String!) { - mdx(fields: { slug: { eq: $slug } }) { + mdx(fields:{slug:{eq: $slug}}) { + frontmatter { title subtitle @@ -64,11 +68,7 @@ export const query = graphql` } } screenshots_raster: allFile( - filter: { - relativeDirectory: { eq: $name } - sourceInstanceName: { eq: "integrations" } - extension: { ne: "svg" } - } + filter: {relativeDirectory: {eq: $name}, sourceInstanceName: {eq: "integrations"}, extension: {ne: "svg"}} ) { nodes { extension @@ -79,11 +79,7 @@ export const query = graphql` } } screenshots_svg: allFile( - filter: { - relativeDirectory: { eq: $name } - sourceInstanceName: { eq: "integrations" } - extension: { eq: "svg" } - } + filter: {relativeDirectory: {eq: $name}, sourceInstanceName: {eq: "integrations"}, extension: {eq: "svg"}} ) { nodes { extension @@ -98,10 +94,18 @@ const Integrations = ({ data, children }) => { return ; } + return ( + <> - {children} + + + + {children} + + + ); }; export default Integrations; @@ -117,11 +121,5 @@ export const Head = ({ data }) => { ); } - return ( - - ); -}; + return ; +}; \ No newline at end of file