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(geomap): let the add button wear the pin it drops
Elian Doran6444b1831b54
diff --git a/apps/client/src/widgets/collections/geomap/ContextMenus.ts b/apps/client/src/widgets/collections/geomap/ContextMenus.tsindex fc0dea2c30..aa2e3e4715 100644--- a/apps/client/src/widgets/collections/geomap/ContextMenus.ts+++ b/apps/client/src/widgets/collections/geomap/ContextMenus.ts@@ -118,7 +118,8 @@ export function openMapContextMenu(e: GeoMouseEvent, isEditable: boolean, onCrea// The click named the place already, so this skips the armed-click step entirely:// the note is created here and the pane opened on it, like any other creation.handler: () => onCreateNote(e),- uiIcon: "bx bx-plus"+ // The pin a dropped note wears, as on the editing group's button (see EditToolbar).+ uiIcon: "bx bx-pin"}];}diff --git a/apps/client/src/widgets/collections/geomap/EditToolbar.spec.tsx b/apps/client/src/widgets/collections/geomap/EditToolbar.spec.tsxindex 8a34bcc060..ce1a3d0071 100644--- a/apps/client/src/widgets/collections/geomap/EditToolbar.spec.tsx+++ b/apps/client/src/widgets/collections/geomap/EditToolbar.spec.tsx@@ -40,8 +40,8 @@ describe("geo map EditToolbar", () => {const { button, onTogglePlacement } = renderBar();// The glyph is a child of the button rather than the button's own class — the words beside- // it are to stay words (see EditToolbar.tsx).- expect(button()?.querySelector(".bx-plus")).not.toBeNull();+ // it are to stay words — and it is the pin a dropped note wears (see EditToolbar.tsx).+ expect(button()?.querySelector(".bx-pin")).not.toBeNull();expect(button()?.classList.contains("active")).toBe(false);act(() => button()?.click());diff --git a/apps/client/src/widgets/collections/geomap/EditToolbar.tsx b/apps/client/src/widgets/collections/geomap/EditToolbar.tsxindex 8e989dcea8..2b2a00c817 100644--- a/apps/client/src/widgets/collections/geomap/EditToolbar.tsx+++ b/apps/client/src/widgets/collections/geomap/EditToolbar.tsx@@ -66,9 +66,12 @@ export default function EditToolbar({ isReadOnly, placing, onTogglePlacement, ondisabled={isReadOnly}onClick={onTogglePlacement}>- {/* The glyph is a child rather than a class on the button: the boxicons class sets- the icon font on whatever wears it, and the words beside it are to stay words. */}- <span className="bx bx-plus" aria-hidden="true"></span>+ {/* The pin a note dropped on the map wears (see CHILD_NOTE_ICON in api.ts) — the+ button shows the very thing it drops, which is also the ghost that will follow+ the pointer once armed. A child rather than a class on the button: the boxicons+ class sets the icon font on whatever wears it, and the words beside it are to+ stay words. */}+ <span className="bx bx-pin" aria-hidden="true"></span>{placing ? t("geo-map.add-marker-cancel") : t("geo-map.add-marker")}</button><button