Skip to content
Closed
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
4 changes: 1 addition & 3 deletions apps/snow-leopard/app/api/document/actions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
getDocumentById
} from '@/lib/db/queries';
import { generateUUID } from '@/lib/utils';
import type { ArtifactKind } from '@/components/artifact';

/**
* Handles document creation (POST)
* Creates a new version of a document. If an ID is provided and exists for the user,
Expand Down Expand Up @@ -68,7 +66,7 @@ export async function createDocument(request: NextRequest, body: any) {
id: documentId,
title: title,
content: content,
kind: kind as ArtifactKind,
kind: kind,
userId: userId,
});

Expand Down
2 changes: 1 addition & 1 deletion apps/snow-leopard/app/documents/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound } from 'next/navigation';
import { getUser } from '@/app/(auth)/auth';
import { getDocumentsById } from '@/lib/db/queries';
import { AlwaysVisibleArtifact } from '@/components/always-visible-artifact';
import { AlwaysVisibleArtifact } from '@/components/document/document-workspace';
import type { Document } from '@snow-leopard/db';

export const dynamic = 'auto';
Expand Down
4 changes: 1 addition & 3 deletions apps/snow-leopard/app/documents/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
saveDocument,
} from '@/lib/db/queries';
import { myProvider } from '@/lib/ai/providers';
import { ArtifactKind } from '@/components/artifact';

export async function generateDocumentTitleFromContent({
content,
}: {
Expand Down Expand Up @@ -49,7 +47,7 @@ export async function updateDocumentContent({
await saveDocument({
id: document.id, // Use document.id for consistency
title: document.title,
kind: document.kind as ArtifactKind,
kind: null,
content,
userId: document.userId,
// saveDocument creates a new version, is_current defaults to true
Expand Down
5 changes: 4 additions & 1 deletion apps/snow-leopard/app/documents/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Chat } from '@/components/chat/chat';
import { ResizablePanel } from '@/components/resizable-panel';
import { AppSidebar } from '@/components/sidebar/app-sidebar';
import { SidebarProvider } from '@/components/ui/sidebar';
import { SuggestionOverlayProvider } from '@/components/suggestion-overlay-provider';
import { headers } from 'next/headers';
import { auth } from '@/lib/auth';
import { getCurrentDocumentsByUserId } from '@/lib/db/queries';
Expand All @@ -27,7 +28,8 @@ export default async function DocumentsLayout({ children }: { children: ReactNod

return (
<SidebarProvider defaultOpenLeft={!isLeftSidebarCollapsed} defaultOpenRight={true}>
<div className="flex flex-row h-dvh w-full bg-background">
<SuggestionOverlayProvider>
<div className="flex flex-row h-dvh w-full bg-background">
<AppSidebar user={user} initialDocuments={documents} />
<main className="flex-1 flex flex-row min-w-0">
<div className="flex-1 min-w-0 overflow-hidden border-r subtle-border">
Expand All @@ -46,6 +48,7 @@ export default async function DocumentsLayout({ children }: { children: ReactNod
</ResizablePanel>
</main>
</div>
</SuggestionOverlayProvider>
</SidebarProvider>
);
}
2 changes: 1 addition & 1 deletion apps/snow-leopard/app/documents/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { redirect } from 'next/navigation';
import { getSession, getUser } from '@/app/(auth)/auth';
import { AlwaysVisibleArtifact } from '@/components/always-visible-artifact';
import { AlwaysVisibleArtifact } from '@/components/document/document-workspace';

export default async function Page() {
const session = await getSession();
Expand Down
18 changes: 4 additions & 14 deletions apps/snow-leopard/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import type { Metadata } from 'next';
import { Toaster } from 'sonner';

import { ThemeProvider } from '@/components/theme-provider';
import { SuggestionOverlayProvider } from '@/components/suggestion-overlay-provider';
import { DocumentProvider } from '@/hooks/use-document-context';
import { CSPostHogProvider } from '@/providers/posthog-provider';
import { PostHogPageView } from '@/providers/posthog-pageview';
import { Analytics } from "@vercel/analytics/react"
Expand Down Expand Up @@ -92,21 +90,13 @@ export default async function RootLayout({
enableSystem
disableTransitionOnChange
>
<SuggestionOverlayProvider>
<CSPostHogProvider>
<PostHogPageView />
<DocumentProvider>
<CSPostHogProvider>
<PostHogPageView />
<Toaster position="top-center" />

{/* Render children ALWAYS */}
{children}

{children}
<MobileWarning />

<Analytics />
</DocumentProvider>
</CSPostHogProvider>
</SuggestionOverlayProvider>
</CSPostHogProvider>
</ThemeProvider>
</body>
</html>
Expand Down
24 changes: 15 additions & 9 deletions apps/snow-leopard/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ export default function Home() {
<Button
variant="outline"
size="sm"
className="rounded-full"
className="rounded-full group flex items-center"
onClick={handleBeginClick}
>
{hasSession ? "Open Snow Leopard" : "Begin"}
{hasSession ? "Open" : "Begin"}
<span className="inline-block ml-2 text-xs transition-transform group-hover:translate-x-0.5">
</span>
</Button>
</div>
</header>
Expand Down Expand Up @@ -139,13 +142,16 @@ export default function Home() {

{/* CTA Buttons */}
<div className="flex gap-2 mt-6 justify-center">
<Button asChild variant="outline" size="sm" className="rounded-full">
<Link href="/login">
Begin{" "}
<span className="inline-block ml-2 text-xs transition-transform group-hover:translate-x-0.5">
</span>
</Link>
<Button
variant="outline"
size="sm"
className="rounded-full"
onClick={handleBeginClick}
>
{hasSession ? "Open" : "Begin"}{" "}
<span className="inline-block ml-2 text-xs transition-transform group-hover:translate-x-0.5">
</span>
</Button>
<Button asChild variant="secondary" size="sm" className="rounded-full">
<Link href="https://github.com/will-lp1/snowleopard" target="_blank" rel="noopener noreferrer">
Expand Down
116 changes: 0 additions & 116 deletions apps/snow-leopard/artifacts/text/client.tsx

This file was deleted.

73 changes: 0 additions & 73 deletions apps/snow-leopard/artifacts/text/server.ts

This file was deleted.

Loading