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
feat(options): add page title banner with circular icon to content area
Elian Doran028fb27ce052
diff --git a/apps/client/src/widgets/dialogs/OptionsDialog.css b/apps/client/src/widgets/dialogs/OptionsDialog.cssindex 71cf137228..643f513e41 100644--- a/apps/client/src/widgets/dialogs/OptionsDialog.css+++ b/apps/client/src/widgets/dialogs/OptionsDialog.css@@ -37,6 +37,58 @@ body.desktop .modal.options-dialog .modal-main > .modal-header {margin: auto;}+/* Page title banner at the top of the content area. Aligns with the centered option cards and+ reuses the quick-edit popup's title-row look: the page icon sits in a circular badge (same+ --note-icon-* theme tokens as the popup's note icon) beside the page title. */+.modal.options-dialog .options-page-header {+ display: flex;+ align-items: center;+ gap: 12px;+ max-width: var(--options-card-max-width);+ margin: 0 auto;+ /* Leave room for the floating window buttons and breathing space above the first card. */+ padding: 18px 0 6px;+}++.modal.options-dialog .options-page-header-icon {+ --badge-size: 40px;++ position: relative;+ flex: 0 0 auto;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: var(--badge-size);+ height: var(--badge-size);+ font-size: 22px;+ line-height: 1;+}++/* The glyph, painted above the circle. */+.modal.options-dialog .options-page-header-icon::before {+ position: relative;+ z-index: 1;+ color: var(--note-icon-color);+}++/* The circular background behind the glyph. */+.modal.options-dialog .options-page-header-icon::after {+ content: "";+ position: absolute;+ inset: 0;+ border-radius: 50%;+ background: var(--note-icon-background-color);+}++.modal.options-dialog .options-page-header-title {+ margin: 0;+ font-size: 1.4rem;+ font-weight: 600;+ overflow: hidden;+ white-space: nowrap;+ text-overflow: ellipsis;+}+/* The dialog fills the full mobile page (isFullPageOnMobile), so the body stretches instead ofusing the fixed desktop height. Applies to both the master-detail and the tablet layout. */body.mobile .modal.options-dialog .modal-body {diff --git a/apps/client/src/widgets/dialogs/OptionsDialog.tsx b/apps/client/src/widgets/dialogs/OptionsDialog.tsxindex c3c467ce96..dae0647ef4 100644--- a/apps/client/src/widgets/dialogs/OptionsDialog.tsx+++ b/apps/client/src/widgets/dialogs/OptionsDialog.tsx@@ -97,6 +97,7 @@ export default function OptionsDialog() {}} /></div>)}+ {!isMasterDetail && <OptionsPageHeader />}<NoteDetail /></Modal></NoteContextContext.Provider>@@ -170,6 +171,24 @@ function MobileSettingsList({ onSelect }: { onSelect: (noteId: string) => void });}+/**+ * The title banner shown at the top of the content area on desktop and tablet layouts, where the+ * page title isn't otherwise visible (the modal header only carries the window buttons). It mirrors+ * the quick-edit popup's title row — the page's icon in a circular badge beside the title — but is+ * purely decorative since settings pages aren't user-editable. On the mobile master-detail flow the+ * page title already lives in the modal header (see {@link MobilePageHeader}), so this is omitted.+ */+function OptionsPageHeader() {+ const { note } = useNoteContext();+ if (!note) return null;+ return (+ <div className="options-page-header">+ <span className={`options-page-header-icon ${note.getIcon()}`} aria-hidden="true" />+ <h2 className="options-page-header-title">{note.title}</h2>+ </div>+ );+}+/*** Replaces the static "Options" title on mobile. In the page view it shows a back button returning* to the master list followed by the title of the page in view; in the list view a decorative