mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
default to new tab
This commit is contained in:
parent
c3603f32f2
commit
02c66970f5
2 changed files with 24 additions and 20 deletions
|
|
@ -2424,11 +2424,10 @@ function App() {
|
||||||
handleNewChatTab()
|
handleNewChatTab()
|
||||||
},
|
},
|
||||||
onSelectRun: (runIdToLoad) => {
|
onSelectRun: (runIdToLoad) => {
|
||||||
// If run is already open in a tab, switch to that tab
|
// If it's already the active tab's run, do nothing
|
||||||
const existingTab = openTabs.find(t => t.runId === runIdToLoad)
|
const activeTab = openTabs.find(t => t.id === activeTabId)
|
||||||
if (existingTab) {
|
if (activeTab?.runId === runIdToLoad) {
|
||||||
switchToTab(existingTab.id)
|
// Just ensure we're in chat view
|
||||||
// Also ensure we navigate to chat view
|
|
||||||
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
|
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
|
||||||
setSelectedPath(null)
|
setSelectedPath(null)
|
||||||
setIsGraphOpen(false)
|
setIsGraphOpen(false)
|
||||||
|
|
@ -2437,9 +2436,26 @@ function App() {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Update current tab's runId
|
// If already open in another tab, switch to it
|
||||||
setOpenTabs(prev => prev.map(t => t.id === activeTabId ? { ...t, runId: runIdToLoad } : t))
|
const existingTab = openTabs.find(t => t.runId === runIdToLoad)
|
||||||
void navigateToView({ type: 'chat', runId: runIdToLoad })
|
if (existingTab) {
|
||||||
|
switchToTab(existingTab.id)
|
||||||
|
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
|
||||||
|
setSelectedPath(null)
|
||||||
|
setIsGraphOpen(false)
|
||||||
|
setExpandedFrom(null)
|
||||||
|
setSelectedBackgroundTask(null)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Open in a new tab
|
||||||
|
openInNewTab(runIdToLoad)
|
||||||
|
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
|
||||||
|
setSelectedPath(null)
|
||||||
|
setIsGraphOpen(false)
|
||||||
|
setExpandedFrom(null)
|
||||||
|
setSelectedBackgroundTask(null)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onDeleteRun: async (runIdToDelete) => {
|
onDeleteRun: async (runIdToDelete) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -2462,16 +2478,6 @@ function App() {
|
||||||
console.error('Failed to delete run:', err)
|
console.error('Failed to delete run:', err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onOpenInNewTab: (targetRunId) => {
|
|
||||||
openInNewTab(targetRunId)
|
|
||||||
// Ensure we're in chat view
|
|
||||||
if (selectedPath || isGraphOpen || selectedBackgroundTask) {
|
|
||||||
setSelectedPath(null)
|
|
||||||
setIsGraphOpen(false)
|
|
||||||
setExpandedFrom(null)
|
|
||||||
setSelectedBackgroundTask(null)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelectBackgroundTask: (taskName) => {
|
onSelectBackgroundTask: (taskName) => {
|
||||||
void navigateToView({ type: 'task', name: taskName })
|
void navigateToView({ type: 'task', name: taskName })
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import {
|
||||||
ChevronsDownUp,
|
ChevronsDownUp,
|
||||||
ChevronsUpDown,
|
ChevronsUpDown,
|
||||||
Copy,
|
Copy,
|
||||||
ExternalLink,
|
|
||||||
FilePlus,
|
FilePlus,
|
||||||
FolderPlus,
|
FolderPlus,
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
|
|
@ -150,7 +149,6 @@ type TasksActions = {
|
||||||
onNewChat: () => void
|
onNewChat: () => void
|
||||||
onSelectRun: (runId: string) => void
|
onSelectRun: (runId: string) => void
|
||||||
onDeleteRun: (runId: string) => void
|
onDeleteRun: (runId: string) => void
|
||||||
onOpenInNewTab?: (runId: string) => void
|
|
||||||
onSelectBackgroundTask?: (taskName: string) => void
|
onSelectBackgroundTask?: (taskName: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue