From 392d7e90f644e1075a115564f6b2afd70a8db626 Mon Sep 17 00:00:00 2001 From: Bogdan Abaev Date: Tue, 21 Apr 2026 19:09:55 -0700 Subject: [PATCH] fix spacing and info in details popup --- .../integration/citationDialog/popupHandler.mjs | 11 ++++++++--- scss/components/_citationDialog.scss | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/integration/citationDialog/popupHandler.mjs b/chrome/content/zotero/integration/citationDialog/popupHandler.mjs index 1d1ce61f34..09bcd345b7 100644 --- a/chrome/content/zotero/integration/citationDialog/popupHandler.mjs +++ b/chrome/content/zotero/integration/citationDialog/popupHandler.mjs @@ -99,14 +99,19 @@ export class CitationDialogPopupsHandler { popup.style.top = `${bubbleRect.bottom + 10}px`; this._getNode("#itemDetails .show").hidden = !this.bubbleItem.item.id; - let topLevelItem = this.bubbleItem.item.topLevelItem; + // For notes, show the note's own title and icon rather than walking + // up to the parent item. + let displayItem = this.bubbleItem.item; + if (!displayItem.isNote()) { + displayItem = displayItem.topLevelItem; + } // Add header and fill inputs with their values let description = itemDescription; this._getNode("#itemDetails").querySelector(".description")?.remove(); - this._getNode("#itemTitle").textContent = topLevelItem.getDisplayTitle(); + this._getNode("#itemTitle").textContent = displayItem.getDisplayTitle(); this._getNode("#itemTitle").after(description); - let dataTypeLabel = topLevelItem.getItemTypeIconName(true); + let dataTypeLabel = displayItem.getItemTypeIconName(true); this._getNode("#itemDetails").querySelector(".icon").setAttribute("data-item-type", dataTypeLabel); bubble.classList.add("showingDetails"); diff --git a/scss/components/_citationDialog.scss b/scss/components/_citationDialog.scss index ab3686b95b..e28a726e89 100644 --- a/scss/components/_citationDialog.scss +++ b/scss/components/_citationDialog.scss @@ -978,4 +978,12 @@ } } } + #itemDetails .popup { + .details-header .description { + margin-top: 4px; + } + .buttons { + margin-top: 16px; + } + } }