Skip to content

Build your personal knowledge base with Trilium Notes

client/collections/board: fix an issue

Adorian Doranb42495164c28
diff --git a/apps/client/src/widgets/collections/board/index.spec.tsx b/apps/client/src/widgets/collections/board/index.spec.tsx
index 2fd0ada67a..5a02676e27 100644
--- a/apps/client/src/widgets/collections/board/index.spec.tsx
+++ b/apps/client/src/widgets/collections/board/index.spec.tsx
@@ -444,6 +444,8 @@ describe("Collapsed board columns", () => {
const board = mountPoint.querySelector<HTMLElement>(".board-view-container");
const show = vi.spyOn(contextMenu, "show").mockImplementation(async () => {});
+ // With a column open, which the collapse has to close along with the rest.
+ await select(mountPoint, 1);
board?.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true }));
const entries = (show.mock.calls.at(-1)?.[0].items ?? []).flatMap(item =>
item && "uiIcon" in item && "handler" in item
diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsx
index 18e7773255..ff3c2501be 100644
--- a/apps/client/src/widgets/collections/board/index.tsx
+++ b/apps/client/src/widgets/collections/board/index.tsx
@@ -311,7 +311,11 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
openBoardContextMenu(event, {
onCollapseAll: () => {
- setIsPeekingAll(false);
+ // The open column is closed with the rest: it holds the peek that would otherwise
+ // keep it open against what is being written for it.
+ // The open column is closed with the rest: it holds the peek that would otherwise
+ // keep it open against what is being written for it.
+ selectColumn(undefined);
api.setAllColumnsCollapsed(true);
},
onExpandAll: () => {
@@ -320,7 +324,7 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
api.setAllColumnsCollapsed(false);
}
});
- }, [ api ]);
+ }, [ api, selectColumn ]);
const boardActions = useMemo<BoardActions>(() => ({
setBranchIdToEdit,