diff --git a/web/package.json b/web/package.json index 63e7d208..6e9141af 100644 --- a/web/package.json +++ b/web/package.json @@ -9,9 +9,9 @@ "dev": "vite", "build": "vite build", "release": "vite build --mode release --outDir=../server/router/frontend/dist --emptyOutDir", - "lint": "tsc --noEmit --skipLibCheck && biome check src", - "lint:fix": "biome check --write src", - "format": "biome format --write src", + "lint": "tsc --noEmit --skipLibCheck && biome check src tests", + "lint:fix": "biome check --write src tests", + "format": "biome format --write src tests", "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage" diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsx index 44517b66..57069f16 100644 --- a/web/src/components/AppSidebar/AppSidebar.tsx +++ b/web/src/components/AppSidebar/AppSidebar.tsx @@ -20,6 +20,7 @@ import { PaperclipIcon, PlusIcon, SearchIcon, + SquarePenIcon, Trash2Icon, UserRoundIcon, } from "lucide-react"; @@ -39,6 +40,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/comp import { memoViewServiceClient } from "@/connect"; import { type AttachmentSection, type InboxFilter, useAppSidebar } from "@/contexts/AppSidebarContext"; import { useAuth } from "@/contexts/AuthContext"; +import { useGlobalMemoEditor } from "@/contexts/GlobalMemoEditorContext"; import { useInstance } from "@/contexts/InstanceContext"; import { stringifyFilters, useMemoFilterContext } from "@/contexts/MemoFilterContext"; import { useAttachmentLibraryStats } from "@/hooks/useAttachmentLibrary"; @@ -72,6 +74,32 @@ import SidebarSection, { import TagsSection from "./TagsSection"; const SIDEBAR_HORIZONTAL_PADDING = "px-3"; +const SIDEBAR_HEADER_ACTION_CLASSES = "size-7 shrink-0 rounded-md text-muted-foreground hover:text-foreground"; + +const NewMemoAction = ({ onClick }: { onClick: () => void }) => { + const t = useTranslate(); + const label = t("editor.new-memo"); + + return ( + + + } + > + + + {label} + + ); +}; const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => { const t = useTranslate(); @@ -604,6 +632,7 @@ const AppSidebar = ({ className }: { className?: string }) => { const t = useTranslate(); const currentUser = useCurrentUser(); const { setMobileOpen, setQuickFindOpen } = useAppSidebar(); + const { canOpen: canCompose, openEditor } = useGlobalMemoEditor(); return (