Skip to content

Build your personal knowledge base with Trilium Notes

feat(options): make the page title banner sticky to the content area

Elian Dorand7e7d38b1691
diff --git a/apps/client/src/widgets/dialogs/OptionsDialog.css b/apps/client/src/widgets/dialogs/OptionsDialog.css
index 643f513e41..877ad56fe4 100644
--- a/apps/client/src/widgets/dialogs/OptionsDialog.css
+++ b/apps/client/src/widgets/dialogs/OptionsDialog.css
@@ -37,17 +37,27 @@ 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. */
+/* Page title banner at the top of the content area. The outer bar spans the full content width and
+ sticks to the top of the scrolling body (with the modal background painted behind it so cards
+ scroll cleanly beneath); the inner row aligns with the centered option cards. 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 {
+ position: sticky;
+ top: 0;
+ z-index: 1;
+ background: var(--modal-background-color);
+ border-bottom: 1px solid var(--main-border-color);
+}
+
+.modal.options-dialog .options-page-header-inner {
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;
+ /* Leave room for the floating window buttons and breathing space around the title. */
+ padding: 14px 0;
}
.modal.options-dialog .options-page-header-icon {
diff --git a/apps/client/src/widgets/dialogs/OptionsDialog.tsx b/apps/client/src/widgets/dialogs/OptionsDialog.tsx
index dae0647ef4..ed2de35133 100644
--- a/apps/client/src/widgets/dialogs/OptionsDialog.tsx
+++ b/apps/client/src/widgets/dialogs/OptionsDialog.tsx
@@ -183,8 +183,10 @@ function OptionsPageHeader() {
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 className="options-page-header-inner">
+ <span className={`options-page-header-icon ${note.getIcon()}`} aria-hidden="true" />
+ <h2 className="options-page-header-title">{note.title}</h2>
+ </div>
</div>
);
}