Task fully working except collaborative to handoff switching handling

This commit is contained in:
2026-03-19 18:15:38 -05:00
parent 9438cffd58
commit b72980ad89
3 changed files with 9 additions and 0 deletions
+4
View File
@@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { NOTES_COLLECTION } from "@/lib/constants";
import { FilterBar } from "./FilterBar";
import { normalizeNoteKey } from "@/lib/tags";
export const NotesSidebar: Component<{
selectedNoteId: string | null;
@@ -170,12 +171,15 @@ export const NotesSidebar: Component<{
const handleCreateNote = async () => {
if (!currentUserId) return;
try {
const keyBase = normalizeNoteKey("new-note");
const result = await pb.collection(NOTES_COLLECTION).create({
title: "New Note",
key: `${keyBase}-${Date.now()}`,
content: "",
tags: [],
isPrivate: false,
user: currentUserId,
tasks: []
});
props.setSelectedNoteId(result.id);
} catch (e) {
+1
View File
@@ -964,6 +964,7 @@ export const cleanupNoteAttachments = async (noteId: string) => {
console.log(`[CLEANUP] Deleted ${filesToDelete.length} orphaned attachment(s) for note ${noteId}`);
}
} catch (err) {
if ((err as any)?.status === 404) return;
console.error("[CLEANUP] Failed to clean up orphaned note attachments:", err);
}
};
+4
View File
@@ -14,6 +14,7 @@ import { NotesSidebar } from "@/components/NotesSidebar";
import { toast } from "solid-sonner";
import { TextBubbleMenu } from "@/components/TextBubbleMenu";
import { TableBubbleMenu } from "@/components/TableBubbleMenu";
import { normalizeNoteKey } from "@/lib/tags";
export const NotepadView: Component<{
selectedNoteId: string | null;
@@ -229,12 +230,15 @@ export const NotepadView: Component<{
if (!root || !userId) return;
try {
const keyBase = normalizeNoteKey(`${root.key || root.title}-tab`);
const result = await pb.collection(NOTES_COLLECTION).create({
title: "New Tab",
key: `${keyBase}-${Date.now()}`,
content: "",
tags: [`child-of-${root.id}`],
isPrivate: root.isPrivate, // inherit privacy
user: userId,
tasks: []
});
props.setSelectedNoteId(result.id);
} catch (e) {