Compare commits

...

22 Commits

Author SHA1 Message Date
Elian Doran
48608adbd3 Merge branch 'hotfix' of https://github.com/TriliumNext/Trilium into hotfix 2025-11-11 15:33:00 +02:00
Elian Doran
362ecba98d fix(popup_editor): drag indicator not visible (closes #7686) 2025-11-11 15:32:59 +02:00
Elian Doran
a13892da66 refactor(popup_editor): different handling for z-index 2025-11-11 15:32:18 +02:00
Elian Doran
e8dc19a1a6 chore(forge): display logs when building for flatpak 2025-11-11 13:49:00 +02:00
Elian Doran
cc326547d1 Merge branch 'hotfix' of github.com:TriliumNext/Trilium into hotfix 2025-11-11 13:41:22 +02:00
Elian Doran
a45b147462 fix(flatpak): global shortcuts not working (closes #7563) 2025-11-11 13:41:18 +02:00
Elian Doran
4e73f20165 fix(flatpak): system tray missing 2025-11-11 13:37:35 +02:00
Elian Doran
80c77eeb18 fix(ribbon): "Open attribute list" shortcut not focusing (closes #7463) 2025-11-11 12:20:16 +02:00
Elian Doran
c30282fbd0 Merge branch 'hotfix' of https://github.com/TriliumNext/Trilium into hotfix 2025-11-11 11:24:47 +02:00
Elian Doran
7b8f1ed6ec fix(collections/calendar): unable to drag to/from all-day (closes #7685) 2025-11-11 11:24:45 +02:00
Elian Doran
118e11c3fd edited notes: better sql like statement (#7681) 2025-11-10 21:16:29 +02:00
Elian Doran
b54765113e fix(ci): wrong dir for arm64 2025-11-10 19:10:55 +02:00
Elian Doran
ed08893996 chore(ci): disable fail-fast for matrix 2025-11-10 19:05:41 +02:00
Elian Doran
20286d53c8 feat(ci): test server on ARM as well 2025-11-10 18:56:04 +02:00
Elian Doran
9c1a34fe7c fix(ci): proper port 2025-11-10 18:30:03 +02:00
Elian Doran
e70c6b69b8 fix(ci): set proper environment variables for playwright 2025-11-10 18:20:35 +02:00
Elian Doran
9b69b0ad0d fix(server): use right packaged version 2025-11-10 17:51:04 +02:00
Elian Doran
3776c40b8d chore(ci): add playwright testing to the server 2025-11-10 17:25:39 +02:00
Elian Doran
c7369bc9b3 fix(print): copy to clipboard button visible 2025-11-10 14:26:24 +02:00
Adorian Doran
b741662fde style/empty note: fix alignment 2025-11-10 14:17:49 +02:00
Adorian Doran
624610b17c close #7668 2025-11-10 14:17:44 +02:00
Adorian Doran
de004bd8ba fix #7667 2025-11-10 14:17:37 +02:00
16 changed files with 97 additions and 38 deletions

View File

@@ -4,6 +4,7 @@ on:
push:
branches:
- main
- hotfix
paths-ignore:
- "apps/website/**"
pull_request:
@@ -13,8 +14,24 @@ permissions:
contents: read
jobs:
main:
runs-on: ubuntu-latest
e2e:
strategy:
fail-fast: false
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 }}
name: E2E tests on ${{ matrix.name }}
env:
TRILIUM_DOCKER: 1
TRILIUM_PORT: 8082
TRILIUM_DATA_DIR: "${{ github.workspace }}/apps/server/spec/db"
TRILIUM_INTEGRATION_TEST: memory
steps:
- uses: actions/checkout@v5
with:
@@ -29,9 +46,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: ${{ matrix.arch }}
- 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-${{ matrix.arch }}"
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: pnpm --filter server-e2e e2e
- name: Upload test report
if: failure()
@@ -39,3 +81,7 @@ jobs:
with:
name: e2e report
path: apps/server-e2e/test-output
- name: Kill the server
if: always()
run: pkill -f trilium || true

View File

@@ -24,7 +24,9 @@ export async function formatCodeBlocks($container: JQuery<HTMLElement>) {
continue;
}
applyCopyToClipboardButton($(codeBlock));
if (glob.device !== "print") {
applyCopyToClipboardButton($(codeBlock));
}
if (syntaxHighlightingEnabled) {
applySingleBlockSyntaxHighlight($(codeBlock), normalizedMimeType);

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -8,6 +8,11 @@ import TypeWidget from "../type_widgets/type_widget.js";
const TPL = /*html*/`\
<div class="popup-editor-dialog modal fade mx-auto" tabindex="-1" role="dialog">
<style>
/** Reduce the z-index of modals so that ckeditor popups are properly shown on top of it. */
body.popup-editor-open > .modal-backdrop { z-index: 998; }
body.popup-editor-open .popup-editor-dialog { z-index: 999; }
body.popup-editor-open .ck-clipboard-drop-target-line { z-index: 1000; }
body.desktop .modal.popup-editor-dialog .modal-dialog {
max-width: 75vw;
}
@@ -137,11 +142,6 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
}
$dialog.on("shown.bs.modal", async () => {
// Reduce the z-index of modals so that ckeditor popups are properly shown on top of it.
// The backdrop instance is not shared so it's OK to make a one-off modification.
$("body > .modal-backdrop").css("z-index", "998");
$dialog.css("z-index", "999");
await this.handleEventInChildren("activeContextChanged", { noteContext: this.noteContext });
this.setVisibility(true);
await this.handleEventInChildren("focusOnDetail", { ntxId: this.noteContext.ntxId });
@@ -162,9 +162,12 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
if (visible) {
$bodyItems.fadeIn();
this.$modalHeader.children().show();
document.body.classList.add("popup-editor-open");
} else {
$bodyItems.hide();
this.$modalHeader.children().hide();
document.body.classList.remove("popup-editor-open");
}
}

View File

@@ -52,7 +52,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
const note = this.noteContext?.note;
if (!note) {
this.$widget.addClass("bgfx");
this.$widget.addClass("bgfx empty-note");
return;
}

View File

@@ -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) {
export default function CKEditor({ apiRef, currentValue, editor, config, disableNewlines, disableSpellcheck, onChange, onClick, onInitialized, ...restProps }: CKEditorOpts) {
const editorContainerRef = useRef<HTMLDivElement>(null);
const textEditorRef = useRef<CKTextEditor>(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);
});
}, []);

View File

@@ -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<HTMLElement>, 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
/>

View File

@@ -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: [
{

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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