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
style(launcher): show the note title in the tree popup header
Elian Doranb175e78a496e
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.css b/apps/client/src/widgets/dialogs/PopupEditor.cssindex a03b5d3cac..a81573e6a7 100644--- a/apps/client/src/widgets/dialogs/PopupEditor.css+++ b/apps/client/src/widgets/dialogs/PopupEditor.css@@ -35,7 +35,10 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {font-size: 1.1em;}-.modal.popup-editor-dialog .modal-header .title-row {+/* The note-title header (icon + editable title) is shared with the tree popup, which reuses the same+ TitleRow; keep both selectors together so the two dialogs stay pixel-identical. */+.modal.popup-editor-dialog .modal-header .title-row,+.modal.tree-popup-editor-dialog .modal-header .title-row {flex-grow: 1;display: flex;align-items: center;@@ -48,7 +51,8 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {}}-.modal.popup-editor-dialog .modal-header .note-title-widget {+.modal.popup-editor-dialog .modal-header .note-title-widget,+.modal.tree-popup-editor-dialog .modal-header .note-title-widget {display: flex;align-items: center;}@@ -63,17 +67,22 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {.modal.popup-editor-dialog .title-row,.modal.popup-editor-dialog .modal-title,-.modal.popup-editor-dialog .note-icon-widget {+.modal.popup-editor-dialog .note-icon-widget,+.modal.tree-popup-editor-dialog .title-row,+.modal.tree-popup-editor-dialog .note-icon-widget {height: 32px;min-height: unset;}-:root div.modal.popup-editor-dialog div.note-title-widget {+:root div.modal.popup-editor-dialog div.note-title-widget,+:root div.modal.tree-popup-editor-dialog div.note-title-widget {--note-title-padding-inline: 8px;}.modal.popup-editor-dialog .note-icon-widget button.note-icon,-.modal.popup-editor-dialog .note-title-widget input.note-title {+.modal.popup-editor-dialog .note-title-widget input.note-title,+.modal.tree-popup-editor-dialog .note-icon-widget button.note-icon,+.modal.tree-popup-editor-dialog .note-title-widget input.note-title {font-size: 1em;}diff --git a/apps/client/src/widgets/dialogs/TreePopupEditor.css b/apps/client/src/widgets/dialogs/TreePopupEditor.cssindex 621a1dac5a..1f356857a5 100644--- a/apps/client/src/widgets/dialogs/TreePopupEditor.css+++ b/apps/client/src/widgets/dialogs/TreePopupEditor.css@@ -6,6 +6,10 @@.modal.tree-popup-editor-dialog .modal-content {height: 80vh;++ .note-detail-doc-content {+ padding: unset;+ }}/* Sidebar holding the hoisted note tree. */@@ -30,9 +34,5 @@ body.desktop .modal.tree-popup-editor-dialog .modal-sidebar {height: 100%;}-.modal.tree-popup-editor-dialog .tree-popup-editor-title {- display: flex;- align-items: center;- gap: 0.35em;- margin-bottom: 0.5em;-}+/* The header note title (icon + editable title) reuses the quick-edit TitleRow styling — see the+ shared `.popup-editor-dialog, .tree-popup-editor-dialog` rules in PopupEditor.css. */diff --git a/apps/client/src/widgets/dialogs/TreePopupEditor.tsx b/apps/client/src/widgets/dialogs/TreePopupEditor.tsxindex 0131a7fe2f..39628bb1b0 100644--- a/apps/client/src/widgets/dialogs/TreePopupEditor.tsx+++ b/apps/client/src/widgets/dialogs/TreePopupEditor.tsx@@ -4,7 +4,6 @@ import { useCallback, useContext, useRef, useState } from "preact/hooks";import appContext from "../../components/app_context";import NoteContext from "../../components/note_context";-import { t } from "../../services/i18n";import NoteTreeWidget from "../note_tree";import NoteDetail from "../NoteDetail";import PromotedAttributes from "../PromotedAttributes";@@ -55,7 +54,10 @@ export default function TreePopupEditor() {<NoteContextContext.Provider value={noteContext}><ModalmodalRef={modalRef}- title={t("tree-popup.title")}+ // Reuse the quick-edit note header (icon + editable title); it lives in the main+ // header, so skip the sidebar header that would otherwise duplicate it.+ title={<TitleRow />}+ hideSidebarHeaderclassName="tree-popup-editor-dialog"size="xl"sidebar={<TreeSidebar noteContext={noteContext} />}@@ -65,7 +67,6 @@ export default function TreePopupEditor() {scrollablestackable>- <div className="tree-popup-editor-title"><TitleRow /></div><PromotedAttributes /><NoteDetail /></Modal>diff --git a/apps/client/src/widgets/react/Modal.tsx b/apps/client/src/widgets/react/Modal.tsxindex ab312cb170..831354cc1f 100644--- a/apps/client/src/widgets/react/Modal.tsx+++ b/apps/client/src/widgets/react/Modal.tsx@@ -85,13 +85,19 @@ export interface ModalProps {* spanning the entire height alongside the header, body and footer.*/sidebar?: ComponentChildren;+ /**+ * By default a sidebar modal repeats {@link title} as a header above the sidebar. Set this to+ * skip that header — useful when {@link title} is the active note's own title (which belongs in+ * the main header, not duplicated over the sidebar).+ */+ hideSidebarHeader?: boolean;/*** Indicates if the dialog will be displayed as a full page on mobile devices.*/isFullPageOnMobile?: boolean;}-export default function Modal({ children, className, size, title, customTitleBarButtons: titleBarButtons, header, footer, footerStyle, footerAlignment, onShown, onSubmit, helpPageId, minWidth, maxWidth, zIndex, scrollable, onHidden, modalRef: externalModalRef, formRef, bodyStyle, show, stackable, keepInDom, noFocus, sidebar, isFullPageOnMobile }: ModalProps) {+export default function Modal({ children, className, size, title, customTitleBarButtons: titleBarButtons, header, footer, footerStyle, footerAlignment, onShown, onSubmit, helpPageId, minWidth, maxWidth, zIndex, scrollable, onHidden, modalRef: externalModalRef, formRef, bodyStyle, show, stackable, keepInDom, noFocus, sidebar, hideSidebarHeader, isFullPageOnMobile }: ModalProps) {const modalRef = useSyncedRef<HTMLDivElement>(externalModalRef);const modalInstanceRef = useRef<BootstrapModal>();const elementToFocus = useRef<Element | null>();@@ -158,7 +164,7 @@ export default function Modal({ children, className, size, title, customTitleBar{(show || keepInDom) && <div className={clsx("modal-dialog", `modal-${size}`, {"modal-dialog-scrollable": scrollable, "modal-dialog-full-page-on-mobile": isFullPageOnMobile, "modal-content-with-sidebar": sidebar})} style={documentStyle} role="document"><div className={clsx("modal-content", sidebar && "modal-content-with-sidebar")}>{sidebar && <div className="modal-sidebar">- {title && <div className="modal-sidebar-header">+ {title && !hideSidebarHeader && <div className="modal-sidebar-header"><h5>{title}</h5></div>}{sidebar}