tabs on the top pane

This commit is contained in:
Arjun 2026-02-17 16:42:30 +05:30 committed by tusharmagar
parent 15f27c59ae
commit 8773a8ce64
2 changed files with 16 additions and 15 deletions

View file

@ -2486,9 +2486,20 @@ function App() {
canNavigateForward={canNavigateForward}
collapsedLeftPaddingPx={collapsedLeftPaddingPx}
>
<span className="text-sm font-medium text-muted-foreground flex-1 min-w-0 truncate">
{headerTitle}
</span>
{openTabs.length > 1 ? (
<ChatTabBar
tabs={openTabs}
activeTabId={activeTabId}
getTabTitle={getTabTitle}
processingRunIds={processingRunIds}
onSwitchTab={switchToTab}
onCloseTab={closeTab}
/>
) : (
<span className="text-sm font-medium text-muted-foreground flex-1 min-w-0 truncate">
{headerTitle}
</span>
)}
<button
type="button"
onClick={() => setIsSearchOpen(true)}
@ -2592,14 +2603,6 @@ function App() {
) : (
<FileCardProvider onOpenKnowledgeFile={(path) => { navigateToFile(path) }}>
<div className="flex min-h-0 flex-1 flex-col">
<ChatTabBar
tabs={openTabs}
activeTabId={activeTabId}
getTabTitle={getTabTitle}
processingRunIds={processingRunIds}
onSwitchTab={switchToTab}
onCloseTab={closeTab}
/>
<Conversation className="relative flex-1 overflow-y-auto [scrollbar-gutter:stable]">
<ScrollPositionPreserver />
<ConversationContent className={conversationContentClassName}>

View file

@ -24,10 +24,8 @@ export function ChatTabBar({
onSwitchTab,
onCloseTab,
}: ChatTabBarProps) {
if (tabs.length <= 1) return null
return (
<div className="flex items-center gap-0 border-b border-border bg-sidebar overflow-x-auto px-1 shrink-0">
<div className="titlebar-no-drag flex flex-1 items-center gap-0 overflow-x-auto min-w-0">
{tabs.map((tab) => {
const isActive = tab.id === activeTabId
const isProcessing = tab.runId ? processingRunIds.has(tab.runId) : false
@ -39,7 +37,7 @@ export function ChatTabBar({
type="button"
onClick={() => onSwitchTab(tab.id)}
className={cn(
"group/tab relative flex items-center gap-1.5 px-3 py-1.5 text-xs max-w-[180px] min-w-[80px] transition-colors",
"group/tab relative flex items-center gap-1.5 px-3 h-full text-xs max-w-[180px] min-w-[80px] transition-colors",
isActive
? "bg-accent text-accent-foreground"
: "text-muted-foreground hover:bg-accent/50 hover:text-foreground"