Compare commits

...

3 Commits

Author SHA1 Message Date
Jiayuan
2ff9ad0de3 refactor(ui): remove Cmd+B sidebar toggle keyboard shortcut
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 09:31:59 +02:00
Jiayuan
fc8ddc9785 fix(ui): guard Cmd+B sidebar shortcut against editable elements
Skip the sidebar toggle when focus is inside INPUT, TEXTAREA, SELECT,
or contentEditable elements so the shortcut does not steal Cmd+B (bold)
from TipTap editors.

Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 09:22:39 +02:00
Jiayuan
2f08097289 feat(views): add left sidebar collapse option for desktop
Show a sidebar toggle button in the page header when the sidebar is
collapsed on desktop, and add a toggle button to the sidebar footer
for collapsing. Also adds Cmd+B / Ctrl+B keyboard shortcut to toggle
the sidebar.

Closes #1967

Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 09:18:31 +02:00
2 changed files with 8 additions and 5 deletions

View File

@@ -51,6 +51,7 @@ import {
SidebarMenuButton,
SidebarMenuItem,
SidebarRail,
SidebarTrigger,
} from "@multica/ui/components/ui/sidebar";
import {
DropdownMenu,
@@ -691,7 +692,8 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
</SidebarContent>
<SidebarFooter className="p-2">
<div className="flex justify-end">
<div className="flex items-center justify-between">
<SidebarTrigger />
<HelpLauncher />
</div>
</SidebarFooter>

View File

@@ -3,13 +3,14 @@
import { cn } from "@multica/ui/lib/utils";
import { SidebarTrigger, useSidebar } from "@multica/ui/components/ui/sidebar";
function MobileSidebarTrigger() {
function SidebarToggle() {
try {
useSidebar();
const { state } = useSidebar();
// On mobile: always show (hamburger). On desktop: only when sidebar is collapsed.
return <SidebarTrigger className={cn("mr-2", state === "expanded" && "md:hidden")} />;
} catch {
return null;
}
return <SidebarTrigger className="mr-2 md:hidden" />;
}
interface PageHeaderProps {
@@ -20,7 +21,7 @@ interface PageHeaderProps {
export function PageHeader({ children, className }: PageHeaderProps) {
return (
<div className={cn("flex h-12 shrink-0 items-center border-b px-4", className)}>
<MobileSidebarTrigger />
<SidebarToggle />
{children}
</div>
);