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: fix some issues
Adorian Doran4969fb2c79bb
diff --git a/apps/client/src/widgets/collections/board/api.spec.ts b/apps/client/src/widgets/collections/board/api.spec.tsindex 547731dac1..218290f5d7 100644--- a/apps/client/src/widgets/collections/board/api.spec.ts+++ b/apps/client/src/widgets/collections/board/api.spec.ts@@ -594,8 +594,8 @@ describe("BoardApi card operations", () => {});/**- * The relation is read under both names, so a board written before the rename still- * redirects. Stated as literals: these are what a reader types, not what the code calls it.+ * `openCard` reads both names. Written as literals rather than as the constants, so the+ * test pins the attribute names users type.*/it.each([ "board:cardRedirectTo", "boardCardRedirectTo" ])("redirects through the %s relation", (relation) => {diff --git a/apps/client/src/widgets/collections/board/api.ts b/apps/client/src/widgets/collections/board/api.tsindex 0c94ab0a9c..77cd1f3771 100644--- a/apps/client/src/widgets/collections/board/api.ts+++ b/apps/client/src/widgets/collections/board/api.ts@@ -42,7 +42,7 @@ export type CardPlacement = "top" | "bottom";/** The relation a card carries to stand in for another note rather than open an editor of its own. */export const CARD_REDIRECT_RELATION = "board:cardRedirectTo";-/** The name the relation above shipped under. Still read, so boards already using it keep working. */+/** The previous name of the relation above. `openCard` falls back to it. */export const CARD_REDIRECT_RELATION_LEGACY = "boardCardRedirectTo";/** One write's claim on a column, held until that write lands or is taken back. */diff --git a/apps/client/src/widgets/collections/board/column.tsx b/apps/client/src/widgets/collections/board/column.tsxindex 0a2669be64..0760e2ab5e 100644--- a/apps/client/src/widgets/collections/board/column.tsx+++ b/apps/client/src/widgets/collections/board/column.tsx@@ -214,7 +214,7 @@ export default function Column({useContext(BoardActionsContext);const { branchIdToEdit, columnNameToEdit, draggedCard, draggedColumn } =useContext(BoardDragStateContext);- // The store itself, for the menu entry that picks out the whole column.+ // Read for the `Select all cards` menu entry, which calls `selection.selectAll`.const selection = useSelection();// Every card on the move. The one under the pointer is taken out of the flow by the gesture// itself; the rest of a carried selection stay where they are drawn and are dimmed instead.diff --git a/apps/client/src/widgets/collections/board/index.css b/apps/client/src/widgets/collections/board/index.cssindex 25f056ba69..585d5769b8 100644--- a/apps/client/src/widgets/collections/board/index.css+++ b/apps/client/src/widgets/collections/board/index.css@@ -10,8 +10,8 @@--board-item-hover-background-saturation: 100%;--board-item-hover-background-lightness: 98.5%;- /* What a card stands on while its title is being typed. The pointer leaves the card as the- reader moves to the field, so this is the hover lightness and the colour does not change. */+ /* The background of a card being edited. Set to the hover lightness so the colour does not+ change when the pointer leaves the card. */--board-item-editing-background-lightness: var(--board-item-hover-background-lightness);/* The inbox's own surfaces. It holds what has not been sorted yet, so it stands on the boarddiff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsxindex 979fad7cd6..f7189e5abe 100644--- a/apps/client/src/widgets/collections/board/index.tsx+++ b/apps/client/src/widgets/collections/board/index.tsx@@ -1877,7 +1877,7 @@ export function TitleEditor({* that would have ended the edit being spent.*/const isHoldingOpen = useRef(false);- /** The box holding the field and the picker, against which focus is told inside from outside. */+ /** The box holding the field and the picker. `iconFocusOut` tests `relatedTarget` against it. */const fieldRef = useRef<HTMLDivElement>(null);const iconRef = useRef<HTMLSpanElement>(null);/**@@ -2085,8 +2085,8 @@ export function TitleEditor({};/**- * Ends the edit once the picker hands focus on to something outside the field's own box.- * Focus going back to the field, or into the picker's menu, leaves the editor where it is.+ * Ends the edit when focus moves outside `fieldRef`. A `relatedTarget` inside it is the field+ * itself; `isHoldingOpen` covers the picker's menu, which is drawn outside `fieldRef`.*/function iconFocusOut(e: JSX.TargetedFocusEvent<HTMLSpanElement>) {isIconFocused.current = false;diff --git a/apps/client/src/widgets/collections/board/keyboard.ts b/apps/client/src/widgets/collections/board/keyboard.tsindex 5edb8de935..8b184a363e 100644--- a/apps/client/src/widgets/collections/board/keyboard.ts+++ b/apps/client/src/widgets/collections/board/keyboard.ts@@ -304,7 +304,7 @@ export function useBoardKeyboard({// back towards where the range began, and carries focus with it.if (e.shiftKey && RANGE_KEYS.includes(e.key)) {// A header and the button under a column hold no card, so a range starts at neither.- // The press is left to the browser there, as it was before the board answered for it.+ // The key is left to the browser there.if (spot.kind !== "item") return;// Taken whether or not it leads anywhere: a card at the end of its column is no reasondiff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.htmlindex d20c5ad466..0b29ef8361 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html@@ -353,6 +353,8 @@<li>To select a continuous sequence of cards within a column, hold <kbd>Shift</kbd> anduse the <kbd>Up</kbd> and <kbd>Down</kbd> arrow keys to expand or shrink theselection.</li>+ <li>To select every card in the column the focus is in, press <kbd>Ctrl</kbd> + <kbd>A</kbd>.+ The same action is available from the column menu, as <span class="tn-icon bx bx-selection"></span> <strong>Select all cards</strong>.</li><li>Press <kbd>Esc</kbd> to clear the selection.</li></ul></li>diff --git a/docs/User Guide/User Guide/Collections/Kanban Board.md b/docs/User Guide/User Guide/Collections/Kanban Board.mdindex c0544f8595..11983669be 100644--- a/docs/User Guide/User Guide/Collections/Kanban Board.md+++ b/docs/User Guide/User Guide/Collections/Kanban Board.md@@ -211,6 +211,7 @@ You can select multiple cards in the following ways:* **Using only the keyboard:*** To add the currently focused card to the selection, press <kbd>Ctrl</kbd> + <kbd>Space</kbd>. Repeat this for the other cards you want to select. Pressing <kbd>Ctrl</kbd> + <kbd>Space</kbd> again on a selected card will deselect it.* To select a continuous sequence of cards within a column, hold <kbd>Shift</kbd> and use the <kbd>Up</kbd> and <kbd>Down</kbd> arrow keys to expand or shrink the selection.+ * To select every card in the column the focus is in, press <kbd>Ctrl</kbd> + <kbd>A</kbd>. The same action is available from the column menu, as <span class="tn-icon bx bx-selection"></span> **Select all cards**.* Press <kbd>Esc</kbd> to clear the selection.### Moving cards between columnsdiff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.tsindex b0f03e482f..3ab0e100bd 100644--- a/packages/commons/src/lib/builtin_attributes.ts+++ b/packages/commons/src/lib/builtin_attributes.ts@@ -271,7 +271,7 @@ const BUILTIN_ATTRIBUTES = [{ type: "label", name: "board:showInbox", valueType: "boolean", hasUserValue: true },// Carried by a card that stands in for another note: opening it navigates there instead.{ type: "relation", name: "board:cardRedirectTo" },- // The name the relation above shipped under, still read so existing boards keep working.+ // The previous name of the relation above. Still read, so existing boards keep redirecting.{ type: "relation", name: "boardCardRedirectTo" },// How wide the board draws its columns. Absent for the narrow default.{ type: "label", name: "board:columnWidth", valueType: "select", hasUserValue: true,