From de004bd8baa8b35482b0f54cfa91a237f1126a04 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 10 Nov 2025 02:01:45 +0200 Subject: [PATCH 01/20] fix #7667 --- apps/client/src/stylesheets/theme-next/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index cb0b783eb..5ea11cf56 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -498,7 +498,7 @@ li.dropdown-item a.dropdown-item-button:focus-visible { transition: background-color 200ms ease-out; } -:root .note-list .note-book-card:active { +:root .note-list.grid-view .note-book-card:active { transform: scale(.98); } From 624610b17c1b26f089772acf59d295010614dd38 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 10 Nov 2025 02:09:14 +0200 Subject: [PATCH 02/20] close #7668 --- apps/client/src/stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index da222383a..0fc798d92 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -2045,7 +2045,7 @@ body.zen .title-row .icon-action, body.zen .promoted-attributes-widget, body.zen .floating-buttons-children > *:not(.bx-edit-alt), body.zen .action-button, -body.zen .note-list-widget:not(.full-height) { +body.zen .note-split:not(.type-book) .note-list-widget { display: none !important; } From b741662fde9e9aa6cc861187b49ae167112a0e3e Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 10 Nov 2025 03:05:05 +0200 Subject: [PATCH 03/20] style/empty note: fix alignment --- apps/client/src/stylesheets/theme-next/pages.css | 8 ++++++-- apps/client/src/widgets/note_wrapper.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next/pages.css b/apps/client/src/stylesheets/theme-next/pages.css index 87cb7f1a2..3f5f1e223 100644 --- a/apps/client/src/stylesheets/theme-next/pages.css +++ b/apps/client/src/stylesheets/theme-next/pages.css @@ -123,8 +123,12 @@ */ /* The container */ -div.note-detail-empty { - max-width: 70%; + +.note-split.empty-note { + --max-content-width: 70%; +} + +.note-split.empty-note div.note-detail { margin: 50px auto; } diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts index 274dacfab..f3c61859d 100644 --- a/apps/client/src/widgets/note_wrapper.ts +++ b/apps/client/src/widgets/note_wrapper.ts @@ -52,7 +52,7 @@ export default class NoteWrapperWidget extends FlexContainer { const note = this.noteContext?.note; if (!note) { - this.$widget.addClass("bgfx"); + this.$widget.addClass("bgfx empty-note"); return; } From c7369bc9b375f0d112a6ab9b161caba6ed33d305 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 14:26:24 +0200 Subject: [PATCH 04/20] fix(print): copy to clipboard button visible --- apps/client/src/services/syntax_highlight.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/src/services/syntax_highlight.ts b/apps/client/src/services/syntax_highlight.ts index 89dc7c94e..dd2bd48b4 100644 --- a/apps/client/src/services/syntax_highlight.ts +++ b/apps/client/src/services/syntax_highlight.ts @@ -24,7 +24,9 @@ export async function formatCodeBlocks($container: JQuery) { continue; } - applyCopyToClipboardButton($(codeBlock)); + if (glob.device !== "print") { + applyCopyToClipboardButton($(codeBlock)); + } if (syntaxHighlightingEnabled) { applySingleBlockSyntaxHighlight($(codeBlock), normalizedMimeType); From 3776c40b8d6502ee9d5f5e9f73dee9b73682c698 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 14:49:58 +0200 Subject: [PATCH 05/20] chore(ci): add playwright testing to the server --- .github/workflows/playwright.yml | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index a33d24283..4becb005d 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - hotfix paths-ignore: - "apps/website/**" pull_request: @@ -29,9 +30,34 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - run: pnpm exec playwright install --with-deps - - run: pnpm --filter server-e2e e2e + - name: Install Playwright browsers + run: pnpm exec playwright install --with-deps + + - name: Build the server + uses: ./.github/actions/build-server + with: + os: linux + arch: x64 + + - name: Unpack and start the server + run: | + version=$(node --eval "console.log(require('./package.json').version)") + file=$(find ./upload -name '*.tar.xz' -print -quit) + name=$(basename "$file" .tar.xz) + mkdir -p ./server-dist + tar -xvf "$file" -C ./server-dist + server_dir="./server-dist/TriliumNotes-Server-$version-linux-x64" + if [ ! -d "$server_dir" ]; then + echo Missing dir. + exit 1 + fi + cd "$server_dir" + "./trilium.sh" & + sleep 10 + + - name: Server end-to-end tests + run: TRILIUM_DOCKER=1 TRILIUM_PORT=8080 pnpm --filter server-e2e e2e - name: Upload test report if: failure() @@ -39,3 +65,7 @@ jobs: with: name: e2e report path: apps/server-e2e/test-output + + - name: Kill the server + if: always() + run: pkill -f trilium || true From 9b69b0ad0d47ddd3e26ed84bacabbc17c6f74c85 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 17:41:08 +0200 Subject: [PATCH 06/20] fix(server): use right packaged version --- apps/server/scripts/build-server.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/server/scripts/build-server.sh b/apps/server/scripts/build-server.sh index 115a441cb..6396b314b 100644 --- a/apps/server/scripts/build-server.sh +++ b/apps/server/scripts/build-server.sh @@ -20,10 +20,10 @@ fi # Debug output echo "Selected Arch: $ARCH" -# Set Node.js version and architecture-specific filename -NODE_VERSION=22.16.0 - script_dir=$(realpath $(dirname $0)) + +# Set Node.js version and architecture-specific filename +NODE_VERSION=$(cat "../../.nvmrc") BUILD_DIR="$script_dir/../dist" DIST_DIR="$script_dir/../out" From e70c6b69b8701a1fc76e72e2afb03119edd55897 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 18:15:35 +0200 Subject: [PATCH 07/20] fix(ci): set proper environment variables for playwright --- .github/workflows/playwright.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4becb005d..885ce2434 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,6 +16,11 @@ permissions: jobs: main: runs-on: ubuntu-latest + env: + TRILIUM_DOCKER: 1 + TRILIUM_PORT: 8080 + TRILIUM_DATA_DIR: "${{ github.workspace }}/apps/server/spec/db" + TRILIUM_INTEGRATION_TEST: memory steps: - uses: actions/checkout@v5 with: @@ -57,7 +62,7 @@ jobs: sleep 10 - name: Server end-to-end tests - run: TRILIUM_DOCKER=1 TRILIUM_PORT=8080 pnpm --filter server-e2e e2e + run: pnpm --filter server-e2e e2e - name: Upload test report if: failure() From 9c1a34fe7cc1b38916d5846c3df6daa91af939fe Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 18:30:03 +0200 Subject: [PATCH 08/20] fix(ci): proper port --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 885ce2434..e3860f03f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest env: TRILIUM_DOCKER: 1 - TRILIUM_PORT: 8080 + TRILIUM_PORT: 8082 TRILIUM_DATA_DIR: "${{ github.workspace }}/apps/server/spec/db" TRILIUM_INTEGRATION_TEST: memory steps: From 20286d53c8d574ca65d78601ac2107d7c75bf0bd Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 18:56:04 +0200 Subject: [PATCH 09/20] feat(ci): test server on ARM as well --- .github/workflows/playwright.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index e3860f03f..261ea4e02 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -15,7 +15,16 @@ permissions: jobs: main: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: linux-x64 + os: ubuntu-22.04 + arch: x64 + - name: linux-arm64 + os: ubuntu-24.04-arm + arch: arm64 + runs-on: ${{ matrix.os }} env: TRILIUM_DOCKER: 1 TRILIUM_PORT: 8082 @@ -43,7 +52,7 @@ jobs: uses: ./.github/actions/build-server with: os: linux - arch: x64 + arch: ${{ matrix.arch }} - name: Unpack and start the server run: | From ed08893996034b4a2201f2b5fc70b452eddc6fdd Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 19:05:41 +0200 Subject: [PATCH 10/20] chore(ci): disable fail-fast for matrix --- .github/workflows/playwright.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 261ea4e02..ecd907771 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,6 +16,7 @@ permissions: jobs: main: strategy: + fail-fast: false matrix: include: - name: linux-x64 From b54765113e66c81a29bb59094be4552fe8842798 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 19:10:55 +0200 Subject: [PATCH 11/20] fix(ci): wrong dir for arm64 --- .github/workflows/playwright.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ecd907771..68e102a65 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -14,7 +14,7 @@ permissions: contents: read jobs: - main: + e2e: strategy: fail-fast: false matrix: @@ -26,6 +26,7 @@ jobs: os: ubuntu-24.04-arm arch: arm64 runs-on: ${{ matrix.os }} + name: E2E tests on ${{ matrix.name }} env: TRILIUM_DOCKER: 1 TRILIUM_PORT: 8082 @@ -62,7 +63,7 @@ jobs: name=$(basename "$file" .tar.xz) mkdir -p ./server-dist tar -xvf "$file" -C ./server-dist - server_dir="./server-dist/TriliumNotes-Server-$version-linux-x64" + server_dir="./server-dist/TriliumNotes-Server-$version-linux-${{ matrix.arch }}" if [ ! -d "$server_dir" ]; then echo Missing dir. exit 1 From 118e11c3fdfd71898d3ba99708cc108255ac2a7a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Nov 2025 20:29:25 +0200 Subject: [PATCH 12/20] edited notes: better sql like statement (#7681) --- apps/server/src/routes/api/revisions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/routes/api/revisions.ts b/apps/server/src/routes/api/revisions.ts index d9b7b975e..9700e7f78 100644 --- a/apps/server/src/routes/api/revisions.ts +++ b/apps/server/src/routes/api/revisions.ts @@ -159,7 +159,7 @@ function getEditedNotesOnDate(req: Request) { SELECT noteId FROM notes WHERE (notes.dateCreated LIKE :date OR notes.dateModified LIKE :date) - AND (noteId NOT LIKE '_%') + AND (notes.noteId NOT LIKE '\\_%' ESCAPE '\\') UNION ALL SELECT noteId FROM revisions WHERE revisions.dateCreated LIKE :date From 7b8f1ed6ec6857ff7cbaf7cbe6915084dacb5a20 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 11:24:45 +0200 Subject: [PATCH 13/20] fix(collections/calendar): unable to drag to/from all-day (closes #7685) --- apps/client/src/widgets/collections/calendar/api.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/client/src/widgets/collections/calendar/api.ts b/apps/client/src/widgets/collections/calendar/api.ts index 934edcb2e..eef391108 100644 --- a/apps/client/src/widgets/collections/calendar/api.ts +++ b/apps/client/src/widgets/collections/calendar/api.ts @@ -58,8 +58,6 @@ export async function changeEvent(note: FNote, { startDate, endDate, startTime, startAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:startTime").shift()?.value||"startTime"; endAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:endTime").shift()?.value||"endTime"; - if (startTime && endTime) { - setAttribute(note, "label", startAttribute, startTime); - setAttribute(note, "label", endAttribute, endTime); - } + setAttribute(note, "label", startAttribute, startTime); + setAttribute(note, "label", endAttribute, endTime); } From 80c77eeb1871334173b5650ab3915a1ad16e1a39 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 12:20:16 +0200 Subject: [PATCH 14/20] fix(ribbon): "Open attribute list" shortcut not focusing (closes #7463) --- apps/client/src/widgets/react/CKEditor.tsx | 15 +++++++++------ .../src/widgets/ribbon/OwnedAttributesTab.tsx | 2 +- .../widgets/ribbon/components/AttributeEditor.tsx | 6 +----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/client/src/widgets/react/CKEditor.tsx b/apps/client/src/widgets/react/CKEditor.tsx index 8b8839a38..84df2d059 100644 --- a/apps/client/src/widgets/react/CKEditor.tsx +++ b/apps/client/src/widgets/react/CKEditor.tsx @@ -6,9 +6,9 @@ export interface CKEditorApi { focus(): void; /** * Imperatively sets the text in the editor. - * + * * Prefer setting `currentValue` prop where possible. - * + * * @param text text to set in the editor */ setText(text: string): void; @@ -27,15 +27,16 @@ interface CKEditorOpts { onClick?: (e: MouseEvent, pos?: ModelPosition | null) => void; onKeyDown?: (e: KeyboardEvent) => void; onBlur?: () => void; + onInitialized?: (editorInstance: CKTextEditor) => void; } -export default function CKEditor({ apiRef, currentValue, editor, config, disableNewlines, disableSpellcheck, onChange, onClick, ...restProps }: CKEditorOpts) { - const editorContainerRef = useRef(null); +export default function CKEditor({ apiRef, currentValue, editor, config, disableNewlines, disableSpellcheck, onChange, onClick, onInitialized, ...restProps }: CKEditorOpts) { + const editorContainerRef = useRef(null); const textEditorRef = useRef(null); useImperativeHandle(apiRef, () => { return { focus() { - editorContainerRef.current?.focus(); + textEditorRef.current?.editing.view.focus(); textEditorRef.current?.model.change((writer) => { const documentRoot = textEditorRef.current?.editing.model.document.getRoot(); if (documentRoot) { @@ -83,6 +84,8 @@ export default function CKEditor({ apiRef, currentValue, editor, config, disable if (currentValue) { textEditor.setData(currentValue); } + + onInitialized?.(textEditor); }); }, []); @@ -103,4 +106,4 @@ export default function CKEditor({ apiRef, currentValue, editor, config, disable {...restProps} /> ) -} \ No newline at end of file +} diff --git a/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx b/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx index 1bdb6c1c0..ae3d90c07 100644 --- a/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx +++ b/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx @@ -26,4 +26,4 @@ export default function OwnedAttributesTab({ note, hidden, activate, ntxId, ...r )} ) -} \ No newline at end of file +} diff --git a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx index 380241df8..bf0aa9428 100644 --- a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx +++ b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx @@ -238,11 +238,6 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI } }); - // Focus on show. - useEffect(() => { - setTimeout(() => editorRef.current?.focus(), 0); - }, []); - // Interaction with CKEditor. useLegacyImperativeHandlers(useMemo(() => ({ loadReferenceLinkTitle: async ($el: JQuery, href: string) => { @@ -363,6 +358,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI }} onKeyDown={() => attributeDetailWidget.hide()} onBlur={() => save()} + onInitialized={() => editorRef.current?.focus()} disableNewlines disableSpellcheck /> From 4e73f2016577bdf9c7ab4bdd8fe396256e42cd82 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 13:37:35 +0200 Subject: [PATCH 15/20] fix(flatpak): system tray missing --- apps/desktop/electron-forge/forge.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/desktop/electron-forge/forge.config.ts b/apps/desktop/electron-forge/forge.config.ts index 1dc5310ff..8d279d59b 100644 --- a/apps/desktop/electron-forge/forge.config.ts +++ b/apps/desktop/electron-forge/forge.config.ts @@ -108,6 +108,8 @@ const config: ForgeConfig = { "--share=network", // System notifications with libnotify "--talk-name=org.freedesktop.Notifications", + // System tray + "--talk-name=org.kde.StatusNotifierWatcher" ], modules: [ { From a45b1474624d71543a999c58bd16cdf2f96b0492 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 13:41:18 +0200 Subject: [PATCH 16/20] fix(flatpak): global shortcuts not working (closes #7563) --- apps/desktop/src/main.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index a94709107..57e0492f2 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -39,11 +39,16 @@ async function main() { app.commandLine.appendSwitch("disable-smooth-scrolling"); } - // Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions. - // See https://github.com/electron/electron/issues/46538 for more info. if (process.platform === "linux") { app.setName(PRODUCT_NAME); + + // Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions. + // See https://github.com/electron/electron/issues/46538 for more info. app.commandLine.appendSwitch("gtk-version", "3"); + + // Enable global shortcuts in Flatpak + // the app runs in a Wayland session. + app.commandLine.appendSwitch("enable-features", "GlobalShortcutsPortal"); } // Quit when all windows are closed, except on macOS. There, it's common From e8dc19a1a63252a4e25caa78b3ad0892f9c1e205 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 13:49:00 +0200 Subject: [PATCH 17/20] chore(forge): display logs when building for flatpak --- apps/desktop/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index f4bb4118f..0e171f4f5 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -16,7 +16,7 @@ "build": "tsx scripts/build.ts", "start-prod": "pnpm build && cross-env TRILIUM_DATA_DIR=data TRILIUM_PORT=37841 ELECTRON_IS_DEV=0 electron dist", "electron-forge:make": "pnpm build && electron-forge make dist", - "electron-forge:make-flatpak": "pnpm build && electron-forge make dist --targets=@electron-forge/maker-flatpak", + "electron-forge:make-flatpak": "pnpm build && DEBUG=* electron-forge make dist --targets=@electron-forge/maker-flatpak", "electron-forge:package": "pnpm build && electron-forge package dist", "electron-forge:start": "pnpm build && electron-forge start dist", "e2e": "pnpm build && cross-env TRILIUM_INTEGRATION_TEST=memory-no-store TRILIUM_PORT=8082 TRILIUM_DATA_DIR=data-e2e ELECTRON_IS_DEV=0 playwright test" From a13892da6676d38590d3d27b7c766cbaec0cad2d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Nov 2025 15:29:24 +0200 Subject: [PATCH 18/20] refactor(popup_editor): different handling for z-index --- apps/client/src/widgets/dialogs/popup_editor.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index a823740cd..2ec95351a 100644 --- a/apps/client/src/widgets/dialogs/popup_editor.ts +++ b/apps/client/src/widgets/dialogs/popup_editor.ts @@ -8,6 +8,10 @@ import TypeWidget from "../type_widgets/type_widget.js"; const TPL = /*html*/`\