diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 9e4a16620..320fbd763 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -74,7 +74,7 @@ runs: - name: Update build info shell: ${{ inputs.shell }} - run: npm run chore:update-build-info + run: pnpm run chore:update-build-info # Critical debugging configuration - name: Run electron-forge build with enhanced logging diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index a1b38782d..5b3eb0c1b 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -152,12 +152,12 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Run the TypeScript build - run: pnpm run server:build - - name: Update build info run: pnpm run chore:update-build-info + - name: Run the TypeScript build + run: pnpm run server:build + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -211,7 +211,7 @@ jobs: - name: Upload digest uses: actions/upload-artifact@v4 with: - name: digests-${{ env.PLATFORM_PAIR }} + name: digests-${{ env.PLATFORM_PAIR }}-${{ matrix.dockerfile }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 diff --git a/.nvmrc b/.nvmrc index 3a6161c2a..ed27c90a8 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22.19.0 \ No newline at end of file +22.20.0 \ No newline at end of file diff --git a/_regroup/package.json b/_regroup/package.json index b43178295..07d267926 100644 --- a/_regroup/package.json +++ b/_regroup/package.json @@ -35,13 +35,13 @@ "chore:generate-openapi": "tsx bin/generate-openapi.js" }, "devDependencies": { - "@playwright/test": "1.55.0", - "@stylistic/eslint-plugin": "5.3.1", + "@playwright/test": "1.55.1", + "@stylistic/eslint-plugin": "5.4.0", "@types/express": "5.0.3", "@types/node": "22.18.6", "@types/yargs": "17.0.33", "@vitest/coverage-v8": "3.2.4", - "eslint": "9.35.0", + "eslint": "9.36.0", "eslint-plugin-simple-import-sort": "12.1.1", "esm": "3.2.25", "jsdoc": "4.0.4", diff --git a/apps/client/package.json b/apps/client/package.json index 50e2b71db..1077e2e34 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/client", - "version": "0.98.1", + "version": "0.99.0", "description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)", "private": true, "license": "AGPL-3.0-only", @@ -15,7 +15,7 @@ "circular-deps": "dpdm -T src/**/*.ts --tree=false --warning=false --skip-dynamic-imports=circular" }, "dependencies": { - "@eslint/js": "9.35.0", + "@eslint/js": "9.36.0", "@excalidraw/excalidraw": "0.18.0", "@fullcalendar/core": "6.1.19", "@fullcalendar/daygrid": "6.1.19", @@ -53,7 +53,7 @@ "mark.js": "8.11.1", "marked": "16.3.0", "mermaid": "11.12.0", - "mind-elixir": "5.1.1", + "mind-elixir": "5.2.1", "normalize.css": "8.0.1", "panzoom": "9.4.3", "preact": "10.27.2", diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts index 983c0a48c..574d3091c 100644 --- a/apps/client/src/menus/context_menu.ts +++ b/apps/client/src/menus/context_menu.ts @@ -2,6 +2,7 @@ import { KeyboardActionNames } from "@triliumnext/commons"; import keyboardActionService, { getActionSync } from "../services/keyboard_actions.js"; import note_tooltip from "../services/note_tooltip.js"; import utils from "../services/utils.js"; +import { should } from "vitest"; export interface ContextMenuOptions { x: number; @@ -14,8 +15,13 @@ export interface ContextMenuOptions { onHide?: () => void; } -interface MenuSeparatorItem { - title: "----"; +export interface MenuSeparatorItem { + kind: "separator"; +} + +export interface MenuHeader { + title: string; + kind: "header"; } export interface MenuItemBadge { @@ -45,7 +51,7 @@ export interface MenuCommandItem { columns?: number; } -export type MenuItem = MenuCommandItem | MenuSeparatorItem; +export type MenuItem = MenuCommandItem | MenuSeparatorItem | MenuHeader; export type MenuHandler = (item: MenuCommandItem, e: JQuery.MouseDownEvent) => void; export type ContextMenuEvent = PointerEvent | MouseEvent | JQuery.ContextMenuEvent; @@ -150,14 +156,51 @@ class ContextMenu { .addClass("show"); } - addItems($parent: JQuery, items: MenuItem[]) { - for (const item of items) { + addItems($parent: JQuery, items: MenuItem[], multicolumn = false) { + let $group = $parent; // The current group or parent element to which items are being appended + let shouldStartNewGroup = false; // If true, the next item will start a new group + let shouldResetGroup = false; // If true, the next item will be the last one from the group + + for (let index = 0; index < items.length; index++) { + const item = items[index]; if (!item) { continue; } - if (item.title === "----") { - $parent.append($("
").addClass("dropdown-divider")); + // If the current item is a header, start a new group. This group will contain the + // header and the next item that follows the header. + if ("kind" in item && item.kind === "header") { + if (multicolumn && !shouldResetGroup) { + shouldStartNewGroup = true; + } + } + + // If the next item is a separator, start a new group. This group will contain the + // current item, the separator, and the next item after the separator. + const nextItem = (index < items.length - 1) ? items[index + 1] : null; + if (multicolumn && nextItem && "kind" in nextItem && nextItem.kind === "separator") { + if (!shouldResetGroup) { + shouldStartNewGroup = true; + } else { + shouldResetGroup = true; // Continue the current group + } + } + + // Create a new group to avoid column breaks before and after the seaparator / header. + // This is a workaround for Firefox not supporting break-before / break-after: avoid + // for columns. + if (shouldStartNewGroup) { + $group = $("