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
fix(clipper): keep the card compact for a bookmark of a PDF
Elian Dorandf334cfe1782
diff --git a/apps/web-clipper/entrypoints/popup/main.tsx b/apps/web-clipper/entrypoints/popup/main.tsxindex 404b799db7..ca0cb0f0bc 100644--- a/apps/web-clipper/entrypoints/popup/main.tsx+++ b/apps/web-clipper/entrypoints/popup/main.tsx@@ -571,7 +571,7 @@ function PagePreview({ tab, disabled, shortcuts, draft, onDraftChange, saveState)}{mode === "pdf" && <div className="clip-hint">The PDF is saved as a file in Trilium.</div>}- <div className={mode === "pdf" ? "page-body pdf" : "page-body"}>+ <div className={tab?.pdf ? "page-body pdf" : "page-body"}>{mode && (<div className={mode === "note" ? "page-fields bookmark" : "page-fields"}>{mode !== "pdf" && (diff --git a/apps/web-clipper/entrypoints/popup/popup.css b/apps/web-clipper/entrypoints/popup/popup.cssindex 0f1aece4b6..0cc6b4d592 100644--- a/apps/web-clipper/entrypoints/popup/popup.css+++ b/apps/web-clipper/entrypoints/popup/popup.css@@ -192,6 +192,10 @@ body {.page-fields {border-bottom: 0;}++ .page-fields.bookmark .note-text {+ min-height: auto;+ }}&:has(.page-content)::after {diff --git a/apps/web-clipper/entrypoints/popup/popup.spec.tsx b/apps/web-clipper/entrypoints/popup/popup.spec.tsxindex ed389a9e00..53ee1013e0 100644--- a/apps/web-clipper/entrypoints/popup/popup.spec.tsx+++ b/apps/web-clipper/entrypoints/popup/popup.spec.tsx@@ -464,6 +464,7 @@ describe("popup", () => {expect(modes()).toEqual([ [ "Page", "false" ], [ "Bookmark", "true" ] ]);const textArea = container.querySelector(".page-body .page-fields.bookmark .note-text");expect(textArea).not.toBeNull();+ expect(container.querySelector(".page-body")?.className).toBe("page-body");expect(document.activeElement).toBe(textArea);expect(container.querySelector<HTMLElement>(".page-field:first-child > .page-field-icon")?.title).toBe("Your note about the page. It is saved as the content of the note.");@@ -796,6 +797,7 @@ describe("popup", () => {await click("Bookmark");expect(button("Save bookmark")?.disabled).toBe(false);+ expect(container.querySelector(".page-body")?.className).toBe("page-body pdf");expect(container.querySelector(".note-text")).not.toBeNull();expect(container.querySelector(".clip-hint")).toBeNull();});