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(calendar): head the event sheet as the quick editor heads a note
Elian Dorand369fd3ec997
diff --git a/apps/client/src/widgets/collections/calendar/EventPopover.css b/apps/client/src/widgets/collections/calendar/EventPopover.cssindex ee8e5ded76..6b4f99beb2 100644--- a/apps/client/src/widgets/collections/calendar/EventPopover.css+++ b/apps/client/src/widgets/collections/calendar/EventPopover.css@@ -50,20 +50,27 @@}/*- * The same event as a sheet (see EventSheet): the dialog brings the surface, what heads it and the- * way out, so the body gives up the padding and the scrolling it kept for itself in the popover —- * a full-page dialog scrolls its own body — and stands as the plain column the shared class makes- * of it.+ * The same event as a sheet (see EventSheet). What heads it, the surface and the way out are the+ * dialog's, and its head is dressed as the quick editor's (see the shared rules in+ * PopupEditor.css); what is left here is how tall it stands and the body inside it.*/-.calendar-event-sheet .calendar-event-popover-body {+.modal.calendar-event-sheet .modal-dialog {+ /* As tall as a dialog may stand, the quick editor's own bargain: a note's editor wants the+ room, and a sheet sized to its contents would jump between one event and the next. */+ max-height: var(--tn-modal-max-height);+ height: 100%;+}++/* The head carries a background of its own, which would square off the corners the dialog is+ rounded by — the very thing a page-high sheet gives up (see EventSheet). */+.modal.calendar-event-sheet .modal-content {+ overflow: hidden;+}++/* The body gives up the padding and the scrolling it keeps for itself in the popover: the dialog+ scrolls its own (`scrollable`), and pads it. */+.modal.calendar-event-sheet .calendar-event-popover-body {padding: 0;overflow: visible;scrollbar-gutter: auto;}--/* The note's title row is the dialog's title, so it takes the header's room as a title would —- the close button beside it keeping its own. */-.calendar-event-sheet .modal-header > .title-row {- flex: 1;- min-width: 0;-}diff --git a/apps/client/src/widgets/collections/calendar/EventPopover.tsx b/apps/client/src/widgets/collections/calendar/EventPopover.tsxindex 06bc9a45f3..bc6bd1e71d 100644--- a/apps/client/src/widgets/collections/calendar/EventPopover.tsx+++ b/apps/client/src/widgets/collections/calendar/EventPopover.tsx@@ -130,12 +130,15 @@ function EventPopoverShell({ note, anchorRect, updateKey, parentNote, isEditable/*** The event as a phone shows it: the sheet the app raises its dialogs as, rising from the foot of- * the screen (see `body.mobile .modal-dialog` in style.css). Given the whole page rather than the- * standing 85% of it, since what it holds is a note's own editor and a sheet would spend half the- * screen on the calendar behind it.+ * the screen (see `body.mobile .modal-dialog` in style.css).*- * The note's title row heads the dialog rather than standing inside it, which is what the sheet- * has a header for; Escape and the backdrop are the dialog's own to answer.+ * Dressed as the quick editor is, that being the app's own way of showing a whole note over+ * whatever raised it — the note's title row heading the dialog rather than standing inside it, at+ * the height it stands there (see the shared rules in PopupEditor.css). It rises to what a dialog+ * may take rather than to the whole page, as the quick editor does: a page-high sheet squares off+ * the corners the app rounds every dialog by, and gains nothing for it.+ *+ * Escape and the backdrop are the dialog's own to answer.*/function EventSheet({ note, parentNote, isEditable, onClose }: {note: FNote;@@ -161,8 +164,7 @@ function EventSheet({ note, parentNote, isEditable, onClose }: {<ModalclassName="calendar-event-sheet"size="lg"- title={<TitleRow compact />}- isFullPageOnMobile+ title={<TitleRow />}scrollablemodalRef={modalRef}show={shown}diff --git a/apps/client/src/widgets/dialogs/PopupEditor.css b/apps/client/src/widgets/dialogs/PopupEditor.cssindex 509c4b4f1f..a9ad3a8916 100644--- a/apps/client/src/widgets/dialogs/PopupEditor.css+++ b/apps/client/src/widgets/dialogs/PopupEditor.css@@ -35,10 +35,13 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {font-size: 1.1em;}-/* 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. */+/* The note-title header (icon + editable title) is shared with the tree popup and the calendar's+ event sheet, which reuse the same TitleRow; keep the selectors together so the dialogs stay+ pixel-identical. This file is loaded wherever the app is: the quick editor keeps itself in the+ DOM and so is never lazily loaded (see layout_commons.tsx). */.modal.popup-editor-dialog .modal-header .title-row,-.modal.tree-popup-editor-dialog .modal-header .title-row {+.modal.tree-popup-editor-dialog .modal-header .title-row,+.modal.calendar-event-sheet .modal-header .title-row {flex-grow: 1;display: flex;align-items: center;@@ -52,7 +55,8 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {}.modal.popup-editor-dialog .modal-header .note-title-widget,-.modal.tree-popup-editor-dialog .modal-header .note-title-widget {+.modal.tree-popup-editor-dialog .modal-header .note-title-widget,+.modal.calendar-event-sheet .modal-header .note-title-widget {display: flex;align-items: center;}@@ -80,20 +84,25 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {.modal.popup-editor-dialog .modal-title,.modal.popup-editor-dialog .note-icon-widget,.modal.tree-popup-editor-dialog .title-row,-.modal.tree-popup-editor-dialog .note-icon-widget {+.modal.tree-popup-editor-dialog .note-icon-widget,+.modal.calendar-event-sheet .title-row,+.modal.calendar-event-sheet .note-icon-widget {height: 32px;min-height: unset;}:root div.modal.popup-editor-dialog div.note-title-widget,-:root div.modal.tree-popup-editor-dialog div.note-title-widget {+:root div.modal.tree-popup-editor-dialog div.note-title-widget,+:root div.modal.calendar-event-sheet 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.tree-popup-editor-dialog .note-icon-widget button.note-icon,-.modal.tree-popup-editor-dialog .note-title-widget input.note-title {+.modal.tree-popup-editor-dialog .note-title-widget input.note-title,+.modal.calendar-event-sheet .note-icon-widget button.note-icon,+.modal.calendar-event-sheet .note-title-widget input.note-title {font-size: 1em;}