diff --git a/apps/desktop2/src/components/main/body/daily.tsx b/apps/desktop2/src/components/main/body/daily.tsx
new file mode 100644
index 000000000..9ca705395
--- /dev/null
+++ b/apps/desktop2/src/components/main/body/daily.tsx
@@ -0,0 +1,67 @@
+import { format } from "date-fns";
+import { CalendarIcon, CheckSquare, Mail, Sun } from "lucide-react";
+
+import { type Tab } from "../../../store/zustand/tabs";
+import { type TabItem, TabItemBase } from "./shared";
+
+export const TabItemDaily: TabItem = ({ tab, handleClose, handleSelect }) => {
+ return (
+ }
+ title={tab.type === "daily" ? format(tab.date, "MMM d, yyyy") : "Daily Note"}
+ active={tab.active}
+ handleClose={() => handleClose(tab)}
+ handleSelect={() => handleSelect(tab)}
+ />
+ );
+};
+
+export function TabContentDaily({ tab }: { tab: Tab }) {
+ if (tab.type !== "daily") {
+ return null;
+ }
+
+ return (
+
✕
diff --git a/apps/desktop2/src/components/main/sidebar/index.tsx b/apps/desktop2/src/components/main/sidebar/index.tsx
index 7ead99695..7bc9a6a5e 100644
--- a/apps/desktop2/src/components/main/sidebar/index.tsx
+++ b/apps/desktop2/src/components/main/sidebar/index.tsx
@@ -2,6 +2,7 @@ import { clsx } from "clsx";
import { PanelLeftCloseIcon } from "lucide-react";
import { useLeftSidebar } from "@hypr/utils/contexts";
+import { NewNoteButton } from "./new-note-button";
import { ProfileSection } from "./profile";
import { TimelineView } from "./timeline";
@@ -27,6 +28,7 @@ export function LeftSidebar() {
diff --git a/apps/desktop2/src/components/main/sidebar/new-note-button.tsx b/apps/desktop2/src/components/main/sidebar/new-note-button.tsx
new file mode 100644
index 000000000..6f05e9e09
--- /dev/null
+++ b/apps/desktop2/src/components/main/sidebar/new-note-button.tsx
@@ -0,0 +1,34 @@
+import { PencilIcon } from "lucide-react";
+import { useCallback } from "react";
+
+import { Button } from "@hypr/ui/components/ui/button";
+import { cn } from "@hypr/ui/lib/utils";
+import { useTabs } from "../../../store/zustand/tabs";
+
+export function NewNoteButton() {
+ const { openNew } = useTabs();
+
+ const handleCreateNote = useCallback(() => {
+ openNew({
+ type: "sessions",
+ id: crypto.randomUUID(),
+ active: true,
+ state: { editor: "raw" },
+ });
+ }, [openNew]);
+
+ return (
+
+ );
+}
diff --git a/apps/desktop2/src/components/main/sidebar/profile/index.tsx b/apps/desktop2/src/components/main/sidebar/profile/index.tsx
index 3abc332f1..a24d093af 100644
--- a/apps/desktop2/src/components/main/sidebar/profile/index.tsx
+++ b/apps/desktop2/src/components/main/sidebar/profile/index.tsx
@@ -65,9 +65,9 @@ export function ProfileSection() {
}, [openNew, closeMenu]);
const handleClickDailyNote = useCallback(() => {
- console.log("Daily note");
+ openNew({ type: "daily", date: new Date(), active: true });
closeMenu();
- }, [closeMenu]);
+ }, [openNew, closeMenu]);
const menuItems = [
{ icon: FolderOpen, label: "Folders", onClick: handleClickFolders },
diff --git a/apps/desktop2/src/store/zustand/tabs.ts b/apps/desktop2/src/store/zustand/tabs.ts
index ef81adcad..a8f991ea4 100644
--- a/apps/desktop2/src/store/zustand/tabs.ts
+++ b/apps/desktop2/src/store/zustand/tabs.ts
@@ -171,6 +171,10 @@ export const tabSchema = z.discriminatedUnion("type", [
type: z.literal("calendars"),
month: z.coerce.date(),
}),
+ baseTabSchema.extend({
+ type: z.literal("daily"),
+ date: z.coerce.date(),
+ }),
]);
export type Tab = z.infer
;
@@ -187,6 +191,7 @@ export const rowIdfromTab = (tab: Tab): string => {
return tab.id;
case "calendars":
case "contacts":
+ case "daily":
throw new Error("invalid_resource");
case "folders":
if (!tab.id) {
@@ -210,6 +215,8 @@ export const uniqueIdfromTab = (tab: Tab): string => {
return `calendars-${tab.month.getFullYear()}-${tab.month.getMonth()}`;
case "contacts":
return `contacts`;
+ case "daily":
+ return `daily-${tab.date.getFullYear()}-${tab.date.getMonth()}-${tab.date.getDate()}`;
case "folders":
return `folders-${tab.id ?? "all"}`;
}