mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-10 15:52:38 +02:00
fixed collapsed sidebar issue on chat
This commit is contained in:
parent
1c2b2ac1fc
commit
93feee15a0
2 changed files with 13 additions and 1 deletions
|
|
@ -4850,6 +4850,7 @@ function App() {
|
||||||
onToolOpenChangeForTab={setToolOpenForTab}
|
onToolOpenChangeForTab={setToolOpenForTab}
|
||||||
onOpenKnowledgeFile={(path) => { navigateToFile(path) }}
|
onOpenKnowledgeFile={(path) => { navigateToFile(path) }}
|
||||||
onActivate={() => setActiveShortcutPane('right')}
|
onActivate={() => setActiveShortcutPane('right')}
|
||||||
|
collapsedLeftPaddingPx={collapsedLeftPaddingPx}
|
||||||
isRecording={isRecording}
|
isRecording={isRecording}
|
||||||
recordingText={voice.interimText}
|
recordingText={voice.interimText}
|
||||||
recordingState={voice.state === 'connecting' ? 'connecting' : 'listening'}
|
recordingState={voice.state === 'connecting' ? 'connecting' : 'listening'}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import remarkBreaks from 'remark-breaks'
|
||||||
import { TabBar, type ChatTab } from '@/components/tab-bar'
|
import { TabBar, type ChatTab } from '@/components/tab-bar'
|
||||||
import { ChatInputWithMentions, type StagedAttachment, type SelectedModel } from '@/components/chat-input-with-mentions'
|
import { ChatInputWithMentions, type StagedAttachment, type SelectedModel } from '@/components/chat-input-with-mentions'
|
||||||
import { ChatMessageAttachments } from '@/components/chat-message-attachments'
|
import { ChatMessageAttachments } from '@/components/chat-message-attachments'
|
||||||
|
import { useSidebar } from '@/components/ui/sidebar'
|
||||||
import { wikiLabel } from '@/lib/wiki-links'
|
import { wikiLabel } from '@/lib/wiki-links'
|
||||||
import {
|
import {
|
||||||
type ChatViewportAnchorState,
|
type ChatViewportAnchorState,
|
||||||
|
|
@ -177,6 +178,7 @@ interface ChatSidebarProps {
|
||||||
onToolOpenChangeForTab?: (tabId: string, toolId: string, open: boolean) => void
|
onToolOpenChangeForTab?: (tabId: string, toolId: string, open: boolean) => void
|
||||||
onOpenKnowledgeFile?: (path: string) => void
|
onOpenKnowledgeFile?: (path: string) => void
|
||||||
onActivate?: () => void
|
onActivate?: () => void
|
||||||
|
collapsedLeftPaddingPx?: number
|
||||||
// Voice / TTS props
|
// Voice / TTS props
|
||||||
isRecording?: boolean
|
isRecording?: boolean
|
||||||
recordingText?: string
|
recordingText?: string
|
||||||
|
|
@ -231,6 +233,7 @@ export function ChatSidebar({
|
||||||
onToolOpenChangeForTab,
|
onToolOpenChangeForTab,
|
||||||
onOpenKnowledgeFile,
|
onOpenKnowledgeFile,
|
||||||
onActivate,
|
onActivate,
|
||||||
|
collapsedLeftPaddingPx = 196,
|
||||||
isRecording,
|
isRecording,
|
||||||
recordingText,
|
recordingText,
|
||||||
recordingState,
|
recordingState,
|
||||||
|
|
@ -245,6 +248,7 @@ export function ChatSidebar({
|
||||||
onTtsModeChange,
|
onTtsModeChange,
|
||||||
onComposioConnected,
|
onComposioConnected,
|
||||||
}: ChatSidebarProps) {
|
}: ChatSidebarProps) {
|
||||||
|
const { state: sidebarState } = useSidebar()
|
||||||
const [width, setWidth] = useState(() => getInitialPaneWidth(defaultWidth))
|
const [width, setWidth] = useState(() => getInitialPaneWidth(defaultWidth))
|
||||||
const [isResizing, setIsResizing] = useState(false)
|
const [isResizing, setIsResizing] = useState(false)
|
||||||
const [showContent, setShowContent] = useState(isOpen)
|
const [showContent, setShowContent] = useState(isOpen)
|
||||||
|
|
@ -519,7 +523,14 @@ export function ChatSidebar({
|
||||||
|
|
||||||
{showContent && (
|
{showContent && (
|
||||||
<>
|
<>
|
||||||
<header className="titlebar-drag-region flex h-10 shrink-0 items-stretch border-b border-border bg-sidebar">
|
<header
|
||||||
|
className="titlebar-drag-region flex h-10 shrink-0 items-stretch border-b border-border bg-sidebar"
|
||||||
|
style={{
|
||||||
|
paddingLeft: isMaximized && sidebarState === 'collapsed' ? collapsedLeftPaddingPx : undefined,
|
||||||
|
paddingRight: isMaximized ? 12 : undefined,
|
||||||
|
transition: isMaximized ? 'padding-left 200ms linear' : undefined,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<TabBar
|
<TabBar
|
||||||
tabs={chatTabs}
|
tabs={chatTabs}
|
||||||
activeTabId={activeChatTabId}
|
activeTabId={activeChatTabId}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue