@devries-cameron20 / composio Mirror · read-only / commits / 7edefd095
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 03:15 UTC

fix(docs): add timer cleanup and aria-hidden to AIToolsBanner

- Add timerRef with clearTimeout to prevent copy indicator race condition - Add aria-hidden="true" to all decorative icons (Bot, ExternalLink, Terminal, FileText) to prevent redundant screen reader announcements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmitha Mallesh committed Mar 9, 2026 at 15:14 UTC 7edefd09581a349b286f3aeca207567dd020c6ae
1 file changed +12 -8
docs/components/ai-tools-banner.tsx
+12 -8
@@ -1,19 +1,23 @@
1 'use client';
2
3 -import { useState } from 'react';
3 +import { useState, useRef, useEffect } from 'react';
4 import Link from 'next/link';
5 import { Bot, FileText, Terminal, Copy, Check, ExternalLink } from 'lucide-react';
6
7 function CopyableCommand({ text }: { text: string }) {
8 const [copied, setCopied] = useState(false);
9 + const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
10 +
11 + useEffect(() => () => { clearTimeout(timerRef.current); }, []);
12
13 return (
14 <button
15 onClick={async () => {
16 try {
17 await navigator.clipboard.writeText(text);
18 + clearTimeout(timerRef.current);
19 setCopied(true);
16 - setTimeout(() => setCopied(false), 2000);
20 + timerRef.current = setTimeout(() => setCopied(false), 2000);
21 } catch {
22 // clipboard write failed
23 }
@@ -52,7 +56,7 @@ export function AIToolsBanner() {
56 {/* Header */}
57 <div className="flex items-center gap-2.5">
58 <div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-[var(--composio-orange)]/10">
55 - <Bot className="h-4 w-4 text-[var(--composio-orange)]" />
59 + <Bot aria-hidden="true" className="h-4 w-4 text-[var(--composio-orange)]" />
60 </div>
61 <span className="text-sm font-semibold tracking-tight text-fd-foreground">
62 For AI tools
@@ -73,7 +77,7 @@ export function AIToolsBanner() {
77 className="text-fd-muted-foreground hover:text-[var(--composio-orange)] transition-colors"
78 >
79 Skills.sh
76 - <ExternalLink className="ml-1 inline h-2.5 w-2.5" />
80 + <ExternalLink aria-hidden="true" className="ml-1 inline h-2.5 w-2.5" />
81 </Link>
82 <Link
83 href="https://github.com/composiohq/skills"
@@ -82,7 +86,7 @@ export function AIToolsBanner() {
86 className="text-fd-muted-foreground hover:text-[var(--composio-orange)] transition-colors"
87 >
88 GitHub
85 - <ExternalLink className="ml-1 inline h-2.5 w-2.5" />
89 + <ExternalLink aria-hidden="true" className="ml-1 inline h-2.5 w-2.5" />
90 </Link>
91 </div>
92 </div>
@@ -96,7 +100,7 @@ export function AIToolsBanner() {
100 href="/docs/cli"
101 className="inline-flex items-center gap-1 text-fd-muted-foreground hover:text-[var(--composio-orange)] transition-colors"
102 >
99 - <Terminal className="h-2.5 w-2.5" />
103 + <Terminal aria-hidden="true" className="h-2.5 w-2.5" />
104 CLI Reference
105 </Link>
106 </div>
@@ -110,7 +114,7 @@ export function AIToolsBanner() {
114 href="/llms.txt"
115 className="group flex items-center gap-1.5 rounded-lg border border-fd-border bg-fd-background dark:bg-fd-background/30 px-3 py-1.5 transition-all hover:border-[var(--composio-orange)]/40"
116 >
113 - <FileText className="h-3.5 w-3.5 shrink-0 text-fd-muted-foreground group-hover:text-[var(--composio-orange)] transition-colors" />
117 + <FileText aria-hidden="true" className="h-3.5 w-3.5 shrink-0 text-fd-muted-foreground group-hover:text-[var(--composio-orange)] transition-colors" />
118 <span className="text-[12.5px] font-medium text-fd-foreground">llms.txt</span>
119 <span className="text-[10px] text-fd-muted-foreground">Index</span>
120 </Link>
@@ -118,7 +122,7 @@ export function AIToolsBanner() {
122 href="/llms-full.txt"
123 className="group flex items-center gap-1.5 rounded-lg border border-fd-border bg-fd-background dark:bg-fd-background/30 px-3 py-1.5 transition-all hover:border-[var(--composio-orange)]/40"
124 >
121 - <FileText className="h-3.5 w-3.5 shrink-0 text-fd-muted-foreground group-hover:text-[var(--composio-orange)] transition-colors" />
125 + <FileText aria-hidden="true" className="h-3.5 w-3.5 shrink-0 text-fd-muted-foreground group-hover:text-[var(--composio-orange)] transition-colors" />
126 <span className="text-[12.5px] font-medium text-fd-foreground">llms-full.txt</span>
127 <span className="text-[10px] text-fd-muted-foreground">Complete</span>
128 </Link>