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
client/collections/board: tweaks
Adorian Doran303cddefc195
diff --git a/apps/client/src/widgets/collections/board/card.tsx b/apps/client/src/widgets/collections/board/card.tsxindex 2cc7c05fa0..87bebdff6a 100644--- a/apps/client/src/widgets/collections/board/card.tsx+++ b/apps/client/src/widgets/collections/board/card.tsx@@ -308,11 +308,13 @@ function Card({<HighlightedTextclassName="text" text={title} highlightedTokens={highlightedTokens} /></span>- <span+ {/* On mobile the rail offers the rename, and a hover-revealed icon has no+ hover to be revealed by. */}+ {!isMobile() && <spanclassName="edit-icon icon bx bx-edit"title={t("board_view.edit-note-title")}onClick={handleEdit}- />+ />}</>) : (<TitleEditordiff --git a/apps/client/src/widgets/collections/board/card_toolbar.css b/apps/client/src/widgets/collections/board/card_toolbar.cssindex ffbf58d08b..c1640dea2d 100644--- a/apps/client/src/widgets/collections/board/card_toolbar.css+++ b/apps/client/src/widgets/collections/board/card_toolbar.css@@ -39,8 +39,8 @@}}-/* The icon above it turned over: an addition at the foot of the list rather than at its head. */-.board-view-container .board-card-toolbar .board-insert-below-button::before {+/* The list's plus sits at its foot, so the head is the same glyph turned over. */+.board-view-container .board-card-toolbar .board-insert-above-button::before {display: inline-block;transform: scaleY(-1);}diff --git a/apps/client/src/widgets/collections/board/card_toolbar.tsx b/apps/client/src/widgets/collections/board/card_toolbar.tsxindex 4ed7dd68b1..31a4084246 100644--- a/apps/client/src/widgets/collections/board/card_toolbar.tsx+++ b/apps/client/src/widgets/collections/board/card_toolbar.tsx@@ -55,12 +55,12 @@ export default function CardToolbar({<OverlayControlButtontitle={t("board_view.insert-above")}icon="bx-list-plus"+ className="board-insert-above-button"onClick={onInsertAbove}/><OverlayControlButtontitle={t("board_view.insert-below")}icon="bx-list-plus"- className="board-insert-below-button"onClick={onInsertBelow}/></>)}diff --git a/apps/client/src/widgets/collections/board/index.spec.tsx b/apps/client/src/widgets/collections/board/index.spec.tsxindex bf41d46850..d9c63cbc5f 100644--- a/apps/client/src/widgets/collections/board/index.spec.tsx+++ b/apps/client/src/widgets/collections/board/index.spec.tsx@@ -4867,9 +4867,12 @@ describe("Card toolbar on mobile", () => {expect(buttons()).toEqual(["bx-rename", "bx-list-plus", "bx-list-plus", "bx-task-x", "bx-dots-vertical-rounded"]);- // The second insert is the one below, told apart by the class its icon is turned over by.- expect(toolbar()?.querySelectorAll("button")[2].classList- .contains("board-insert-below-button")).toBe(true);+ // Above first, then below. The glyph's plus sits at the foot of its list, so the one+ // above is told apart by the class that turns it over.+ expect(toolbar()?.querySelectorAll("button")[1].classList+ .contains("board-insert-above-button")).toBe(true);+ // The rail offers the rename, so the card's own hover-revealed icon is left out.+ expect(card("tool1").querySelector(".edit-icon")).toBeNull();// Portaled onto the board, whose edge the rail is pinned to, rather than into the card.expect(toolbar()?.parentElement).toBe(container.querySelector(".board-view-container"));@@ -4899,7 +4902,7 @@ describe("Card toolbar on mobile", () => {// Insert below opens the field under the card, which takes the focus and the rail with it.await focus("tool1");await act(async () => {- button("board-insert-below-button").click();+ toolbar()?.querySelectorAll<HTMLElement>("button")[2].click();await flush();});const column = container.querySelectorAll(".board-column")[0];