diff --git a/integration-tests/db/document.db b/integration-tests/db/document.db index 4857edcd9..e58d58ffb 100644 Binary files a/integration-tests/db/document.db and b/integration-tests/db/document.db differ diff --git a/integration-tests/tree.spec.ts b/integration-tests/tree.spec.ts new file mode 100644 index 000000000..38482eeb0 --- /dev/null +++ b/integration-tests/tree.spec.ts @@ -0,0 +1,18 @@ +import test, { expect } from "@playwright/test"; + +test("Renders on desktop", async ({ page, context }) => { + await page.goto('http://localhost:8082'); + await expect(page.locator('.tree')).toContainText('Trilium Integration Test'); +}); + +test("Renders on mobile", async ({ page, context }) => { + await context.addCookies([ + { + url: "http://localhost:8082", + name: "trilium-device", + value: "mobile" + } + ]); + await page.goto('http://localhost:8082'); + await expect(page.locator('.tree')).toContainText('Trilium Integration Test'); +}); \ No newline at end of file diff --git a/libraries/ckeditor/ckeditor-content.css b/libraries/ckeditor/ckeditor-content.css index 47274e5f4..972c0775a 100644 --- a/libraries/ckeditor/ckeditor-content.css +++ b/libraries/ckeditor/ckeditor-content.css @@ -4,6 +4,10 @@ display: none; } +.ck-content li p { + margin: 0 !important; +} + /* * CKEditor 5 (v41.0.0) content styles. * Generated on Fri, 26 Jan 2024 10:23:49 GMT. diff --git a/playwright.config.ts b/playwright.config.ts index 12420d3a5..313735158 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -31,6 +31,14 @@ export default defineConfig({ trace: 'on-first-retry', }, + webServer: { + command: "npm run integration-mem-db", + url: "http://127.0.0.1:8082", + reuseExistingServer: true, + stdout: "ignore", + stderr: "pipe" + }, + /* Configure projects for major browsers */ projects: [ { diff --git a/src/public/app/services/i18n.js b/src/public/app/services/i18n.js index 8b841c7de..feb01f4d7 100644 --- a/src/public/app/services/i18n.js +++ b/src/public/app/services/i18n.js @@ -11,7 +11,6 @@ export async function initLocale() { .init({ lng: locale, fallbackLng: "en", - debug: true, backend: { loadPath: `/${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json` } diff --git a/src/public/app/services/server.js b/src/public/app/services/server.js index b8a1d29fb..b715a426c 100644 --- a/src/public/app/services/server.js +++ b/src/public/app/services/server.js @@ -135,7 +135,11 @@ function ajax(url, method, data, headers, silentNotFound) { }); }, error: async jqXhr => { - if (silentNotFound && jqXhr.status === 404) { + if (jqXhr.status === 0) { + // don't report requests that are rejected by the browser, usually when the user is refreshing or going to a different page. + rej("rejected by browser"); + return; + } else if (silentNotFound && jqXhr.status === 404) { // report nothing } else { await reportError(method, url, jqXhr.status, jqXhr.responseText); diff --git a/src/public/app/widgets/note_context_aware_widget.js b/src/public/app/widgets/note_context_aware_widget.js index 1fb7e5de8..1d3a98b9c 100644 --- a/src/public/app/widgets/note_context_aware_widget.js +++ b/src/public/app/widgets/note_context_aware_widget.js @@ -57,7 +57,17 @@ class NoteContextAwareWidget extends BasicWidget { async refresh() { if (this.isEnabled()) { this.toggleInt(true); - await this.refreshWithNote(this.note); + + try { + await this.refreshWithNote(this.note); + } catch (e) { + // Ignore errors when user is refreshing or navigating away. + if (e === "rejected by browser") { + return; + } + + throw e; + } } else { this.toggleInt(false); diff --git a/src/public/app/widgets/ribbon_widgets/search_definition.js b/src/public/app/widgets/ribbon_widgets/search_definition.js index b766e69c7..af51833f3 100644 --- a/src/public/app/widgets/ribbon_widgets/search_definition.js +++ b/src/public/app/widgets/ribbon_widgets/search_definition.js @@ -199,7 +199,7 @@ export default class SearchDefinitionWidget extends NoteContextAwareWidget { this.$actionList.append( $('') .attr('data-action-add', action.actionName) - .text(t(`${action.actionTitle}`)) + .text(action.actionTitle) ); } } diff --git a/src/public/app/widgets/type_widgets/options/appearance/i18n.js b/src/public/app/widgets/type_widgets/options/appearance/i18n.js index 392e3e7a0..0c79ac94c 100644 --- a/src/public/app/widgets/type_widgets/options/appearance/i18n.js +++ b/src/public/app/widgets/type_widgets/options/appearance/i18n.js @@ -29,6 +29,8 @@ export default class LocalizationOptions extends OptionsWidget { async optionsLoaded(options) { const availableLocales = await server.get("options/locales"); + this.$localeSelect.empty(); + for (const locale of availableLocales) { this.$localeSelect.append($("