removed default tab

This commit is contained in:
Arjun 2026-02-17 16:26:59 +05:30
parent 0085518dc8
commit 235250bbb3
2 changed files with 35 additions and 32 deletions

View file

@ -2408,19 +2408,7 @@ function App() {
handleNewChatTab()
},
onSelectRun: (runIdToLoad) => {
// If it's already the active tab's run, do nothing
const activeTab = openTabs.find(t => t.id === activeTabId)
if (activeTab?.runId === runIdToLoad) {
// Just ensure we're in chat view
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
setSelectedPath(null)
setIsGraphOpen(false)
setExpandedFrom(null)
setSelectedBackgroundTask(null)
}
return
}
// If already open in another tab, switch to it
// If already open in a tab, switch to that tab
const existingTab = openTabs.find(t => t.runId === runIdToLoad)
if (existingTab) {
switchToTab(existingTab.id)
@ -2432,14 +2420,12 @@ function App() {
}
return
}
// If active tab is empty (new chat with no run), reuse it
if (activeTab && !activeTab.runId) {
setOpenTabs(prev => prev.map(t => t.id === activeTabId ? { ...t, runId: runIdToLoad } : t))
loadRun(runIdToLoad)
} else {
// Open in a new tab
openInNewTab(runIdToLoad)
}
// Navigate current tab to this run
setOpenTabs(prev => prev.map(t => t.id === activeTabId ? { ...t, runId: runIdToLoad } : t))
void navigateToView({ type: 'chat', runId: runIdToLoad })
},
onOpenInNewTab: (targetRunId) => {
openInNewTab(targetRunId)
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
setSelectedPath(null)
setIsGraphOpen(false)

View file

@ -8,6 +8,7 @@ import {
ChevronsDownUp,
ChevronsUpDown,
Copy,
ExternalLink,
FilePlus,
FolderPlus,
AlertTriangle,
@ -149,6 +150,7 @@ type TasksActions = {
onNewChat: () => void
onSelectRun: (runId: string) => void
onDeleteRun: (runId: string) => void
onOpenInNewTab?: (runId: string) => void
onSelectBackgroundTask?: (taskName: string) => void
}
@ -1178,17 +1180,32 @@ function TasksSection({
</span>
) : null}
{!processingRunIds?.has(run.id) && (
<button
type="button"
className="shrink-0 hidden group-hover/chat-item:flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors"
onClick={(e) => {
e.stopPropagation()
setPendingDeleteRunId(run.id)
}}
aria-label="Delete chat"
>
<Trash2 className="size-3.5" />
</button>
<div className="shrink-0 hidden group-hover/chat-item:flex items-center gap-0.5">
{actions?.onOpenInNewTab && (
<button
type="button"
className="flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors"
onClick={(e) => {
e.stopPropagation()
actions.onOpenInNewTab!(run.id)
}}
aria-label="Open in new tab"
>
<ExternalLink className="size-3.5" />
</button>
)}
<button
type="button"
className="flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors"
onClick={(e) => {
e.stopPropagation()
setPendingDeleteRunId(run.id)
}}
aria-label="Delete chat"
>
<Trash2 className="size-3.5" />
</button>
</div>
)}
</div>
</SidebarMenuButton>