From 9eddb0d1ea7f1582ee79233a1ea4de21f80cc66b Mon Sep 17 00:00:00 2001 From: Yuuki Gabriele Patriarca Date: Thu, 19 Feb 2026 19:40:44 +0100 Subject: [PATCH 1/2] fix html editor collapses after toggling sticky fields and adding a new note --- ts/editor/NoteEditor.svelte | 7 +------ ts/editor/types.ts | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index 17ced575bc3..a1df6138274 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -99,7 +99,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html plainTextsHidden, plainTextDefaults, }, - modTimeOfNotetype: notetypeMeta.modTime, }; } } @@ -155,7 +154,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export function setPlainTexts(defaultPlainTexts: boolean[]): void { const states = sessionOptions[notetypeMeta?.id]?.fieldStates; - if (states) { + if (states && states.richTextsHidden.length === defaultPlainTexts.length) { richTextsHidden = states.richTextsHidden; plainTextsHidden = states.plainTextsHidden; plainTextDefaults = states.plainTextDefaults; @@ -240,10 +239,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let notetypeMeta: NotetypeIdAndModTime; function setNotetypeMeta({ id, modTime }: NotetypeIdAndModTime): void { notetypeMeta = { id, modTime }; - // Discard the saved state of the fields if the notetype has been modified. - if (sessionOptions[id]?.modTimeOfNotetype !== modTime) { - delete sessionOptions[id]; - } if (isImageOcclusion) { getImageOcclusionFields({ notetypeId: BigInt(notetypeMeta.id), diff --git a/ts/editor/types.ts b/ts/editor/types.ts index 14cece17536..0282fc4423a 100644 --- a/ts/editor/types.ts +++ b/ts/editor/types.ts @@ -8,7 +8,6 @@ export type EditorOptions = { plainTextsHidden: boolean[]; plainTextDefaults: boolean[]; }; - modTimeOfNotetype: number; }; export type SessionOptions = { From ed5837387d90b85f1b61cd97ed9d9d470ccdb878 Mon Sep 17 00:00:00 2001 From: Yuuki Gabriele Patriarca Date: Thu, 19 Feb 2026 20:04:59 +0100 Subject: [PATCH 2/2] fix test fails --- CONTRIBUTORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b80ca95ca41..21842ed3f40 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -262,7 +262,7 @@ defkorean Michael Lappas Brett Schwartz Lovro Boban -Yuuki Gabriele Patriarca +Yuuki Gabriele Patriarca SecretX ********************