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(calendar): maximize the event popover into the quick editor
Elian Doranbe0dcb8f41e1
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 149def5669..a3445580fb 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -1007,6 +1007,7 @@"pin_date": "Pin the current date so the calendar always opens on this interval instead of today","unpin_date": "Unpin the date so the calendar opens on today's date again","close_details": "Close event details",+ "maximize_details": "Open in quick edit","dates": {"all_day": "All day","date": "Date",diff --git a/apps/client/src/widgets/collections/calendar/EventPopover.css b/apps/client/src/widgets/collections/calendar/EventPopover.cssindex 225de5261d..459f1497b4 100644--- a/apps/client/src/widgets/collections/calendar/EventPopover.css+++ b/apps/client/src/widgets/collections/calendar/EventPopover.css@@ -22,6 +22,17 @@flex: 1;min-width: 0;}++ /* The maximize button, dressed as the X beside it is (see "The 'x' icon button" in+ theme-next/forms.css) minus the red close hover: the same small round surface, with the+ stock hover underneath. The icon keeps the stock ratio rather than the X's 0.8 — the+ expand glyph fills its em box where the X's does not, so the stock size is what stands+ at the X's visual weight. */+ > .icon-action.bx-expand-alt {+ --icon-button-size: 24px;++ border-radius: 50%;+ }}/* The note's own widgets are laid out by the shared class (see EmbeddedNotePane.css), whichdiff --git a/apps/client/src/widgets/collections/calendar/EventPopover.tsx b/apps/client/src/widgets/collections/calendar/EventPopover.tsxindex 63580205a4..e1630887dc 100644--- a/apps/client/src/widgets/collections/calendar/EventPopover.tsx+++ b/apps/client/src/widgets/collections/calendar/EventPopover.tsx@@ -2,6 +2,7 @@ import "./EventPopover.css";import { useCallback, useEffect, useRef } from "preact/hooks";+import appContext from "../../../components/app_context";import FNote from "../../../entities/fnote";import { t } from "../../../services/i18n";import { announceEmbeddedNoteClosing, EmbeddedNoteActions, EmbeddedNoteScope, NoteColorAction, OpenNoteActions, useEmbeddedNoteContext } from "../../EmbeddedNotePane";@@ -114,6 +115,21 @@ function EventDetails({ note, parentNote, isEditable, onClose }: {<div className="calendar-event-popover-inner" ref={innerRef}><div className="calendar-event-popover-header"><TitleRow compact />+ {/* The popover grown into the quick editor: the same note in the larger surface,+ taking the popover's place rather than standing over it — opened first and+ closed after, as the quick editor's own maximize hands over to a tab. A path+ rather than an id, as the more-ways-to-open menu passes one (see+ OpenNoteActions), so the two roads into the quick editor agree. */}+ <ActionButton+ icon="bx bx-expand-alt"+ text={t("calendar.maximize_details")}+ onClick={() => {+ const notePath = note.getBestNotePathString(+ appContext.tabManager.getActiveContext()?.hoistedNoteId);+ appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath || note.noteId });+ onClose();+ }}+ /><ActionButtonicon="bx bx-x"text={t("calendar.close_details")}