Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): mark a read-only text note printable, like every other type

Elian Doran656bcf39cc66
diff --git a/apps/client/src/widgets/note_types.tsx b/apps/client/src/widgets/note_types.tsx
index 214d34d409..1b5ceb5592 100644
--- a/apps/client/src/widgets/note_types.tsx
+++ b/apps/client/src/widgets/note_types.tsx
@@ -111,7 +111,8 @@ export const TYPE_MAPPINGS: Record<ExtendedNoteType, NoteTypeMapping> = {
},
readOnlyText: {
view: () => import("./type_widgets/text/ReadOnlyText"),
- className: "note-detail-readonly-text"
+ className: "note-detail-readonly-text",
+ printable: true
},
editableText: {
view: () => import("./type_widgets/text/EditableText"),
diff --git a/packages/trilium-e2e/src/help.spec.ts b/packages/trilium-e2e/src/help.spec.ts
index 52d1f7e27e..0b7504c8af 100644
--- a/packages/trilium-e2e/src/help.spec.ts
+++ b/packages/trilium-e2e/src/help.spec.ts
@@ -1,5 +1,5 @@
import { test, expect } from "@playwright/test";
-import App, { isStandalone } from "./support/app";
+import App from "./support/app";
test("Help popup", async ({ page, context }) => {
page.setDefaultTimeout(15_000);
@@ -11,7 +11,7 @@ test("Help popup", async ({ page, context }) => {
await expect(page.locator(".help-cards")).toBeVisible();
});
-test("In-app-help works in English", async ({ page, context }, testInfo) => {
+test("In-app-help works in English", async ({ page, context }) => {
const app = new App(page, context);
await app.goto();
@@ -20,22 +20,13 @@ test("In-app-help works in English", async ({ page, context }, testInfo) => {
await expect(app.noteTreeHoistedNote).toContainText(title);
await expect(app.currentNoteSplitTitle).toHaveValue(title);
- app.noteTree.getByText("Troubleshooting").click();
+ await app.noteTree.getByText("Troubleshooting").click();
await expect(app.currentNoteSplitTitle).toHaveValue("Troubleshooting");
- if (isStandalone(testInfo)) {
- // Standalone renders help as webView iframes pointing to docs site
- const iframe = app.currentNoteSplitContent.locator("iframe");
- await expect(iframe).toBeVisible();
- await expect(iframe).toHaveAttribute("src", /docs\.triliumnotes\.org.*troubleshooting/);
- } else {
- // Server/desktop renders help as inline doc content
- await app.currentNoteSplitContent.locator("p").first().waitFor({ state: "visible" });
- expect(await app.currentNoteSplitContent.locator("p").count()).toBeGreaterThan(10);
- }
+ await expectPageBody(app);
});
-test("In-app-help works in other languages", async ({ page, context }, testInfo) => {
+test("In-app-help works in other languages", async ({ page, context }) => {
const app = new App(page, context);
try {
await app.goto();
@@ -47,19 +38,18 @@ test("In-app-help works in other languages", async ({ page, context }, testInfo)
await expect(app.noteTreeHoistedNote).toContainText(title);
await expect(app.currentNoteSplitTitle).toHaveValue(title);
- app.noteTree.getByText("Troubleshooting").click();
+ await app.noteTree.getByText("Troubleshooting").click();
await expect(app.currentNoteSplitTitle).toHaveValue("Troubleshooting");
- if (isStandalone(testInfo)) {
- const iframe = app.currentNoteSplitContent.locator("iframe");
- await expect(iframe).toBeVisible();
- await expect(iframe).toHaveAttribute("src", /docs\.triliumnotes\.org.*troubleshooting/);
- } else {
- await app.currentNoteSplitContent.locator("p").first().waitFor({ state: "visible" });
- expect(await app.currentNoteSplitContent.locator("p").count()).toBeGreaterThan(10);
- }
+ await expectPageBody(app);
} finally {
// Ensure English is set after each locale change to avoid any leaks to other tests.
await app.setOption("locale", "en");
}
});
+
+/** Every platform now renders the guide from the shipped artifacts, so a page's body is inline HTML. */
+async function expectPageBody(app: App) {
+ await app.currentNoteSplitContent.locator("p").first().waitFor({ state: "visible" });
+ expect(await app.currentNoteSplitContent.locator("p").count()).toBeGreaterThan(10);
+}