disable attachments and update sidebar

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>

fixing package.json

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>

moving ui -> chat

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
Francisco Javier Arceo 2025-07-21 00:08:56 -04:00
parent f672258dd5
commit 2e271f2524
48 changed files with 97 additions and 64 deletions

View file

@ -1,14 +1,14 @@
"use client"; "use client";
import { signIn, signOut, useSession } from "next-auth/react"; import { signIn, signOut, useSession } from "next-auth/react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/chat/button";
import { import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card"; } from "@/components/chat/card";
import { Copy, Check, Home, Github } from "lucide-react"; import { Copy, Check, Home, Github } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";

View file

@ -2,16 +2,16 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { flushSync } from "react-dom"; import { flushSync } from "react-dom";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/chat/button";
import { import {
Select, Select,
SelectContent, SelectContent,
SelectItem, SelectItem,
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/chat/select";
import { Chat } from "@/components/ui/chat"; import { Chat } from "@/components/chat/chat";
import { type Message } from "@/components/ui/chat-message"; import { type Message } from "@/components/chat/chat-message";
import { useAuthClient } from "@/hooks/use-auth-client"; import { useAuthClient } from "@/hooks/use-auth-client";
import type { CompletionCreateParams } from "llama-stack-client/resources/chat/completions"; import type { CompletionCreateParams } from "llama-stack-client/resources/chat/completions";
import type { Model } from "llama-stack-client/resources/models"; import type { Model } from "llama-stack-client/resources/models";

View file

@ -1,8 +1,8 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { ThemeProvider } from "@/components/ui/theme-provider"; import { ThemeProvider } from "@/components/chat/theme-provider";
import { SessionProvider } from "@/components/providers/session-provider"; import { SessionProvider } from "@/components/providers/session-provider";
import { Geist, Geist_Mono } from "next/font/google"; import { Geist, Geist_Mono } from "next/font/google";
import { ModeToggle } from "@/components/ui/mode-toggle"; import { ModeToggle } from "@/components/chat/mode-toggle";
import "./globals.css"; import "./globals.css";
const geistSans = Geist({ const geistSans = Geist({
@ -20,9 +20,9 @@ export const metadata: Metadata = {
description: "Llama Stack UI", description: "Llama Stack UI",
}; };
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; import { SidebarProvider, SidebarTrigger } from "@/components/chat/sidebar";
import { AppSidebar } from "@/components/layout/app-sidebar"; import { AppSidebar } from "@/components/layout/app-sidebar";
import { SignInButton } from "@/components/ui/sign-in-button"; import { SignInButton } from "@/components/chat/sign-in-button";
export default function Layout({ children }: { children: React.ReactNode }) { export default function Layout({ children }: { children: React.ReactNode }) {
return ( return (

View file

@ -16,8 +16,8 @@ import {
TableHead, TableHead,
TableHeader, TableHeader,
TableRow, TableRow,
} from "@/components/ui/table"; } from "@/components/chat/table";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
export default function VectorStoresPage() { export default function VectorStoresPage() {
const client = useAuthClient(); const client = useAuthClient();

View file

@ -2,7 +2,7 @@
import { ChatMessage, ChatCompletion } from "@/lib/types"; import { ChatMessage, ChatCompletion } from "@/lib/types";
import { ChatMessageItem } from "@/components/chat-completions/chat-messasge-item"; import { ChatMessageItem } from "@/components/chat-completions/chat-messasge-item";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/chat/card";
import { import {
DetailLoadingView, DetailLoadingView,
DetailErrorView, DetailErrorView,

View file

@ -7,7 +7,7 @@ import { extractTextFromContentPart } from "@/lib/format-message-content";
import { import {
MessageBlock, MessageBlock,
ToolCallBlock, ToolCallBlock,
} from "@/components/ui/message-components"; } from "@/components/chat/message-components";
interface ChatMessageItemProps { interface ChatMessageItemProps {
message: ChatMessage; message: ChatMessage;

View file

@ -10,9 +10,9 @@ import {
Collapsible, Collapsible,
CollapsibleContent, CollapsibleContent,
CollapsibleTrigger, CollapsibleTrigger,
} from "@/components/ui/collapsible" } from "@/components/chat/collapsible"
import { FilePreview } from "@/components/ui/file-preview" import { FilePreview } from "@/components/chat/file-preview"
import { MarkdownRenderer } from "@/components/ui/markdown-renderer" import { MarkdownRenderer } from "@/components/chat/markdown-renderer"
const chatBubbleVariants = cva( const chatBubbleVariants = cva(
"group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]", "group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",

View file

@ -11,12 +11,12 @@ import { ArrowDown, ThumbsDown, ThumbsUp } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { useAutoScroll } from "@/hooks/use-auto-scroll" import { useAutoScroll } from "@/hooks/use-auto-scroll"
import { Button } from "@/components/ui/button" import { Button } from "@/components/chat/button"
import { type Message } from "@/components/ui/chat-message" import { type Message } from "@/components/chat/chat-message"
import { CopyButton } from "@/components/ui/copy-button" import { CopyButton } from "@/components/chat/copy-button"
import { MessageInput } from "@/components/ui/message-input" import { MessageInput } from "@/components/chat/message-input"
import { MessageList } from "@/components/ui/message-list" import { MessageList } from "@/components/chat/message-list"
import { PromptSuggestions } from "@/components/ui/prompt-suggestions" import { PromptSuggestions } from "@/components/chat/prompt-suggestions"
interface ChatPropsBase { interface ChatPropsBase {
handleSubmit: ( handleSubmit: (

View file

@ -4,7 +4,7 @@ import { Check, Copy } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard" import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"
import { Button } from "@/components/ui/button" import { Button } from "@/components/chat/button"
type CopyButtonProps = { type CopyButtonProps = {
content: string content: string

View file

@ -3,7 +3,7 @@ import Markdown from "react-markdown"
import remarkGfm from "remark-gfm" import remarkGfm from "remark-gfm"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { CopyButton } from "@/components/ui/copy-button" import { CopyButton } from "@/components/chat/copy-button"
interface MarkdownRendererProps { interface MarkdownRendererProps {
children: string children: string

View file

@ -8,10 +8,10 @@ import { omit } from "remeda"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { useAudioRecording } from "@/hooks/use-audio-recording" import { useAudioRecording } from "@/hooks/use-audio-recording"
import { useAutosizeTextArea } from "@/hooks/use-autosize-textarea" import { useAutosizeTextArea } from "@/hooks/use-autosize-textarea"
import { AudioVisualizer } from "@/components/ui/audio-visualizer" import { AudioVisualizer } from "@/components/chat/audio-visualizer"
import { Button } from "@/components/ui/button" import { Button } from "@/components/chat/button"
import { FilePreview } from "@/components/ui/file-preview" import { FilePreview } from "@/components/chat/file-preview"
import { InterruptPrompt } from "@/components/ui/interrupt-prompt" import { InterruptPrompt } from "@/components/chat/interrupt-prompt"
interface MessageInputBaseProps interface MessageInputBaseProps
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> { extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
@ -254,6 +254,7 @@ export function MessageInput({
variant="outline" variant="outline"
className="h-8 w-8" className="h-8 w-8"
aria-label="Attach a file" aria-label="Attach a file"
disabled={true}
onClick={async () => { onClick={async () => {
const files = await showFileUploadDialog() const files = await showFileUploadDialog()
addFiles(files) addFiles(files)

View file

@ -2,8 +2,8 @@ import {
ChatMessage, ChatMessage,
type ChatMessageProps, type ChatMessageProps,
type Message, type Message,
} from "@/components/ui/chat-message" } from "@/components/chat/chat-message"
import { TypingIndicator } from "@/components/ui/typing-indicator" import { TypingIndicator } from "@/components/chat/typing-indicator"
type AdditionalMessageOptions = Omit<ChatMessageProps, keyof Message> type AdditionalMessageOptions = Omit<ChatMessageProps, keyof Message>

View file

@ -4,13 +4,13 @@ import * as React from "react";
import { Moon, Sun } from "lucide-react"; import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/chat/button";
import { import {
DropdownMenu, DropdownMenu,
DropdownMenuContent, DropdownMenuContent,
DropdownMenuItem, DropdownMenuItem,
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"; } from "@/components/chat/dropdown-menu";
export function ModeToggle() { export function ModeToggle() {
const { setTheme } = useTheme(); const { setTheme } = useTheme();

View file

@ -7,23 +7,23 @@ import { PanelLeftIcon } from "lucide-react";
import { useIsMobile } from "@/hooks/use-mobile"; import { useIsMobile } from "@/hooks/use-mobile";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/chat/button";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/chat/input";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/chat/separator";
import { import {
Sheet, Sheet,
SheetContent, SheetContent,
SheetDescription, SheetDescription,
SheetHeader, SheetHeader,
SheetTitle, SheetTitle,
} from "@/components/ui/sheet"; } from "@/components/chat/sheet";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
import { import {
Tooltip, Tooltip,
TooltipContent, TooltipContent,
TooltipProvider, TooltipProvider,
TooltipTrigger, TooltipTrigger,
} from "@/components/ui/tooltip"; } from "@/components/chat/tooltip";
const SIDEBAR_COOKIE_NAME = "sidebar_state"; const SIDEBAR_COOKIE_NAME = "sidebar_state";
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;

View file

@ -21,14 +21,16 @@ import {
SidebarMenuButton, SidebarMenuButton,
SidebarMenuItem, SidebarMenuItem,
SidebarHeader, SidebarHeader,
} from "@/components/ui/sidebar"; } from "@/components/chat/sidebar";
// Extracted Chat Playground item
const chatPlaygroundItem = {
title: "Chat Playground",
url: "/chat-playground",
icon: MessageCircle,
};
// Removed Chat Playground from log items
const logItems = [ const logItems = [
{
title: "Chat Playground",
url: "/chat-playground",
icon: MessageCircle,
},
{ {
title: "Chat Completions", title: "Chat Completions",
url: "/logs/chat-completions", url: "/logs/chat-completions",
@ -60,6 +62,35 @@ export function AppSidebar() {
<Link href="/">Llama Stack</Link> <Link href="/">Llama Stack</Link>
</SidebarHeader> </SidebarHeader>
<SidebarContent> <SidebarContent>
{/* Chat Playground as its own section */}
<SidebarGroup>
<SidebarGroupContent>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton
asChild
className={cn(
"justify-start",
pathname.startsWith(chatPlaygroundItem.url) &&
"bg-gray-200 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100",
)}
>
<Link href={chatPlaygroundItem.url}>
<chatPlaygroundItem.icon
className={cn(
pathname.startsWith(chatPlaygroundItem.url) && "text-gray-900 dark:text-gray-100",
"mr-2 h-4 w-4",
)}
/>
<span>{chatPlaygroundItem.title}</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
{/* Logs section */}
<SidebarGroup> <SidebarGroup>
<SidebarGroupLabel>Logs</SidebarGroupLabel> <SidebarGroupLabel>Logs</SidebarGroupLabel>
<SidebarGroupContent> <SidebarGroupContent>

View file

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/chat/card";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
export function DetailLoadingView({ title }: { title: string }) { export function DetailLoadingView({ title }: { title: string }) {
return ( return (

View file

@ -9,7 +9,7 @@ import {
BreadcrumbList, BreadcrumbList,
BreadcrumbPage, BreadcrumbPage,
BreadcrumbSeparator, BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"; } from "@/components/chat/breadcrumb";
export interface BreadcrumbSegment { export interface BreadcrumbSegment {
label: string; label: string;

View file

@ -13,8 +13,8 @@ import {
TableHead, TableHead,
TableHeader, TableHeader,
TableRow, TableRow,
} from "@/components/ui/table"; } from "@/components/chat/table";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
// Generic table row data interface // Generic table row data interface
export interface LogTableRow { export interface LogTableRow {

View file

@ -1,7 +1,7 @@
import { import {
MessageBlock, MessageBlock,
ToolCallBlock, ToolCallBlock,
} from "@/components/ui/message-components"; } from "@/components/chat/message-components";
import { FunctionCallItem } from "../utils/item-types"; import { FunctionCallItem } from "../utils/item-types";
interface FunctionCallItemProps { interface FunctionCallItemProps {

View file

@ -1,7 +1,7 @@
import { import {
MessageBlock, MessageBlock,
ToolCallBlock, ToolCallBlock,
} from "@/components/ui/message-components"; } from "@/components/chat/message-components";
import { BaseItem } from "../utils/item-types"; import { BaseItem } from "../utils/item-types";
interface GenericItemProps { interface GenericItemProps {

View file

@ -1,7 +1,7 @@
import { import {
MessageBlock, MessageBlock,
ToolCallBlock, ToolCallBlock,
} from "@/components/ui/message-components"; } from "@/components/chat/message-components";
import { FunctionCallItem, FunctionCallOutputItem } from "../utils/item-types"; import { FunctionCallItem, FunctionCallOutputItem } from "../utils/item-types";
interface GroupedFunctionCallItemProps { interface GroupedFunctionCallItemProps {

View file

@ -1,4 +1,4 @@
import { MessageBlock } from "@/components/ui/message-components"; import { MessageBlock } from "@/components/chat/message-components";
import { MessageItem } from "../utils/item-types"; import { MessageItem } from "../utils/item-types";
interface MessageItemProps { interface MessageItemProps {

View file

@ -1,7 +1,7 @@
import { import {
MessageBlock, MessageBlock,
ToolCallBlock, ToolCallBlock,
} from "@/components/ui/message-components"; } from "@/components/chat/message-components";
import { WebSearchCallItem } from "../utils/item-types"; import { WebSearchCallItem } from "../utils/item-types";
interface WebSearchItemProps { interface WebSearchItemProps {

View file

@ -1,8 +1,8 @@
"use client"; "use client";
import { OpenAIResponse, InputItemListResponse } from "@/lib/types"; import { OpenAIResponse, InputItemListResponse } from "@/lib/types";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/chat/card";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
import { import {
DetailLoadingView, DetailLoadingView,
DetailErrorView, DetailErrorView,

View file

@ -2,8 +2,8 @@
import type { VectorStore } from "llama-stack-client/resources/vector-stores/vector-stores"; import type { VectorStore } from "llama-stack-client/resources/vector-stores/vector-stores";
import type { VectorStoreFile } from "llama-stack-client/resources/vector-stores/files"; import type { VectorStoreFile } from "llama-stack-client/resources/vector-stores/files";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/chat/card";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/chat/skeleton";
import { import {
DetailLoadingView, DetailLoadingView,
DetailErrorView, DetailErrorView,
@ -20,7 +20,7 @@ import {
TableHead, TableHead,
TableHeader, TableHeader,
TableRow, TableRow,
} from "@/components/ui/table"; } from "@/components/chat/table";
interface VectorStoreDetailViewProps { interface VectorStoreDetailViewProps {
store: VectorStore | null; store: VectorStore | null;

View file

@ -18,7 +18,7 @@
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"framer-motion": "^11.18.2", "framer-motion": "^11.18.2",
"llama-stack-client": "^0.2.15", "llama-stack-client": "0.2.16",
"lucide-react": "^0.510.0", "lucide-react": "^0.510.0",
"next": "15.3.3", "next": "15.3.3",
"next-auth": "^4.24.11", "next-auth": "^4.24.11",
@ -9926,9 +9926,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/llama-stack-client": { "node_modules/llama-stack-client": {
"version": "0.2.15", "version": "0.2.16",
"resolved": "https://registry.npmjs.org/llama-stack-client/-/llama-stack-client-0.2.15.tgz", "resolved": "https://registry.npmjs.org/llama-stack-client/-/llama-stack-client-0.2.16.tgz",
"integrity": "sha512-onfYzgPWAxve4uP7BuiK/ZdEC7w6X1PIXXXpQY57qZC7C4xUAM5kwfT3JWIe/jE22Lwc2vTN1ScfYlAYcoYAsg==", "integrity": "sha512-jM7sh1CB5wVumutYb3qfmYJpoTe3IRAa5lm3Us4qO7zVP4tbo3eCE7BOFNWyChpjo9efafUItwogNh28pum9PQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@types/node": "^18.11.18", "@types/node": "^18.11.18",

View file

@ -22,6 +22,7 @@
"@radix-ui/react-tooltip": "^1.2.6", "@radix-ui/react-tooltip": "^1.2.6",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"framer-motion": "^11.18.2",
"llama-stack-client": "0.2.16", "llama-stack-client": "0.2.16",
"lucide-react": "^0.510.0", "lucide-react": "^0.510.0",
"next": "15.3.3", "next": "15.3.3",