Skip to content

Commit 44e8f97

Browse files
committed
fixed: pipedream api
1 parent 1a0542c commit 44e8f97

File tree

5 files changed

+199
-211
lines changed

5 files changed

+199
-211
lines changed

backend/pipedream/api.py

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,29 @@ async def get_pipedream_apps(
360360
):
361361
logger.info(f"Fetching Pipedream apps registry, page: {page}")
362362

363+
# Curated list of featured apps (shown first) - verified through discovery script
364+
# Ordered by popularity (featured_weight) and category diversity
365+
FEATURED_APPS = [
366+
# Top productivity & collaboration (1M+ weight)
367+
"notion", "google_sheets", "google_drive", "google_calendar",
368+
"supabase", "slack", "microsoft_teams",
369+
370+
# Development & databases (100K+ weight)
371+
"github", "aws", "stripe", "salesforce_rest_api", "hubspot",
372+
"woocommerce", "mongodb", "mysql", "postgresql",
373+
374+
# Communication & marketing (10K+ weight)
375+
"gmail", "telegram_bot_api", "sendgrid", "klaviyo", "zendesk",
376+
"zoom", "twilio", "discord", "mailchimp",
377+
378+
# Forms, productivity & file storage
379+
"airtable_oauth", "typeform", "google_forms", "dropbox",
380+
"trello", "asana", "jira", "todoist", "clickup",
381+
382+
# E-commerce & design
383+
"shopify_developer_app", "figma", "linkedin", "google_analytics"
384+
]
385+
363386
try:
364387
from pipedream.client import get_pipedream_client
365388

@@ -387,11 +410,38 @@ async def get_pipedream_apps(
387410
response.raise_for_status()
388411

389412
data = response.json()
413+
apps = data.get("data", [])
414+
415+
# Apply curation logic (only if no search query to preserve search results)
416+
if not search:
417+
# Separate featured and non-featured apps
418+
featured_apps = []
419+
other_apps = []
420+
featured_slugs = set(FEATURED_APPS)
421+
422+
for app in apps:
423+
app_slug = app.get("name_slug", "").lower()
424+
if app_slug in featured_slugs:
425+
featured_apps.append(app)
426+
else:
427+
other_apps.append(app)
428+
429+
# Sort featured apps by the order in FEATURED_APPS list
430+
featured_apps.sort(key=lambda app: FEATURED_APPS.index(app.get("name_slug", "").lower())
431+
if app.get("name_slug", "").lower() in FEATURED_APPS else len(FEATURED_APPS))
432+
433+
# Combine: featured first, then others
434+
curated_apps = featured_apps + other_apps
435+
436+
logger.info(f"Applied curation: {len(featured_apps)} featured apps, {len(other_apps)} other apps")
437+
else:
438+
curated_apps = apps
439+
logger.info(f"Search query provided, skipping curation")
390440

391-
logger.info(f"Successfully fetched {len(data.get('data', []))} apps from Pipedream registry")
441+
logger.info(f"Successfully fetched {len(curated_apps)} apps from Pipedream registry")
392442
return {
393443
"success": True,
394-
"apps": data.get("data", []),
444+
"apps": curated_apps,
395445
"page_info": data.get("page_info", {}),
396446
"total_count": data.get("page_info", {}).get("total_count", 0)
397447
}

frontend/src/app/(home)/settings/credentials/_components/pipedream-dashboard-manager.tsx

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import React, { useState, memo, useEffect } from 'react';
3+
import React, { useState, memo } from 'react';
44
import { Switch } from '@/components/ui/switch';
55
import { Button } from '@/components/ui/button';
66
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
@@ -37,21 +37,7 @@ import { useRouter } from 'next/navigation';
3737
import { PipedreamRegistry } from '@/components/integrations/pipedream/pipedream-registry';
3838
// CustomMCPDialog import removed - using inline content in tabs instead
3939
import { cn } from '@/lib/utils';
40-
41-
interface PipedreamProfile {
42-
profile_id: string;
43-
account_id: string;
44-
mcp_qualified_name: string;
45-
profile_name: string;
46-
display_name: string;
47-
is_active: boolean;
48-
is_default: boolean;
49-
is_default_for_dashboard: boolean;
50-
enabled_tools: string[];
51-
app_slug: string;
52-
app_name: string;
53-
is_connected: boolean;
54-
}
40+
import type { PipedreamProfile } from '@/types/pipedream-profiles';
5541

5642
interface PipedreamDashboardManagerProps {
5743
compact?: boolean;
@@ -126,12 +112,7 @@ function PipedreamDashboardManagerComponent({ compact = false }: PipedreamDashbo
126112

127113
console.log('Pipedream profiles:', profiles);
128114

129-
// Auto-switch to connected tab when profiles are loaded
130-
useEffect(() => {
131-
if (profiles.length > 0 && activeTab === 'browse-apps') {
132-
setActiveTab('connected');
133-
}
134-
}, [profiles.length, activeTab]);
115+
// Keep Browse Apps as default tab - removed auto-switching behavior
135116

136117
// Auto-enable tools for profiles that don't have any tools on component load
137118
React.useEffect(() => {

0 commit comments

Comments
 (0)