Skip to content

Commit f231144

Browse files
committed
Remove Chat/Tasks mode toggle from layout
The tasks panel isn't relevant to the demo, so remove the ModeToggle component and simplify ExampleLayout to always show chat view.
1 parent 92e9df3 commit f231144

1 file changed

Lines changed: 2 additions & 44 deletions

File tree

  • apps/app/src/components/example-layout
Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"use client";
22

3-
import { ReactNode, useState } from "react";
4-
import { ModeToggle } from "./mode-toggle";
5-
import { useFrontendTool } from "@copilotkit/react-core";
3+
import { ReactNode } from "react";
64

75
interface ExampleLayoutProps {
86
chatContent: ReactNode;
@@ -11,53 +9,13 @@ interface ExampleLayoutProps {
119

1210
export function ExampleLayout({
1311
chatContent,
14-
appContent,
1512
}: ExampleLayoutProps) {
16-
const [mode, setMode] = useState<'chat' | 'app'>('chat');
17-
18-
useFrontendTool({
19-
name: "enableAppMode",
20-
description: "Enable app mode, make sure its open when interacting with todos.",
21-
handler: async () => {
22-
setMode('app');
23-
},
24-
});
25-
26-
useFrontendTool({
27-
name: "enableChatMode",
28-
description: "Enable chat mode",
29-
handler: async () => {
30-
setMode('chat');
31-
},
32-
});
33-
3413
return (
3514
<div className="h-full flex flex-row">
36-
<ModeToggle mode={mode} onModeChange={setMode} />
37-
3815
{/* Chat Content */}
39-
<div
40-
className={`max-h-full overflow-y-auto ${
41-
mode === 'app'
42-
? 'w-1/3 px-6 max-lg:hidden' // Hide on mobile in app mode
43-
: 'flex-1 max-lg:px-4'
44-
}`}
45-
>
16+
<div className="max-h-full overflow-y-auto flex-1 max-lg:px-4">
4617
{chatContent}
4718
</div>
48-
49-
{/* State Panel */}
50-
<div
51-
className={`h-full overflow-hidden ${
52-
mode === 'app'
53-
? 'w-2/3 max-lg:w-full border-l border-zinc-200 dark:border-zinc-700 max-lg:border-l-0' // Full width on mobile
54-
: 'w-0 border-l-0'
55-
}`}
56-
>
57-
<div className="w-full lg:w-[66.666vw] h-full">
58-
{appContent}
59-
</div>
60-
</div>
6119
</div>
6220
);
6321
}

0 commit comments

Comments
 (0)