Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/web/src/components/ChatHomeEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
EmptyTitle,
} from "./ui/empty";
import { Button } from "./ui/button";
import { SidebarTrigger } from "./ui/sidebar";
import { SidebarTrigger, useSidebar } from "./ui/sidebar";
import { toastManager } from "./ui/toast";

export function ChatHomeEmptyState() {
Expand All @@ -36,6 +36,7 @@ export function ChatHomeEmptyState() {
const threads = useStore((store) => store.threads);
const { handleNewThread } = useHandleNewThread();
const [isOpeningProject, setIsOpeningProject] = useState(false);
const { open: sidebarOpen, isMobile: sidebarIsMobile } = useSidebar();

const latestProject = useMemo(
() => sortProjectsForSidebar(projects, threads, appSettings.sidebarProjectSortOrder)[0] ?? null,
Expand Down Expand Up @@ -118,8 +119,8 @@ export function ChatHomeEmptyState() {

return (
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background">
{!isElectron && (
<header className="border-b border-border px-3 py-2 md:hidden">
{!isElectron && (sidebarIsMobile || !sidebarOpen) && (
<header className="border-b border-border px-3 py-2">
<div className="flex items-center gap-2">
<SidebarTrigger className="size-7 shrink-0" />
<span className="text-sm font-medium text-foreground">Home</span>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ export default function Sidebar() {

const wordmark = (
<div className="flex items-center gap-2">
<SidebarTrigger className="shrink-0 md:hidden" />
<SidebarTrigger className="shrink-0" />
<Tooltip>
<TooltipTrigger
render={
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/chat/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ChatHeader = memo(function ChatHeader({
<div className="flex min-w-0 flex-1 items-center gap-2">
{/* Left: Identity — thread title + project context */}
<div className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden sm:gap-3">
<SidebarTrigger className="size-7 shrink-0 md:hidden" />
<SidebarTrigger className="size-7 shrink-0" />
<EditableThreadTitle
title={activeThreadTitle}
isEditing={isEditingTitle}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/review/ProjectSubpageShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ProjectSubpageShell({
{!isElectron ? (
<header className="border-b border-border px-3 py-2 sm:px-5">
<div className="flex items-center gap-2">
<SidebarTrigger className="size-7 shrink-0 md:hidden" />
<SidebarTrigger className="size-7 shrink-0" />
<Icon className="size-3.5 text-muted-foreground" />
<span className="text-sm font-medium text-foreground">{title}</span>
</div>
Expand Down
10 changes: 8 additions & 2 deletions apps/web/src/components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,17 @@ function Sidebar({
}

function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {
const { toggleSidebar, openMobile } = useSidebar();
const { toggleSidebar, open, openMobile, isMobile } = useSidebar();

return (
<Button
className={cn("size-7", className)}
className={cn(
"size-7",
// On desktop, only show the trigger when the sidebar is collapsed;
// when expanded the SidebarRail handles toggling.
!isMobile && open && "hidden",
className,
)}
data-sidebar="trigger"
data-slot="sidebar-trigger"
onClick={(event) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/routes/_chat.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ function SettingsRouteView() {
{!isElectron && (
<header className="border-b border-border px-3 py-2 sm:px-5">
<div className="flex items-center gap-2">
<SidebarTrigger className="size-7 shrink-0 md:hidden" />
<SidebarTrigger className="size-7 shrink-0" />
<span className="text-sm font-medium text-foreground">Settings</span>
<div className="ms-auto flex items-center gap-2">
<Button
Expand Down
Loading