From 8c307db57aa7a6ecabd956dbacb9f534abf38eaa Mon Sep 17 00:00:00 2001 From: Timothy Cardoza Date: Thu, 5 Mar 2026 19:14:30 -0600 Subject: [PATCH] Updated note tabs - NOT READY FOR PRODUCTION --- src/views/NotepadView.tsx | 185 ++++++++++++++++++++++---------------- 1 file changed, 107 insertions(+), 78 deletions(-) diff --git a/src/views/NotepadView.tsx b/src/views/NotepadView.tsx index a810bb3..f1ce944 100644 --- a/src/views/NotepadView.tsx +++ b/src/views/NotepadView.tsx @@ -2,7 +2,7 @@ import { type Component, createSignal, createMemo, createEffect, onCleanup, For, import { store, renameTagDefinition, updateNote, removeNote, restoreNote, setActiveNoteId, cleanupNoteAttachments } from "@/store"; import { pb } from "@/lib/pocketbase"; import { type Note } from "@/store"; -import { Trash2, Lock, Unlock, Search, Link, X, ChevronRight, ChevronDown, FileText, ArrowLeft, Plus } from "lucide-solid"; +import { Trash2, Lock, Unlock, Search, Link, X, ChevronRight, ChevronDown, FileText, Plus } from "lucide-solid"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { NOTES_COLLECTION } from "@/lib/constants"; @@ -186,7 +186,21 @@ export const NotepadView: Component<{ return store.notes.filter(n => !n.deletedAt && n.tags?.includes(childTag)); }); - const outsideTabs = createMemo(() => parentNote() ? siblingTabs() : childTabs()); + const outsideTabs = createMemo(() => { + const parent = parentNote(); + if (parent) { + // We have a parent, so show the parent and its children (siblings of active) + return [parent, ...siblingTabs()]; + } + // No parent, so we are at the root or no note selected + const active = activeNote(); + if (active) { + // Show the root note as the first tab, followed by its children + return [active, ...childTabs()]; + } + return []; + }); + const insideTabs = createMemo(() => parentNote() ? childTabs() : []); const rootParentNote = createMemo(() => { @@ -271,38 +285,42 @@ export const NotepadView: Component<{ <> {/* Desktop Style Tabs (Left Side) - Ribbon Bookmark Style */} {/* Bubbles hanging off string (Inside Tabs on the outside) positioned beside */} 0 || true)}> @@ -310,19 +328,36 @@ export const NotepadView: Component<{
{(subTab) => ( - + {subTab.title || "Untitled Tab"} + }> + e.stopPropagation()} + onBlur={(e) => { + const val = e.currentTarget.value.trim() || 'Untitled Tab'; + if (val !== subTab.title) handleRenameNote(subTab.id, subTab.title, val); + }} + /> + +
)} - - )} -
+
@@ -375,15 +397,13 @@ export const NotepadView: Component<{ {(root) => (