@devries-cameron20 / composio-1 / commits / e2cfc1ab9
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: fix mobile responsiveness and markdown Card conversion

Fix 7 mobile UI issues and a bug where Cards in .md endpoints rendered as nested list items because <Cards> wrapper matched the <Card regex. Mobile fixes: - ai-tools-banner: reduce padding, stack context files vertically - mermaid: replace fixed max-width with scrollable overflow - page-actions: fix xs:inline (nonexistent in Tailwind v4) to sm:inline - toolkits-landing: add flex-wrap to header buttons - toolkit-detail: add overflow-x-auto to TypeTables, reduce mobile padding - custom-search-dialog: hide keyboard shortcut on mobile Markdown fix: - Remove <Cards> wrapper before Card regex to prevent <Cards> matching <Card - Add word boundary to Card regexes for safety - Strip orphaned indentation from converted list items Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmitha Mallesh committed Feb 24, 2026 at 14:36 UTC e2cfc1ab9768cc5c56c33ca7f962ea84af3256e4
7 files changed +31 -23
docs/components/ai-tools-banner.tsx
+7 -7
@@ -15,10 +15,10 @@ function CopyableCommand({ text }: { text: string }) {
15 setTimeout(() => setCopied(false), 2000);
16 }}
17 aria-label={`Copy command: ${text}`}
18 - className="mb-3 flex w-full cursor-pointer items-center gap-2 rounded-lg border border-fd-border bg-fd-background dark:bg-fd-background/50 px-3.5 py-2.5 font-mono text-[13px] text-fd-foreground transition-colors hover:border-[var(--composio-orange)]/40"
18 + className="mb-3 flex w-full cursor-pointer items-center gap-2 rounded-lg border border-fd-border bg-fd-background dark:bg-fd-background/50 px-2.5 py-2 sm:px-3.5 sm:py-2.5 font-mono text-[13px] text-fd-foreground transition-colors hover:border-[var(--composio-orange)]/40"
19 >
20 <span className="select-none text-fd-muted-foreground">$</span>
21 - <span className="flex-1 text-left">{text}</span>
21 + <span className="min-w-0 flex-1 overflow-x-auto text-left whitespace-nowrap">{text}</span>
22 {copied ? (
23 <Check className="h-3.5 w-3.5 shrink-0 text-green-500" />
24 ) : (
@@ -32,7 +32,7 @@ export function AIToolsBanner() {
32 const skillsCommand = 'npx skills add composiohq/skills';
33
34 return (
35 - <div className="not-prose relative mt-6 mb-6 overflow-hidden rounded-xl border border-fd-border bg-gradient-to-br from-fd-card via-fd-card to-fd-muted/50 dark:from-fd-muted/20 dark:via-fd-card dark:to-fd-muted/40">
35 + <div className="not-prose relative mt-4 mb-4 sm:mt-6 sm:mb-6 overflow-hidden rounded-xl border border-fd-border bg-gradient-to-br from-fd-card via-fd-card to-fd-muted/50 dark:from-fd-muted/20 dark:via-fd-card dark:to-fd-muted/40">
36 {/* Subtle grid pattern */}
37 <div
38 className="pointer-events-none absolute inset-0 opacity-[0.03] dark:opacity-[0.02]"
@@ -42,9 +42,9 @@ export function AIToolsBanner() {
42 backgroundSize: '24px 24px',
43 }}
44 />
45 - <div className="relative p-5">
45 + <div className="relative p-4 sm:p-5">
46 {/* Header */}
47 - <div className="mb-4 flex items-center gap-2.5">
47 + <div className="mb-3 sm:mb-4 flex items-center gap-2.5">
48 <div className="flex h-7 w-7 items-center justify-center rounded-lg bg-fd-muted dark:bg-fd-muted/60">
49 <Bot className="h-4 w-4 text-fd-muted-foreground" />
50 </div>
@@ -57,7 +57,7 @@ export function AIToolsBanner() {
57 <CopyableCommand text={skillsCommand} />
58
59 {/* Skills links */}
60 - <div className="mb-4 flex items-center gap-3 text-xs">
60 + <div className="mb-3 sm:mb-4 flex items-center gap-3 text-xs">
61 <Link
62 href="https://skills.sh/composiohq/skills/composio"
63 target="_blank"
@@ -79,7 +79,7 @@ export function AIToolsBanner() {
79 </div>
80
81 {/* Context files */}
82 - <div className="flex gap-2">
82 + <div className="flex flex-col gap-2 sm:flex-row">
83 <Link
84 href="/llms.txt"
85 className="group flex flex-1 items-center gap-2.5 rounded-lg border border-fd-border/80 bg-fd-card dark:bg-fd-background/30 px-3 py-2 transition-all hover:border-[var(--composio-orange)]/40"
docs/components/custom-search-dialog.tsx
+1 -1
@@ -94,7 +94,7 @@ export default function CustomSearchDialog({
94 <BotMessageSquare className="size-3.5" />
95 You can also Ask AI
96 </button>
97 - <div className="inline-flex gap-0.5">
97 + <div className="hidden sm:inline-flex gap-0.5">
98 <kbd className="rounded-md border bg-fd-background px-1.5 text-xs text-fd-muted-foreground">
99 <MetaKey />
100 </kbd>
docs/components/mermaid.tsx
+1 -1
@@ -63,7 +63,7 @@ export function Mermaid({ chart }: { chart: string }) {
63 return (
64 <div
65 ref={containerRef}
66 - className="my-4 flex justify-center max-w-lg mx-auto"
66 + className="my-4 overflow-x-auto max-w-full mx-auto [&>svg]:mx-auto"
67 dangerouslySetInnerHTML={{ __html: svg }}
68 />
69 );
docs/components/page-actions.tsx
+1 -1
@@ -123,7 +123,7 @@ export function PageActions({ path }: PageActionsProps) {
123 aria-label="View page as markdown (opens in new tab)"
124 >
125 <ExternalLink className="size-3.5" aria-hidden="true" />
126 - <span className="hidden xs:inline">View </span>
126 + <span className="hidden sm:inline">View </span>
127 <span>Markdown</span>
128 </a>
129
docs/components/toolkits/toolkit-detail.tsx
+6 -6
@@ -203,25 +203,25 @@ function ToolItem({ item, toolkitVersion }: { item: Tool | Trigger; toolkitVersi
203 onClick={copySlug}
204 className="inline-flex w-fit shrink-0 items-center gap-1 rounded bg-fd-muted px-1.5 py-0.5 font-mono text-xs text-fd-muted-foreground transition-colors hover:text-fd-foreground"
205 >
206 - <span className="max-w-[200px] truncate sm:max-w-[300px]">{item.slug}</span>
206 + <span className="max-w-[140px] truncate sm:max-w-[300px]">{item.slug}</span>
207 {copied ? <Check className="h-3 w-3 shrink-0 text-green-500" /> : <Copy className="h-3 w-3 shrink-0" />}
208 </span>
209 </span>
210 </button>
211 {expanded && (
212 - <div className="space-y-4 bg-fd-muted/20 px-4 py-3 pl-10">
212 + <div className="space-y-4 bg-fd-muted/20 px-3 py-3 sm:px-4 sm:pl-10">
213 <p className="text-sm text-fd-muted-foreground">{item.description}</p>
214
215 {/* Tool parameters */}
216 {hasInputParams && (
217 - <div className="space-y-2">
217 + <div className="space-y-2 overflow-x-auto">
218 <h4 className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">Input Parameters</h4>
219 <TypeTable type={paramsToTypeTable(inputParams!)} />
220 </div>
221 )}
222
223 {hasOutputParams && (
224 - <div className="space-y-2">
224 + <div className="space-y-2 overflow-x-auto">
225 <h4 className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">Output</h4>
226 <TypeTable type={paramsToTypeTable(outputParams!)} />
227 </div>
@@ -229,14 +229,14 @@ function ToolItem({ item, toolkitVersion }: { item: Tool | Trigger; toolkitVersi
229
230 {/* Trigger config/payload */}
231 {hasConfig && (
232 - <div className="space-y-2">
232 + <div className="space-y-2 overflow-x-auto">
233 <h4 className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">Configuration</h4>
234 <TypeTable type={paramsToTypeTable(trigger.config!)} />
235 </div>
236 )}
237
238 {hasPayload && (
239 - <div className="space-y-2">
239 + <div className="space-y-2 overflow-x-auto">
240 <h4 className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">Payload</h4>
241 <TypeTable type={paramsToTypeTable(trigger.payload!)} />
242 </div>
docs/components/toolkits/toolkits-landing.tsx
+1 -1
@@ -155,7 +155,7 @@ export function ToolkitsLanding() {
155 </p>
156 <PageActions path="/toolkits" />
157 </div>
158 - <div className="flex items-center gap-2">
158 + <div className="flex flex-wrap items-center gap-2">
159 <a
160 href="https://platform.composio.dev/auth?next_page=%2Ftool-router"
161 target="_blank"
docs/lib/source.ts
+14 -6
@@ -117,29 +117,36 @@ export function mdxToCleanMarkdown(content: string): string {
117 (_, content) => `> ${content.trim()}`
118 );
119
120 + // Remove Cards wrapper before processing individual Card tags
121 + // (prevents <Cards> from being matched by <Card regex since <Cards starts with <Card)
122 + result = result.replace(/<\/?Cards[^>]*>/g, '');
123 +
124 // Convert Card - handle multiline and various attribute orders
125 // Self-closing Cards with description attribute
126 result = result.replace(
123 - /<Card[\s\S]*?title="([^"]*)"[\s\S]*?href="([^"]*)"[\s\S]*?description="([^"]*)"[\s\S]*?\/>/g,
127 + /<Card\b[\s\S]*?title="([^"]*)"[\s\S]*?href="([^"]*)"[\s\S]*?description="([^"]*)"[\s\S]*?\/>/g,
128 '- [$1]($2): $3'
129 );
130 // Cards with children content (non-self-closing)
131 result = result.replace(
128 - /<Card[\s\S]*?title="([^"]*)"[\s\S]*?href="([^"]*)"[\s\S]*?>([\s\S]*?)<\/Card>/g,
132 + /<Card\b[\s\S]*?title="([^"]*)"[\s\S]*?href="([^"]*)"[\s\S]*?>([\s\S]*?)<\/Card>/g,
133 '- [$1]($2): $3'
134 );
135 // Cards with href before title
136 result = result.replace(
133 - /<Card[\s\S]*?href="([^"]*)"[\s\S]*?title="([^"]*)"[\s\S]*?>([\s\S]*?)<\/Card>/g,
137 + /<Card\b[\s\S]*?href="([^"]*)"[\s\S]*?title="([^"]*)"[\s\S]*?>([\s\S]*?)<\/Card>/g,
138 '- [$2]($1): $3'
139 );
136 -
140 // Convert ProviderCard to markdown link
141 result = result.replace(
142 /<ProviderCard[\s\S]*?name="([^"]*)"[\s\S]*?href="([^"]*)"[\s\S]*?languages=\{\[([^\]]*)\]\}[\s\S]*?\/>/g,
143 (_, name, href, langs) => `- [${name}](${href}) (${langs.replace(/"/g, '')})`
144 );
145
146 + // Strip orphaned indentation from converted list items
147 + // (Cards/ProviderCards nested inside wrapper components had JSX indentation that persists after wrapper removal)
148 + result = result.replace(/^[ \t]+(- \[)/gm, '$1');
149 +
150 // Convert Tabs/Tab content - keep inner content
151 result = result.replace(/<TabsList>[\s\S]*?<\/TabsList>/g, '');
152 result = result.replace(/<TabsTrigger[^>]*>[^<]*<\/TabsTrigger>/g, '');
@@ -239,8 +246,9 @@ export function mdxToCleanMarkdown(content: string): string {
246 '- [llms-full.txt](/llms-full.txt) — Complete documentation in one file'
247 );
248
242 - // Remove wrapper components (Cards, ProviderGrid, Tabs, Frame, div, QuickstartFlow, IntegrationTabs, Accordions, ToolTypeFlow, ToolkitsLanding, TemplateGrid, etc.)
243 - result = result.replace(/<\/?(Cards|ProviderGrid|Tabs|Frame|div|QuickstartFlow|IntegrationTabs|Accordions|ToolTypeFlow|ToolkitsLanding|TemplateGrid)[^>]*>/g, '');
249 + // Remove wrapper components (ProviderGrid, Tabs, Frame, div, QuickstartFlow, IntegrationTabs, Accordions, ToolTypeFlow, ToolkitsLanding, TemplateGrid, etc.)
250 + // Note: Cards wrapper is removed earlier (before Card conversion) to prevent regex conflicts
251 + result = result.replace(/<\/?(ProviderGrid|Tabs|Frame|div|QuickstartFlow|IntegrationTabs|Accordions|ToolTypeFlow|ToolkitsLanding|TemplateGrid)[^>]*>/g, '');
252
253 // Remove remaining self-closing JSX tags (including those with JSX expressions)
254 result = result.replace(/<[A-Z][a-zA-Z]*[\s\S]*?\/>/g, '');