remove recents from new chat

This commit is contained in:
Arjun 2026-06-24 12:01:10 +05:30
parent 1bfda94f48
commit 7e1acedfcf
3 changed files with 5 additions and 58 deletions

View file

@ -6219,9 +6219,6 @@ function App() {
{!tabHasConversation ? ( {!tabHasConversation ? (
<ChatEmptyState <ChatEmptyState
wide wide
recentRuns={runs}
onSelectRun={(rid) => void navigateToView({ type: 'chat', runId: rid })}
onOpenChatHistory={() => void navigateToView({ type: 'chat-history' })}
onPickPrompt={setPresetMessage} onPickPrompt={setPresetMessage}
/> />
) : ( ) : (

View file

@ -1,19 +1,9 @@
import { ArrowUpRight, Bot, Mail, MessageSquare, Sparkles, Telescope } from 'lucide-react' import { Bot, Mail, Sparkles, Telescope } from 'lucide-react'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { formatRelativeTime } from '@/lib/relative-time'
import { ToolConnectionsCard } from '@/components/tool-connections-card' import { ToolConnectionsCard } from '@/components/tool-connections-card'
export interface ChatEmptyStateRun {
id: string
title?: string
createdAt: string
}
interface ChatEmptyStateProps { interface ChatEmptyStateProps {
recentRuns?: ChatEmptyStateRun[]
onSelectRun?: (runId: string) => void
onOpenChatHistory?: () => void
/** Fill the composer with a starter prompt (does not submit). */ /** Fill the composer with a starter prompt (does not submit). */
onPickPrompt: (prompt: string) => void onPickPrompt: (prompt: string) => void
/** Use a wider column — for the full-screen chat where the narrow column looks cramped. */ /** Use a wider column — for the full-screen chat where the narrow column looks cramped. */
@ -27,13 +17,10 @@ const SUGGESTED_ACTIONS: { icon: typeof Mail; title: string; sub: string; prompt
] ]
/** /**
* Empty-state body for the chat surface: greeting, recent chats, and starter * Empty-state body for the chat surface: greeting and starter action cards.
* action cards. Shown in both the side-pane copilot and full-screen chat. * Shown in both the side-pane copilot and full-screen chat.
*/ */
export function ChatEmptyState({ export function ChatEmptyState({
recentRuns = [],
onSelectRun,
onOpenChatHistory,
onPickPrompt, onPickPrompt,
wide = false, wide = false,
}: ChatEmptyStateProps) { }: ChatEmptyStateProps) {
@ -45,45 +32,13 @@ export function ChatEmptyState({
</div> </div>
<div> <div>
<div className="text-base font-semibold tracking-tight">What are we working on?</div> <div className="text-base font-semibold tracking-tight">What are we working on?</div>
<div className="text-xs text-muted-foreground">Ask anything, or pick up where you left off.</div> <div className="text-xs text-muted-foreground">Ask anything, or start with a suggestion.</div>
</div> </div>
</div> </div>
{recentRuns.length > 0 && (
<div>
<div className="flex items-center px-1 pb-2 text-[10.5px] font-semibold uppercase tracking-wider text-muted-foreground">
<span className="flex-1">Recent chats</span>
{onOpenChatHistory && (
<button
type="button"
onClick={onOpenChatHistory}
className="inline-flex items-center gap-0.5 text-[11px] font-medium normal-case tracking-normal text-primary hover:underline"
>
View all
<ArrowUpRight className="size-3" />
</button>
)}
</div>
<div className="flex flex-col gap-0.5">
{recentRuns.slice(0, 4).map((run) => (
<button
key={run.id}
type="button"
onClick={() => onSelectRun?.(run.id)}
className="flex items-center gap-2.5 rounded-md px-2.5 py-2 text-left hover:bg-accent"
>
<MessageSquare className="size-3.5 shrink-0 text-muted-foreground" />
<span className="min-w-0 flex-1 truncate text-[13px]">{run.title || '(Untitled chat)'}</span>
<span className="shrink-0 text-[11px] text-muted-foreground">{formatRelativeTime(run.createdAt)}</span>
</button>
))}
</div>
</div>
)}
<div> <div>
<div className="px-1 pb-2 text-[10.5px] font-semibold uppercase tracking-wider text-muted-foreground"> <div className="px-1 pb-2 text-[10.5px] font-semibold uppercase tracking-wider text-muted-foreground">
{recentRuns.length > 0 ? 'Or start fresh' : 'Get started'} Get started
</div> </div>
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
{SUGGESTED_ACTIONS.map((action) => ( {SUGGESTED_ACTIONS.map((action) => (

View file

@ -674,11 +674,6 @@ export function ChatSidebar({
{!tabHasConversation ? ( {!tabHasConversation ? (
<ChatEmptyState <ChatEmptyState
wide={isMaximized} wide={isMaximized}
// A pinned coding-session chat must not offer jumping
// to other conversations from the empty state either.
recentRuns={pinnedToCodeSession ? [] : recentRuns}
onSelectRun={pinnedToCodeSession ? undefined : onSelectRun}
onOpenChatHistory={pinnedToCodeSession ? undefined : onOpenChatHistory}
onPickPrompt={setLocalPresetMessage} onPickPrompt={setLocalPresetMessage}
/> />
) : ( ) : (