Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/(chat)/page.tsx → app/(chat)/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Chat } from '@/components/chat';
import { DEFAULT_CHAT_MODEL } from '@/lib/ai/models';
import { generateUUID } from '@/lib/utils';
import { DataStreamHandler } from '@/components/data-stream-handler';
import { auth } from '../(auth)/auth';
import { auth } from '@/app/(auth)/auth';
import { redirect } from 'next/navigation';

export default async function Page() {
Expand Down
17 changes: 16 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@
--sidebar-accent-foreground: 222 47% 11%;
--sidebar-border: 214 32% 91%;
--sidebar-ring: 221 83% 53%;

--black: #040404;
--tower-gray: #aec0bd;
--mountain-meadow: #169994;
--deep-sea-green: #076057;
--tiber: #042d2d;
--corduroy: #5b6464;
--mine-shaft: #2c2c2c;
--blue-chill: #087a85;
--blue-whale: #043b44;
--black-pearl: #071b24;
}
}

Expand Down Expand Up @@ -120,5 +131,9 @@
}

.suggestion-highlight {
@apply bg-blue-200 hover:bg-blue-300;
@apply text-white;
background-color: var(--deep-sea-green);
}
.suggestion-highlight:hover {
background-color: var(--mountain-meadow);
}
18 changes: 18 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Link from 'next/link';
import Spline from '@splinetool/react-spline/next';

export default function Home() {
return (
<main className="relative h-screen w-screen">
<Spline scene="https://prod.spline.design/DS0UgrDOifhNt9T6/scene.splinecode" />
<div className="absolute inset-0 flex items-end justify-center pb-10">
<Link
href="/chat"
className="px-6 py-3 rounded-lg bg-[var(--deep-sea-green)] text-white"
>
Try Demo
</Link>
</div>
</main>
);
Comment on lines +1 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Update internal links after moving chat to /chat

Adding app/page.tsx turns / into a landing page while the chat UI now lives under /chat. However, buttons such as the sidebar logo and the “New Chat” actions still call router.push('/') (e.g., components/app-sidebar.tsx, components/chat-header.tsx, and components/sidebar-history.tsx). After this change those controls route users back to the landing screen instead of opening a fresh chat session, effectively breaking the “new chat” flow and redirecting away from the actual chat interface. Consider updating these internal links to point to /chat so the chat controls continue to work.

Useful? React with 👍 / 👎.

}
7 changes: 2 additions & 5 deletions components/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const PurePreviewMessage = ({
<div
data-testid="message-content"
className={cn('flex flex-col gap-4', {
'bg-primary text-primary-foreground px-3 py-2 rounded-xl':
'bg-[var(--deep-sea-green)] text-white px-3 py-2 rounded-xl':
message.role === 'user',
})}
>
Expand Down Expand Up @@ -264,10 +264,7 @@ export const ThinkingMessage = () => {
>
<div
className={cx(
'flex gap-4 group-data-[role=user]/message:px-3 w-full group-data-[role=user]/message:w-fit group-data-[role=user]/message:ml-auto group-data-[role=user]/message:max-w-2xl group-data-[role=user]/message:py-2 rounded-xl',
{
'group-data-[role=user]/message:bg-muted': true,
},
'flex gap-4 group-data-[role=user]/message:px-3 w-full group-data-[role=user]/message:w-fit group-data-[role=user]/message:ml-auto group-data-[role=user]/message:max-w-2xl group-data-[role=user]/message:py-2 rounded-xl group-data-[role=user]/message:bg-[var(--deep-sea-green)] group-data-[role=user]/message:text-white',
)}
>
<div className="size-8 flex items-center rounded-full justify-center ring-1 shrink-0 ring-border">
Expand Down
15 changes: 10 additions & 5 deletions components/webset-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,15 @@ export function WebsetTable({ csv }: WebsetTableProps) {
style={{ width: columnWidths[header] ?? 150 }}
className="px-4 py-2 font-bold border-r border-b border-border bg-muted sticky top-0 z-10"
>
<div className="flex items-center justify-between gap-2 cursor-pointer select-none" onClick={() => {
if (sortedColumn === header) setSortDirection((d) => (d === 'asc' ? 'desc' : 'asc'));
else setSortedColumn(header);
}}>
<button
type="button"
className="flex items-center justify-between gap-2 cursor-pointer select-none"
onClick={() => {
if (sortedColumn === header)
setSortDirection((d) => (d === 'asc' ? 'desc' : 'asc'));
else setSortedColumn(header);
}}
>
<span className="text-xs font-bold">
{visibleColumns[header] === false ? (
<span className="line-through opacity-50">{header}</span>
Expand All @@ -286,7 +291,7 @@ export function WebsetTable({ csv }: WebsetTableProps) {
className="absolute right-0 top-0 h-full w-1 cursor-col-resize select-none"
onMouseDown={startResizing(header)}
/>
</div>
</button>
</TableHead>
))}
<TableHead className="w-10 px-4 py-2 border-b border-border">
Expand Down
3 changes: 2 additions & 1 deletion lib/googleTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export async function getFreshAccessToken(): Promise<FreshTokens> {
if (shouldRefresh) {
try {
const config = await getGoogleClient();
const refreshed = await refreshTokenGrant(config, refreshToken!);
if (!refreshToken) throw new Error('Missing refresh token');
const refreshed = await refreshTokenGrant(config, refreshToken);
accessToken = refreshed.access_token || accessToken;
refreshToken = refreshed.refresh_token || refreshToken;
expiresAt =
Expand Down
6 changes: 5 additions & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { guestRegex, isDevelopmentEnvironment } from './lib/constants';
export async function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;

if (pathname === '/') {
return NextResponse.next();
}

/*
* Playwright starts the dev server and requires a 200 status to
* begin the tests, so this ensures that the tests can start
Expand Down Expand Up @@ -42,7 +46,7 @@ export async function middleware(request: NextRequest) {

export const config = {
matcher: [
'/',
'/chat',
'/chat/:id',
'/api/:path*',
'/login',
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"test": "export PLAYWRIGHT=True && pnpm exec playwright test"
},
"dependencies": {
"@ai-sdk/react": "^1.2.11",
"@ai-sdk/openai": "^1.2.15",
"@ai-sdk/react": "^1.2.11",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/lang-python": "^6.1.6",
"@codemirror/state": "^6.5.0",
Expand All @@ -33,11 +33,13 @@
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@radix-ui/react-visually-hidden": "^1.1.0",
"@splinetool/react-spline": "^4.1.0",
"@vercel/analytics": "^1.3.1",
"@vercel/blob": "^0.24.1",
"@vercel/functions": "^2.0.0",
Expand All @@ -61,6 +63,7 @@
"next": "15.3.0-canary.31",
"next-auth": "5.0.0-beta.25",
"next-themes": "^0.3.0",
"openid-client": "^6.6.4",
"orderedmap": "^2.1.1",
"papaparse": "^5.5.2",
"postgres": "^3.4.4",
Expand All @@ -86,9 +89,7 @@
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0",
"zod": "^3.23.8",
"@radix-ui/react-popover": "^1.1.2",
"openid-client": "^6.6.4"
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
Expand Down
60 changes: 60 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.