From 82a46e93454aa422e48902c7358deb3de788b34f Mon Sep 17 00:00:00 2001 From: grnd-alt Date: Mon, 19 Oct 2026 12:21:45 +0200 Subject: [PATCH] fix(description): use non-collaborative Text editor for cards without an id Assisted-by: ClaudeCode:claude-sonnet-5-5 Signed-off-by: grnd-alt --- src/components/card/Description.vue | 37 ++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/components/card/Description.vue b/src/components/card/Description.vue index 9e42f1790..09caf774f 100644 --- a/src/components/card/Description.vue +++ b/src/components/card/Description.vue @@ -7,8 +7,8 @@
{{ t('deck', 'Description') }} - {{ t('deck', '(Unsaved)') }} - {{ t('deck', '(Saving…)') }} + {{ t('deck', '(Unsaved)') }} + {{ t('deck', '(Saving…)') }} { const url = OC.MimeType.getIconUrl(mimetype) @@ -194,7 +200,7 @@ export default { watch: { card(newCard) { - if (this.textAppAvailable) { + if (this.collaborative) { return } if (newCard.description !== this.descriptionOld) { @@ -209,6 +215,10 @@ export default { }, mounted() { + if (!this.collaborative) { + this.descriptionOld = this.card.description + this.description = this.card.description + } if (this.textAppAvailable) { this.setupEditor() } @@ -226,16 +236,31 @@ export default { ...mapActions(useSettingsStore, ['setHasCardSaveError']), async setupEditor() { await this.destroyEditor() - this.editor = await window.OCA.Text.createCollaborativeEditor({ - context: { type: 'deck_card', id: this.card.id }, + if (this.collaborative) { + this.editor = await window.OCA.Text.createCollaborativeEditor({ + context: { type: 'deck_card', id: this.card.id }, + el: this.$refs.editor, + readOnly: !this.canEdit, + }) + return + } + this.editor = await window.OCA.Text.createMarkdownContentEditor({ el: this.$refs.editor, + content: this.card.description, readOnly: !this.canEdit, + onUpdate: ({ markdown }) => { + if (this.description === markdown) { + return + } + this.description = markdown + this.updateDescription() + }, }) }, async destroyEditor() { clearTimeout(this.descriptionSaveTimeout) - if (!this.textAppAvailable) { + if (!this.collaborative) { await this.saveDescription() } try {