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 */}