Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): address automated review feedback

Elian Doran6bf955f4226b
diff --git a/apps/client/src/services/task_states.spec.ts b/apps/client/src/services/task_states.spec.ts
index b7b21dff8e..c4da9fd0e1 100644
--- a/apps/client/src/services/task_states.spec.ts
+++ b/apps/client/src/services/task_states.spec.ts
@@ -138,14 +138,14 @@ describe("getTaskStateDefinitions", () => {
]);
// Its button opens the task-states config popup and dismisses the toast.
- const triggerCommand = vi.fn();
- (appContext as unknown as { triggerCommand: typeof triggerCommand }).triggerCommand = triggerCommand;
+ const triggerCommand = vi.spyOn(appContext, "triggerCommand").mockImplementation(() => undefined);
const dismissToast = vi.fn();
options.buttons?.[0].onClick({ dismissToast });
expect(triggerCommand).toHaveBeenCalledWith("openInTreePopup", expect.objectContaining({
noteIdOrPath: TASK_STATES_CONTAINER_ID
}));
expect(dismissToast).toHaveBeenCalled();
+ triggerCommand.mockRestore();
// An unchanged error set is not re-reported...
await getTaskStateDefinitions();
@@ -166,8 +166,7 @@ describe("getTaskStateDefinitions", () => {
describe("openCustomTaskStateConfig", () => {
it("opens the task-states container hoisted in the tree popup", () => {
- const triggerCommand = vi.fn();
- (appContext as unknown as { triggerCommand: typeof triggerCommand }).triggerCommand = triggerCommand;
+ const triggerCommand = vi.spyOn(appContext, "triggerCommand").mockImplementation(() => undefined);
openCustomTaskStateConfig();
@@ -175,5 +174,6 @@ describe("openCustomTaskStateConfig", () => {
noteIdOrPath: TASK_STATES_CONTAINER_ID,
hoistedNoteId: TASK_STATES_CONTAINER_ID
});
+ triggerCommand.mockRestore();
});
});
diff --git a/apps/client/src/widgets/dialogs/TreePopupEditor.tsx b/apps/client/src/widgets/dialogs/TreePopupEditor.tsx
index 34dc52b3f3..78d98e75e8 100644
--- a/apps/client/src/widgets/dialogs/TreePopupEditor.tsx
+++ b/apps/client/src/widgets/dialogs/TreePopupEditor.tsx
@@ -29,7 +29,8 @@ export default function TreePopupEditor() {
useTriliumEvent("openInTreePopup", async ({ noteIdOrPath, hoistedNoteId }) => {
// Fresh context per open so the sidebar tree is hoisted to the requested subtree.
const newContext = new NoteContext("_tree-popup", hoistedNoteId);
- setStacked(!!document.querySelector(".modal.show"));
+ // Exclude our own modal so re-opening while already shown doesn't count as stacking.
+ setStacked(Array.from(document.querySelectorAll(".modal.show")).some((modal) => modal !== modalRef.current));
await newContext.setNote(noteIdOrPath, { keepActiveDialog: true });
// Events triggered at note-context level (e.g. the save indicator) would not work since this
diff --git a/apps/server/playwright.config.nixos.ts b/apps/server/playwright.config.nixos.ts
deleted file mode 100644
index 08d4848ce6..0000000000
--- a/apps/server/playwright.config.nixos.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-// Temporary local config: reuse the standard e2e config but launch the system
-// chromium (NixOS: Playwright's downloaded builds can't resolve shared libs).
-import { defineConfig } from "@playwright/test";
-
-import baseConfig from "./playwright.config";
-
-export default defineConfig({
- ...baseConfig,
- use: {
- ...(baseConfig as { use?: object }).use,
- launchOptions: {
- executablePath: "/etc/profiles/per-user/elian/bin/chromium"
- }
- }
-});