Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Address Cursor comments re hotkeys, slow transition issues
Brendan O'Leary committed
Sep 2, 2026 at 14:14 UTC
714cca6e27b87415a5fb51caaeafc309e42e57fd
4 files changed
+32
-27
docs/app/(home)/layout.tsx
+5
-18
@@ -1,25 +1,12 @@
1
import { HomeLayout } from 'fumadocs-ui/layouts/home';
2
-import { headers } from 'next/headers';
2
import { baseOptions } from '@/lib/layout.shared';
3
import { EveChatMount } from '@/components/eve-chat-mount';
5
-import { DocsProductProvider } from '@/components/docs-product-context';
6
-import {
7
- DEFAULT_DOCS_PRODUCT,
8
- DOCS_PRODUCT_HEADER,
9
- parseDocsProduct,
10
-} from '@/lib/home-navigation';
11
-
12
-export default async function Layout({ children }: LayoutProps<'/'>) {
13
- const requestHeaders = await headers();
14
- const initialProduct =
15
- parseDocsProduct(requestHeaders.get(DOCS_PRODUCT_HEADER)) ?? DEFAULT_DOCS_PRODUCT;
4
5
+export default function Layout({ children }: LayoutProps<'/'>) {
6
return (
18
- <DocsProductProvider initialProduct={initialProduct}>
19
- <HomeLayout {...baseOptions()}>
20
- {children}
21
- <EveChatMount />
22
- </HomeLayout>
23
- </DocsProductProvider>
7
+ <HomeLayout {...baseOptions()}>
8
+ {children}
9
+ <EveChatMount />
10
+ </HomeLayout>
11
);
12
}
docs/app/layout.tsx
+20
-2
@@ -1,5 +1,6 @@
1
import { RootProvider } from 'fumadocs-ui/provider/next';
2
import type { Metadata } from 'next';
3
+import { headers } from 'next/headers';
4
import { Analytics } from '@vercel/analytics/next';
5
import './global.css';
6
import { JetBrains_Mono } from 'next/font/google';
@@ -10,6 +11,13 @@ import { ScrollReset } from '@/components/scroll-reset';
11
import { source, referenceSource } from '@/lib/source';
12
import { TOOLKIT_COUNT_LABEL } from '@/lib/toolkit-count';
13
import { ProductTransitionLoader } from '@/components/product-transition-loader';
14
+import { DocsProductProvider } from '@/components/docs-product-context';
15
+import {
16
+ DEFAULT_DOCS_PRODUCT,
17
+ DOCS_PRODUCTS,
18
+ DOCS_PRODUCT_HEADER,
19
+ parseDocsProduct,
20
+} from '@/lib/home-navigation';
21
22
const defaultLinkSlugs: { slug: string[]; source: typeof source }[] = [
23
{ slug: ['quickstart'], source },
@@ -66,7 +74,11 @@ const jetbrainsMono = JetBrains_Mono({
74
display: 'swap',
75
});
76
69
-export default function Layout({ children }: LayoutProps<'/'>) {
77
+export default async function Layout({ children }: LayoutProps<'/'>) {
78
+ const initialProduct =
79
+ parseDocsProduct((await headers()).get(DOCS_PRODUCT_HEADER)) ?? DEFAULT_DOCS_PRODUCT;
80
+ const initialTheme = DOCS_PRODUCTS[initialProduct].theme;
81
+
82
return (
83
<html
84
lang="en"
@@ -74,6 +86,11 @@ export default function Layout({ children }: LayoutProps<'/'>) {
86
suppressHydrationWarning
87
>
88
<head>
89
+ <script
90
+ dangerouslySetInnerHTML={{
91
+ __html: `try{localStorage.setItem('theme','${initialTheme}')}catch{}document.documentElement.classList.remove('light','dark');document.documentElement.classList.add('${initialTheme}');document.documentElement.style.colorScheme='${initialTheme}'`,
92
+ }}
93
+ />
94
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
95
<meta name="theme-color" content="#131211" media="(prefers-color-scheme: dark)" />
96
<script
@@ -120,6 +137,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
137
defaultTheme: 'system',
138
attribute: 'class',
139
enableSystem: true,
140
+ hotKey: false,
141
}}
142
search={{
143
SearchDialog: CustomSearchDialog,
@@ -129,7 +147,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
147
} as Record<string, unknown>,
148
}}
149
>
132
- {children}
150
+ <DocsProductProvider initialProduct={initialProduct}>{children}</DocsProductProvider>
151
</RootProvider>
152
</PostHogProvider>
153
</body>
docs/components/docs-product-context.tsx
+1
-7
@@ -153,13 +153,7 @@ export function DocsProductProvider({
153
return new Promise<void>(resolve => {
154
pendingNavigation.current?.resolve();
155
const finish = () => resolve();
156
- window.setTimeout(() => {
157
- if (pendingNavigation.current?.resolve === finish) {
158
- pendingNavigation.current = null;
159
- setPendingProduct(null);
160
- }
161
- finish();
162
- }, 1500);
156
+ window.setTimeout(finish, 1500);
157
pendingNavigation.current = {
158
from: pathname,
159
resolve: finish,
docs/tests/static/product-navigation.test.ts
+6
@@ -147,6 +147,9 @@ describe('Docs product navigation', () => {
147
const contextSource = await Bun.file(
148
new URL('../../components/docs-product-context.tsx', import.meta.url),
149
).text();
150
+ const rootLayoutSource = await Bun.file(
151
+ new URL('../../app/layout.tsx', import.meta.url),
152
+ ).text();
153
154
expect(switcherSource).toContain('aria-label={`Switch Composio product. Current product:');
155
expect(switcherSource).toContain('ProductSelectionLink');
@@ -160,5 +163,8 @@ describe('Docs product navigation', () => {
163
expect(sharedLayoutSource).toContain('slots: { navTitle: ProductNavTitle }');
164
expect(sharedLayoutSource).toContain('themeSwitch: { enabled: false }');
165
expect(contextSource).toContain('setTheme(DOCS_PRODUCTS[product].theme)');
166
+ expect(contextSource).toContain('window.setTimeout(finish, 1500)');
167
+ expect(rootLayoutSource).toContain("localStorage.setItem('theme','${initialTheme}')");
168
+ expect(rootLayoutSource).toContain('hotKey: false');
169
});
170
});