diff --git a/src/components/platformFilter/index.tsx b/src/components/platformFilter/index.tsx
index d578299f50660..e4a7967e19ac0 100644
--- a/src/components/platformFilter/index.tsx
+++ b/src/components/platformFilter/index.tsx
@@ -38,11 +38,15 @@ export function PlatformFilter({platforms}: {platforms: Platform[]}) {
uniqByReference(matches.map(x => (x.type === 'platform' ? x : x.platform))).map(p => {
return {
...p,
- guides: p.guides.filter(g => matches.some(m => m.key === g.key)),
+ guides: matches
+ .filter(m => m.type === 'guide' && m.platform.key === p.key)
+ .map(m => p.guides.find(g => g.key === m.key)!)
+ .filter(Boolean),
integrations: p.integrations.filter(i => matches.some(m => m.key === i.key)),
};
})
);
+
return (
diff --git a/src/components/platformSelector/index.tsx b/src/components/platformSelector/index.tsx
index f67b5043a61f6..7762181c9950d 100644
--- a/src/components/platformSelector/index.tsx
+++ b/src/components/platformSelector/index.tsx
@@ -195,9 +195,15 @@ export function PlatformSelector({
platform={{
...platform,
// only keep guides that are in the matches list
- guides: platform.guides.filter(g =>
- matches.some(m => m.key === g.key)
- ),
+ guides: platform.guides
+ .filter(g =>
+ matches.some(m => m.key === g.key && m.type === 'guide')
+ )
+ .sort((a, b) => {
+ const indexA = matches.findIndex(m => m.key === a.key);
+ const indexB = matches.findIndex(m => m.key === b.key);
+ return indexA - indexB;
+ }),
integrations: platform.integrations.filter(i =>
matches.some(m => m.key === i.key)