From 05975a02fb7f10d5647bf448d86547a4f3a0fe73 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 02:37:14 +0000 Subject: [PATCH 01/15] chore(deps): update apple-actions/import-codesign-certs action to v3 --- .github/actions/build-electron/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index dca9bc3b8..e8d07c6ae 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -18,7 +18,7 @@ runs: # Certificate setup - name: Import Apple certificates if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v2 + uses: apple-actions/import-codesign-certs@v3 with: p12-file-base64: ${{ env.APPLE_APP_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_APP_CERTIFICATE_PASSWORD }} @@ -27,7 +27,7 @@ runs: - name: Install Installer certificate if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v2 + uses: apple-actions/import-codesign-certs@v3 with: p12-file-base64: ${{ env.APPLE_INSTALLER_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_INSTALLER_CERTIFICATE_PASSWORD }} From 5109f865c7d2239ffc7521779a86aa0dfd8a3546 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 26 Feb 2025 20:06:18 +0000 Subject: [PATCH 02/15] Fix MacOS artifact names --- .github/actions/build-electron/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index dca9bc3b8..716a990c2 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -180,7 +180,7 @@ runs: dmg_file=$(find out -name "*.dmg" -print -quit) if [ -n "$dmg_file" ]; then echo "Found DMG: $dmg_file" - cp "$dmg_file" "upload/TriliumNextNotes-${{ github.ref_name }}-darwin-${{ inputs.arch }}.dmg" + cp "$dmg_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.dmg" else echo "Warning: No DMG file found" fi @@ -190,7 +190,7 @@ runs: zip_file=$(find out -name "*.zip" -print -quit) if [ -n "$zip_file" ]; then echo "Found ZIP: $zip_file" - cp "$zip_file" "upload/TriliumNextNotes-${{ github.ref_name }}-darwin-${{ inputs.arch }}.zip" + cp "$zip_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.zip" else echo "Warning: No ZIP file found" fi From 9cc3598095f8d8515cf51d1ca0928fbf934d6f47 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 26 Feb 2025 19:16:00 +0200 Subject: [PATCH 03/15] chore(ci): separate client & server coverage --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 29db7c861..a3c1e8c22 100644 --- a/package.json +++ b/package.json @@ -44,10 +44,11 @@ "docs:build": "npm run docs:build-backend && npm run docs:build-frontend", "build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts", "build:prepare-dist": "npm run build:webpack && rimraf ./dist && tsc && tsx ./bin/copy-dist.ts", - "test": "npm run test:server && npm run test:client", - "test:server": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest", - "test:client": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app", - "test:coverage": "cross-env TRILIUM_DATA_DIR=./integration-tests/db vitest --coverage", + "test": "npm run client:test && npm run server:test", + "server:test": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest", + "server:coverage": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --coverage", + "client:test": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app", + "client:coverage": "cross-env TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app --coverage", "test:playwright": "playwright test", "test:integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", "test:integration-mem-db": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", From 07c2342b7b9de1768d39ee3bc3e917002eba296f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 26 Feb 2025 19:22:12 +0200 Subject: [PATCH 04/15] feat(file): display video in full-width & full-height --- src/public/app/widgets/type_widgets/file.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/public/app/widgets/type_widgets/file.ts b/src/public/app/widgets/type_widgets/file.ts index 1e75bfdb0..0d10783a0 100644 --- a/src/public/app/widgets/type_widgets/file.ts +++ b/src/public/app/widgets/type_widgets/file.ts @@ -29,6 +29,11 @@ const TPL = ` overflow: auto; margin: 10px; } + + .note-detail-file > .video-preview { + width: 100%; + height: 100%; + }
From e330d91df2ab1b4fcac2c91eb96999961b01a364 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 26 Feb 2025 19:30:16 +0200 Subject: [PATCH 05/15] feat(file): display videos in full width --- src/public/app/widgets/note_wrapper.ts | 2 +- src/public/app/widgets/type_widgets/file.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/note_wrapper.ts b/src/public/app/widgets/note_wrapper.ts index b7df269fe..dd108f9c3 100644 --- a/src/public/app/widgets/note_wrapper.ts +++ b/src/public/app/widgets/note_wrapper.ts @@ -63,7 +63,7 @@ export default class NoteWrapperWidget extends FlexContainer { return true; } - if (note.type === "file" && note.mime === "application/pdf") { + if (note.type === "file" && (note.mime === "application/pdf" || note.mime.startsWith("video/"))) { return true; } diff --git a/src/public/app/widgets/type_widgets/file.ts b/src/public/app/widgets/type_widgets/file.ts index 0d10783a0..38f1738e7 100644 --- a/src/public/app/widgets/type_widgets/file.ts +++ b/src/public/app/widgets/type_widgets/file.ts @@ -22,6 +22,10 @@ const TPL = ` padding: 0; } + .note-split.full-content-width .note-detail-file[data-preview-type="video"] { + overflow: hidden; + } + .file-preview-content { background-color: var(--accented-background-color); padding: 15px; @@ -90,6 +94,8 @@ export default class FileTypeWidget extends TypeWidget { this.$videoPreview.hide(); this.$audioPreview.hide(); + let previewType: string; + if (blob?.content) { this.$previewContent.show().scrollTop(0); const trimmedContent = blob.content.substring(0, TEXT_MAX_NUM_CHARS); @@ -97,23 +103,30 @@ export default class FileTypeWidget extends TypeWidget { this.$previewTooBig.removeClass("hidden-ext"); } this.$previewContent.text(trimmedContent); + previewType = "text"; } else if (note.mime === "application/pdf") { this.$pdfPreview.show().attr("src", openService.getUrlForDownload(`api/notes/${this.noteId}/open`)); + previewType = "pdf"; } else if (note.mime.startsWith("video/")) { this.$videoPreview .show() .attr("src", openService.getUrlForDownload(`api/notes/${this.noteId}/open-partial`)) .attr("type", this.note?.mime ?? "") .css("width", this.$widget.width() ?? 0); + previewType = "video"; } else if (note.mime.startsWith("audio/")) { this.$audioPreview .show() .attr("src", openService.getUrlForDownload(`api/notes/${this.noteId}/open-partial`)) .attr("type", this.note?.mime ?? "") .css("width", this.$widget.width() ?? 0); + previewType = "audio"; } else { this.$previewNotAvailable.show(); + previewType = "not-available"; } + + this.$widget.attr("data-preview-type", previewType ?? ""); } async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { From ab5df9e01010e759256e073b272b4af278f13119 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 26 Feb 2025 19:36:30 +0200 Subject: [PATCH 06/15] feat(note_list): improve video preview --- src/public/app/widgets/note_list.ts | 4 ++++ src/public/stylesheets/theme-next/shell.css | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/note_list.ts b/src/public/app/widgets/note_list.ts index 84599d42b..7243ff9a9 100644 --- a/src/public/app/widgets/note_list.ts +++ b/src/public/app/widgets/note_list.ts @@ -20,6 +20,10 @@ const TPL = ` .note-list-widget.full-height .note-list-widget-content { height: 100%; } + + .note-list-widget video { + height: 100%; + }
diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index 2a433887e..377a3f484 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -1610,7 +1610,8 @@ div.bookmark-folder-widget .note-link .bx { .note-list-wrapper .note-book-card .note-book-content.type-canvas .rendered-content, .note-list-wrapper .note-book-card .note-book-content.type-mindMap .rendered-content, -.note-list-wrapper .note-book-card .note-book-content.type-code .rendered-content { +.note-list-wrapper .note-book-card .note-book-content.type-code .rendered-content, +.note-list-wrapper .note-book-card .note-book-content.type-video .rendered-content { padding: 0; } From fa60295ab25aea622e147fe319b3623252517b88 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 26 Feb 2025 19:41:39 +0200 Subject: [PATCH 07/15] feat(note_list): improve file footer --- src/public/app/services/content_renderer.ts | 4 ++-- src/public/stylesheets/style.css | 11 +++++++++++ src/public/stylesheets/theme-next/shell.css | 4 ++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/content_renderer.ts b/src/public/app/services/content_renderer.ts index 7064829fc..ec81ef3bc 100644 --- a/src/public/app/services/content_renderer.ts +++ b/src/public/app/services/content_renderer.ts @@ -203,7 +203,7 @@ function renderFile(entity: FNote | FAttachment, type: string, $renderedContent: // open doesn't work for protected notes since it works through a browser which isn't in protected session $openButton.toggle(!entity.isProtected); - $content.append($('
').append($downloadButton).append($openButton)); + $content.append($('