Skip to content

Commit ed5ef0c

Browse files
Alex HolmbergAlex Holmberg
authored andcommitted
feat(23-01): wire CopilotKit provider and navigation
- Wrapped app with CopilotKitWrapper in root layout - Added navigation links between Smart Reply and Agent Chat - Active route styling for visual feedback
1 parent 661a1d9 commit ed5ef0c

2 files changed

Lines changed: 54 additions & 2 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { HeadContent, Scripts, createRootRoute, Link } from '@tanstack/react-router'
2+
import appCss from '../styles.css?url'
3+
import { CopilotKitWrapper } from '../lib/copilotkit'
4+
5+
export const Route = createRootRoute({
6+
head: () => ({
7+
meta: [
8+
{ charSet: 'utf-8' },
9+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
10+
{ title: 'Smart Reply Generator' },
11+
{ name: 'description', content: 'AI-powered reply suggestions for your messages' },
12+
],
13+
links: [
14+
{ rel: 'stylesheet', href: appCss },
15+
{ rel: 'icon', href: '/favicon.ico' },
16+
],
17+
}),
18+
shellComponent: RootDocument,
19+
})
20+
21+
function RootDocument({ children }: { children: React.ReactNode }) {
22+
return (
23+
<html lang="en" className="dark">
24+
<head>
25+
<HeadContent />
26+
</head>
27+
<body className="bg-slate-950 antialiased">
28+
{/* Navigation */}
29+
<nav className="fixed top-4 right-4 z-50 flex gap-2">
30+
<Link
31+
to="/"
32+
className="px-3 py-1.5 text-xs font-medium rounded-lg bg-slate-800/80 text-slate-300 hover:bg-slate-700 hover:text-white border border-slate-700 backdrop-blur-sm transition-all"
33+
activeProps={{ className: 'bg-cyan-600/20 text-cyan-400 border-cyan-500/30' }}
34+
>
35+
Smart Reply
36+
</Link>
37+
<Link
38+
to="/agent"
39+
className="px-3 py-1.5 text-xs font-medium rounded-lg bg-slate-800/80 text-slate-300 hover:bg-slate-700 hover:text-white border border-slate-700 backdrop-blur-sm transition-all"
40+
activeProps={{ className: 'bg-emerald-600/20 text-emerald-400 border-emerald-500/30' }}
41+
>
42+
Agent Chat
43+
</Link>
44+
</nav>
45+
<CopilotKitWrapper>
46+
{children}
47+
</CopilotKitWrapper>
48+
<Scripts />
49+
</body>
50+
</html>
51+
)
52+
}

tests/ag-ui-app/frontend/src/routes/agent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ function AgentChat() {
4343
return (
4444
<main className="min-h-screen bg-slate-950 relative overflow-hidden">
4545
{/* Background */}
46-
<div className="absolute inset-0 bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950" />
46+
<div className="absolute inset-0 bg-linear-to-br from-slate-950 via-slate-900 to-slate-950" />
4747
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top,rgba(34,211,238,0.1),transparent_50%)]" />
4848

4949
<div className="relative z-10 max-w-3xl mx-auto px-4 sm:px-6 py-12">
5050
{/* Header */}
5151
<header className="flex flex-col items-center text-center mb-8">
5252
<div className="flex items-center gap-3 mb-4">
53-
<div className="p-3 rounded-2xl bg-gradient-to-br from-emerald-500/20 to-cyan-600/20 border border-emerald-500/30 shadow-[0_0_30px_rgba(16,185,129,0.15)]">
53+
<div className="p-3 rounded-2xl bg-linear-to-br from-emerald-500/20 to-cyan-600/20 border border-emerald-500/30 shadow-[0_0_30px_rgba(16,185,129,0.15)]">
5454
<Bot className="w-8 h-8 text-emerald-400" />
5555
</div>
5656
<h1 className="text-4xl font-bold tracking-tight bg-gradient-to-r from-emerald-400 via-cyan-400 to-blue-400 bg-clip-text text-transparent">

0 commit comments

Comments
 (0)