Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(launcher): drop the in-detail fixed tree, now superseded by popup
Elian Doranea60c9e4da5e
diff --git a/apps/client/src/widgets/NoteDetail.css b/apps/client/src/widgets/NoteDetail.cssindex 453c463a57..dbbae8cfd1 100644--- a/apps/client/src/widgets/NoteDetail.css+++ b/apps/client/src/widgets/NoteDetail.css@@ -4,30 +4,6 @@font-size: var(--detail-font-size);contain: none;position: relative; /* anchor for the content-loading overlay */-- &.fixed-tree {- display: flex;- flex-direction: column;- height: 100%;-- .fixed-note-tree-container {- height: 60%;- border-bottom: 1px solid var(--main-border-color);- overflow: auto;-- .tree-wrapper {- padding: 0;- }-- .tree {- padding: 0;- }-- ul {- margin: 0;- }- }- }}body.prefers-centered-content .note-detail {diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsxindex a5d4569561..ce00a82b5d 100644--- a/apps/client/src/widgets/NoteDetail.tsx+++ b/apps/client/src/widgets/NoteDetail.tsx@@ -13,11 +13,10 @@ import dialog from "../services/dialog";import { t } from "../services/i18n";import protected_session_holder from "../services/protected_session_holder";import toast from "../services/toast.js";-import { isElectron, isMobile } from "../services/utils";-import NoteTreeWidget from "./note_tree";+import { isElectron } from "../services/utils";import { ExtendedNoteType, TYPE_MAPPINGS, TypeWidget } from "./note_types";import Button from "./react/Button";-import { useDelayedVisibility, useGetContextDataFrom, useLegacyWidget, useNoteContext, useTriliumEvent } from "./react/hooks";+import { useDelayedVisibility, useGetContextDataFrom, useNoteContext, useTriliumEvent } from "./react/hooks";import Icon from "./react/Icon";import NoItems from "./react/NoItems";import { NoteListWithLinks } from "./react/NoteList";@@ -42,7 +41,6 @@ export default function NoteDetail() {const [ noteTypesToRender, setNoteTypesToRender ] = useState<{ [ key in ExtendedNoteType ]?: (props: TypeWidgetProps) => VNode }>({});const [ activeNoteType, setActiveNoteType ] = useState<ExtendedNoteType>();const widgetRequestId = useRef(0);- const hasFixedTree = note && noteContext?.hoistedNoteId === "_lbMobileRoot" && isMobile() && note.noteId.startsWith("_lbMobile");// Defer loading for tabs that haven't been active yet (e.g. on app refresh).// A tab can hold multiple splits; activating the tab makes all of them visible at once, so deferral@@ -221,12 +219,9 @@ export default function NoteDetail() {<divref={containerRef}class={clsx("component note-detail", {- "full-height": isFullHeight,- "fixed-tree": hasFixedTree+ "full-height": isFullHeight})}>- {hasFixedTree && <FixedTree noteContext={noteContext} />}-{Object.entries(noteTypesToRender).map(([ itemType, Element ]) => {return <NoteDetailWrapperElement={Element}@@ -257,11 +252,6 @@ export function isContextInActiveTab(noteContext: NoteContext | undefined, activreturn activeMainNtxId === noteContext.getMainContext().ntxId;}-function FixedTree({ noteContext }: { noteContext: NoteContext }) {- const [ treeEl ] = useLegacyWidget(() => new NoteTreeWidget(), { noteContext });- return <div class="fixed-note-tree-container">{treeEl}</div>;-}-/*** Wraps a single note type widget, in order to keep it in the DOM even after the user has switched away to another note type. This allows faster loading of the same note type again. The properties are cached, so that they are updated only* while the widget is visible, to avoid rendering in the background. When not visible, the DOM element is simply hidden.