From 8aaa4d7bde81541ed2beb6e3b9ec6210171a6d41 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Apr 2026 12:40:33 +0300 Subject: [PATCH] feat(revisions): add a description field --- .../src/translations/en/translation.json | 8 +- apps/client/src/widgets/dialogs/revisions.tsx | 187 +++++++++++++++--- apps/server/src/assets/db/schema.sql | 1 + apps/server/src/becca/entities/bnote.ts | 3 +- apps/server/src/becca/entities/brevision.ts | 5 +- apps/server/src/etapi/mappers.ts | 1 + apps/server/src/etapi/notes.ts | 5 +- apps/server/src/migrations/migrations.ts | 8 + apps/server/src/routes/api/notes.ts | 7 +- apps/server/src/routes/api/revisions.ts | 15 +- apps/server/src/routes/routes.ts | 1 + packages/commons/src/lib/rows.ts | 1 + packages/commons/src/lib/server_api.ts | 2 + 13 files changed, 206 insertions(+), 38 deletions(-) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 79cf207780..796e4c08fa 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -304,7 +304,13 @@ "download_button": "Download", "mime": "MIME: ", "file_size": "File size:", - "preview_not_available": "Preview isn't available for this note type." + "preview_not_available": "Preview isn't available for this note type.", + "save_revision": "Save revision", + "save_revision_tooltip": "Manually save a snapshot of the current note", + "description_placeholder": "Add a description (optional)", + "revision_saved": "Note revision has been saved.", + "edit_description": "Edit description", + "description_updated": "Revision description has been updated." }, "sort_child_notes": { "sort_children_by": "Sort children by...", diff --git a/apps/client/src/widgets/dialogs/revisions.tsx b/apps/client/src/widgets/dialogs/revisions.tsx index 66ce763a3d..06a44ed859 100644 --- a/apps/client/src/widgets/dialogs/revisions.tsx +++ b/apps/client/src/widgets/dialogs/revisions.tsx @@ -66,36 +66,47 @@ export default function RevisionsDialog() { helpPageId="vZWERwf8U3nx" bodyStyle={{ display: "flex", height: "80vh" }} header={ - !!revisions?.length && ( - <> - {["text", "code", "mermaid"].includes(currentRevision?.type ?? "") && ( - setShowDiff(newValue)} - switchOnName={t("revisions.diff_on")} - switchOffName={t("revisions.diff_off")} - switchOnTooltip={t("revisions.diff_on_hint")} - switchOffTooltip={t("revisions.diff_off_hint")} - /> - )} -   -