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, 08:15 UTC
revert(docs): use Decimal.show() only, remove unreliable toggle state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 19, 2026 at 16:21 UTC
6029269b734f41fbadfe35ecf3084e8ac200662d
1 file changed
+5
-14
docs/components/ask-ai-button.tsx
+5
-14
@@ -11,17 +11,8 @@ function getDecimal() {
11
return (window as typeof window & { Decimal?: DecimalAPI }).Decimal;
12
}
13
14
-let isDecimalOpen = false;
15
-
16
-function toggleDecimalWidget() {
17
- const decimal = getDecimal();
18
- if (!decimal) return;
19
- if (isDecimalOpen) {
20
- decimal.hide();
21
- } else {
22
- decimal.show();
23
- }
24
- isDecimalOpen = !isDecimalOpen;
14
+function showDecimalWidget() {
15
+ getDecimal()?.show();
16
}
17
18
function useIsMac() {
@@ -41,7 +32,7 @@ function useAskAIShortcut() {
32
function handleKeyDown(e: KeyboardEvent) {
33
if ((e.metaKey || e.ctrlKey) && e.key === 'i') {
34
e.preventDefault();
44
- toggleDecimalWidget();
35
+ showDecimalWidget();
36
}
37
}
38
document.addEventListener('keydown', handleKeyDown);
@@ -81,7 +72,7 @@ export function SearchAndAskAI() {
72
)}
73
<button
74
type="button"
84
- onClick={toggleDecimalWidget}
75
+ onClick={showDecimalWidget}
76
className="inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2.5 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground shrink-0"
77
>
78
Ask AI
@@ -114,7 +105,7 @@ export function SearchAndAskAIMobile() {
105
<button
106
type="button"
107
aria-label="Ask AI"
117
- onClick={toggleDecimalWidget}
108
+ onClick={showDecimalWidget}
109
className="inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 hover:bg-fd-accent hover:text-fd-accent-foreground"
110
>
111
<MessageSquare className="size-4.5" />