Skip to content

Build your personal knowledge base with Trilium Notes

client/collections/board/search & filtering: fix comments

Adorian Dorane508b6ac2ef7
diff --git a/apps/client/src/widgets/collections/board/api.ts b/apps/client/src/widgets/collections/board/api.ts
index 62d9b2c7fc..5041021126 100644
--- a/apps/client/src/widgets/collections/board/api.ts
+++ b/apps/client/src/widgets/collections/board/api.ts
@@ -230,11 +230,8 @@ export default class BoardApi {
}
/**
- * Keeps a card the board has just gained on screen while the board is narrowed by a filter.
- *
- * A card is rarely made to match the query in force, so the board would otherwise answer every
- * addition by drawing nothing at all. It is marked as standing outside the filter, and the
- * next query decides on it like any other card.
+ * Reports a card the board has just gained, which `useCollectionFilter` draws and marks even
+ * when the query misses it. Without this, adding a card to a filtered board shows nothing.
*/
private keepInView(noteId: string | undefined) {
if (noteId) {
@@ -1172,12 +1169,8 @@ export default class BoardApi {
}
/**
- * The card a new or arriving one is placed after: the last one drawn, or the last one the
- * column holds when a filter is drawing none of them.
- *
- * Placement is relative to the cards on screen, so the unfiltered map is read only where that
- * rule has nothing to say. Left unplaced, a card would rank among the ones it cannot see by
- * wherever it happened to sit before.
+ * The card a new or arriving one is placed after: the last one drawn, or `allByColumn`'s last
+ * where a filter draws none. Placement follows the cards on screen wherever there are any.
*/
private lastInColumn(column: string) {
const shown = this.byColumn?.get(column) ?? [];
diff --git a/apps/client/src/widgets/collections/board/card.spec.tsx b/apps/client/src/widgets/collections/board/card.spec.tsx
index cc1aa13785..624233f9d7 100644
--- a/apps/client/src/widgets/collections/board/card.spec.tsx
+++ b/apps/client/src/widgets/collections/board/card.spec.tsx
@@ -385,10 +385,7 @@ describe("Board card", () => {
const cardIcon = (noteId: string) => card(noteId).querySelector(".title .icon")?.className ?? "";
});
-/**
- * The clock a card carries while it is drawn although the filter misses it. The tooltip reaches
- * only a reader who points at it, so the name has to be on the element as well.
- */
+/** `TooltipIcon` opens its tooltip on hover, so the name has to be an attribute as well. */
describe("OutsideFilterBadge", () => {
it("names itself for assistive technology", () => {
const container = document.body.appendChild(document.createElement("div"));
diff --git a/apps/client/src/widgets/collections/board/card.tsx b/apps/client/src/widgets/collections/board/card.tsx
index c07ebbbcfe..b0172c0ac6 100644
--- a/apps/client/src/widgets/collections/board/card.tsx
+++ b/apps/client/src/widgets/collections/board/card.tsx
@@ -236,10 +236,8 @@ function Card({
}
/**
- * Marks a card drawn although the filter does not match it, which one just made here is.
- *
- * `role="img"` is what carries the label to a reader: a bare span has no role that a name can be
- * given to, and the tooltip alone reaches nobody who is not pointing at it.
+ * Marks a card the filter does not match, drawn because it was just made here.
+ * `role="img"` is what lets `aria-label` name it: a span on its own cannot be named.
*/
export function OutsideFilterBadge() {
return (