mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-12 21:02:17 +02:00
make new chat an icon on the top
This commit is contained in:
parent
4d160da105
commit
215e0aedd6
2 changed files with 15 additions and 12 deletions
|
|
@ -622,12 +622,14 @@ function parseDeepLink(input: string): ViewState | null {
|
|||
/** Sidebar toggle (fixed position, top-left) */
|
||||
function FixedSidebarToggle({
|
||||
leftInsetPx,
|
||||
onNewChat,
|
||||
}: {
|
||||
leftInsetPx: number
|
||||
onNewChat?: () => void
|
||||
}) {
|
||||
const { toggleSidebar } = useSidebar()
|
||||
return (
|
||||
<div className="fixed left-0 top-0 z-50 flex h-10 items-center" style={{ WebkitAppRegion: 'no-drag' } as React.CSSProperties}>
|
||||
<div className="fixed left-0 top-0 z-50 flex h-10 items-center gap-1" style={{ WebkitAppRegion: 'no-drag' } as React.CSSProperties}>
|
||||
<div aria-hidden="true" className="h-10 shrink-0" style={{ width: leftInsetPx }} />
|
||||
{/* Sidebar toggle */}
|
||||
<button
|
||||
|
|
@ -639,6 +641,17 @@ function FixedSidebarToggle({
|
|||
>
|
||||
<PanelLeftIcon className="size-5" />
|
||||
</button>
|
||||
{onNewChat && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onNewChat}
|
||||
className="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors"
|
||||
aria-label="New chat"
|
||||
title="New chat"
|
||||
>
|
||||
<SquarePen className="size-5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -5388,6 +5401,7 @@ function App() {
|
|||
{/* Rendered last so its no-drag region paints over the sidebar drag region */}
|
||||
<FixedSidebarToggle
|
||||
leftInsetPx={isMac ? MACOS_TRAFFIC_LIGHTS_RESERVED_PX : 0}
|
||||
onNewChat={handleNewChatTab}
|
||||
/>
|
||||
</SidebarProvider>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import {
|
|||
Pencil,
|
||||
Radio,
|
||||
SearchIcon,
|
||||
SquarePen,
|
||||
Table2,
|
||||
Plug,
|
||||
Lightbulb,
|
||||
|
|
@ -591,16 +590,6 @@ export function SidebarContentPanel({
|
|||
</div>
|
||||
{/* Quick action buttons */}
|
||||
<div className="rowboat-quick-actions titlebar-no-drag flex flex-col gap-0.5 px-2 pb-1">
|
||||
{onNewChat && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onNewChat}
|
||||
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground transition-colors"
|
||||
>
|
||||
<SquarePen className="size-4" />
|
||||
<span>New chat</span>
|
||||
</button>
|
||||
)}
|
||||
{onOpenSearch && (
|
||||
<button
|
||||
type="button"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue