Skip to content

Build your personal knowledge base with Trilium Notes

feat(bulk_actions): describe actions in the add menu, not in help panels

Elian Doran73b40d22e432
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 481982f4d1..e3da197391 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -92,6 +92,7 @@
"include_descendants": "Include descendants of the selected notes",
"add_action": "Add action",
"chosen_actions": "Chosen actions",
+ "remove_action": "Remove this action",
"execute_bulk_actions": "Execute bulk actions",
"bulk_actions_executed": "Bulk actions have been executed successfully.",
"none_yet": "No actions yet. Use Add action below to choose one.",
@@ -885,9 +886,7 @@
},
"execute_script": {
"execute_script": "Execute script",
- "help_text": "You can execute simple scripts on the matched notes.",
- "example_1": "For example to append a string to a note's title, use this small script:",
- "example_2": "More complex example would be deleting all matched note's attributes:"
+ "description": "Runs a backend script on each note, which reads and changes it through the note variable. The note is saved afterwards."
},
"add_label": {
"add_label": "Add label",
@@ -895,15 +894,13 @@
"label_name_title": "Alphanumeric characters, underscore and colon are allowed characters.",
"to_value": "to value",
"new_value_placeholder": "new value",
- "help_text": "On all matched notes:",
- "help_text_item1": "create given label if note doesn't have one yet",
- "help_text_item2": "or change value of the existing label",
- "help_text_note": "You can also call this method without value, in such case label will be assigned to the note without value."
+ "description": "Adds the label to each note, with the given value or none. It is added even if the note already has the label, so the note ends up with it twice."
},
"delete_label": {
"delete_label": "Delete label",
"label_name_placeholder": "label name",
- "label_name_title": "Alphanumeric characters, underscore and colon are allowed characters."
+ "label_name_title": "Alphanumeric characters, underscore and colon are allowed characters.",
+ "description": "Removes the label from each note that has it directly."
},
"rename_label": {
"rename_label": "Rename label",
@@ -911,7 +908,8 @@
"old_name_placeholder": "old name",
"to": "To",
"new_name_placeholder": "new name",
- "name_title": "Alphanumeric characters, underscore and colon are allowed characters."
+ "name_title": "Alphanumeric characters, underscore and colon are allowed characters.",
+ "description": "Renames the label on each note that has it directly, keeping its value."
},
"update_label_value": {
"update_label_value": "Update label value",
@@ -919,33 +917,27 @@
"label_name_title": "Alphanumeric characters, underscore and colon are allowed characters.",
"to_value": "to value",
"new_value_placeholder": "new value",
- "help_text": "On all matched notes, change value of the existing label.",
- "help_text_note": "You can also call this method without value, in such case label will be assigned to the note without value."
+ "description": "Sets the value of the label on each note that has it directly. Inherited labels are not changed."
},
"delete_note": {
"delete_note": "Delete note",
"delete_matched_notes": "Delete matched notes",
- "delete_matched_notes_description": "This will delete matched notes.",
- "undelete_notes_instruction": "After the deletion, it's possible to undelete them from Recent Changes dialog.",
- "erase_notes_instruction": "To erase notes permanently, you can go after the deletion to the Option -> Other and click the \"Erase deleted notes now\" button."
+ "description": "Deletes each note, including its clones and any child notes that are not cloned elsewhere. Deleted notes can be restored from Recent changes until they are erased."
},
"save_revision": {
"save_revision": "Save revision",
"revision_name_placeholder": "Revision name (optional)",
- "help": "A named revision will be saved for each matched note, capturing its current content and title."
+ "description": "Saves a revision of each note, with an optional name. Protected notes are skipped unless a protected session is active."
},
"delete_revisions": {
"delete_note_revisions": "Delete note revisions",
- "all_past_note_revisions": "All past note revisions of matched notes will be deleted. Note itself will be fully preserved. In other terms, note's history will be removed."
+ "description": "Permanently erases all revisions of each note. The notes themselves are kept."
},
"move_note": {
"move_note": "Move note",
"to": "to",
"target_parent_note": "target parent note",
- "on_all_matched_notes": "On all matched notes",
- "move_note_new_parent": "move note to the new parent if note has only one parent (i.e. the old branch is removed and new branch into the new parent is created)",
- "clone_note_new_parent": "clone note to the new parent if note has multiple clones/branches (it's not clear which branch should be removed)",
- "nothing_will_happen": "nothing will happen if note cannot be moved to the target note (i.e. this would create a tree cycle)"
+ "description": "Moves each note under the target note. A note with several parents is cloned there instead, and one that cannot go there, such as a parent of the target, stays where it is."
},
"convert_note": {
"convert_note": "Convert",
@@ -953,20 +945,15 @@
"choose_conversion": "(choose a conversion)",
"conversion_htmlToMarkdown": "Text Notes → Markdown Notes (lossy)",
"conversion_markdownToHtml": "Markdown Notes → Text Notes",
- "help_text": "The conversion is applied only to notes matching the source type; other notes are left untouched. A revision of each converted note is saved beforehand.",
"warning": "Some formatting may be lost when converting notes and you may need to fix a few things afterwards. A revision of each converted note will be saved beforehand so you can restore it. Do you want to continue?",
- "warning_risky": "You are converting between two formats that don't have identical capabilities, so some formatting may be lost and some unsupported elements may be dropped.<br><br>Do you fully assume this risk and want to proceed with the conversion?<br><br>A revision of each converted note will be saved beforehand, so you can revert to the original format."
+ "warning_risky": "You are converting between two formats that don't have identical capabilities, so some formatting may be lost and some unsupported elements may be dropped.<br><br>Do you fully assume this risk and want to proceed with the conversion?<br><br>A revision of each converted note will be saved beforehand, so you can revert to the original format.",
+ "description": "Converts text notes to Markdown, or Markdown notes to text, saving a revision of each first. Notes of other types are left alone."
},
"rename_note": {
"rename_note": "Rename note",
"rename_note_title_to": "Rename note title to",
"new_note_title": "new note title",
- "click_help_icon": "Click help icon on the right to see all the options",
- "evaluated_as_js_string": "The given value is evaluated as JavaScript string and thus can be enriched with dynamic content via the injected <code>note</code> variable (note being renamed). Examples:",
- "example_note": "<code>Note</code> - all matched notes are renamed to 'Note'",
- "example_new_title": "<code>NEW: ${note.title}</code> - matched notes titles are prefixed with 'NEW: '",
- "example_date_prefix": "<code>${note.dateCreatedObj.format('MM-DD:')}: ${note.title}</code> - matched notes are prefixed with note's creation month-date",
- "api_docs": "See API docs for <a href='https://zadam.github.io/trilium/backend_api/Note.html'>note</a> and its <a href='https://day.js.org/docs/en/display/format'>dateCreatedObj / utcDateCreatedObj properties</a> for details."
+ "description": "Sets the title of each note. The title is a JavaScript template string, so ${note.title} stands for the current title."
},
"add_relation": {
"add_relation": "Add relation",
@@ -974,12 +961,13 @@
"allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters.",
"to": "to",
"target_note": "target note",
- "create_relation_on_all_matched_notes": "On all matched notes create given relation."
+ "description": "Adds a relation from each note to the target note. It is added even if the note already has a relation of that name."
},
"delete_relation": {
"delete_relation": "Delete relation",
"relation_name": "relation name",
- "allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters."
+ "allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters.",
+ "description": "Removes the relation from each note that has it directly."
},
"rename_relation": {
"rename_relation": "Rename relation",
@@ -987,7 +975,8 @@
"old_name": "old name",
"to": "To",
"new_name": "new name",
- "allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters."
+ "allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters.",
+ "description": "Renames the relation on each note that has it directly, keeping its target."
},
"update_relation_target": {
"update_relation": "Update relation",
@@ -995,9 +984,8 @@
"allowed_characters": "Alphanumeric characters, underscore and colon are allowed characters.",
"to": "to",
"target_note": "target note",
- "on_all_matched_notes": "On all matched notes",
- "change_target_note": "change target note of the existing relation",
- "update_relation_target": "Update relation target"
+ "update_relation_target": "Update relation target",
+ "description": "Points the relation on each note that has it directly to the target note."
},
"attachments_actions": {
"open_externally": "Open externally",
diff --git a/apps/client/src/widgets/bulk_actions/AddBulkActionButton.tsx b/apps/client/src/widgets/bulk_actions/AddBulkActionButton.tsx
index e7b06e14e1..c145abb495 100644
--- a/apps/client/src/widgets/bulk_actions/AddBulkActionButton.tsx
+++ b/apps/client/src/widgets/bulk_actions/AddBulkActionButton.tsx
@@ -30,8 +30,13 @@ export default function AddBulkActionButton({ noteId, text, buttonClassName }: A
<FormListHeader text={title} />
<div>
- {actions.map(({ actionName, actionTitle, actionIcon }) => (
- <FormListItem key={actionName} icon={actionIcon} onClick={() => bulk_action.addAction(noteId, actionName)}>{actionTitle}</FormListItem>
+ {actions.map(({ actionName, actionTitle, actionIcon, actionDescription }) => (
+ <FormListItem
+ key={actionName}
+ icon={actionIcon}
+ title={actionDescription}
+ onClick={() => bulk_action.addAction(noteId, actionName)}
+ >{actionTitle}</FormListItem>
))}
</div>
</Fragment>
diff --git a/apps/client/src/widgets/bulk_actions/BulkAction.tsx b/apps/client/src/widgets/bulk_actions/BulkAction.tsx
index 497bdbae0d..c357854af5 100644
--- a/apps/client/src/widgets/bulk_actions/BulkAction.tsx
+++ b/apps/client/src/widgets/bulk_actions/BulkAction.tsx
@@ -2,6 +2,7 @@ import "./BulkAction.css";
import { ComponentChildren } from "preact";
import { memo } from "preact/compat";
+import { t } from "../../services/i18n";
import AbstractBulkAction from "./abstract_bulk_action";
import HelpRemoveButtons from "../react/HelpRemoveButtons";
import Icon from "../react/Icon";
@@ -9,7 +10,6 @@ import Icon from "../react/Icon";
interface BulkActionProps {
label: string | ComponentChildren;
children?: ComponentChildren;
- helpText?: ComponentChildren;
bulkAction: AbstractBulkAction;
}
@@ -18,7 +18,7 @@ const flexContainerStyle = { display: "flex", alignItems: "center" } as const;
const labelStyle = { marginInlineEnd: "10px" } as const;
const textStyle = { marginInlineEnd: "10px", marginInlineStart: "10px" } as const;
-const BulkAction = memo(({ label, children, helpText, bulkAction }: BulkActionProps) => {
+const BulkAction = memo(({ label, children, bulkAction }: BulkActionProps) => {
const { actionIcon } = bulkAction.constructor as typeof AbstractBulkAction;
return (
@@ -33,8 +33,7 @@ const BulkAction = memo(({ label, children, helpText, bulkAction }: BulkActionPr
</div>
</td>
<HelpRemoveButtons
- help={helpText}
- removeText="Delete"
+ removeText={t("bulk_actions.remove_action")}
onRemove={() => bulkAction?.deleteAction()}
/>
</tr>
diff --git a/apps/client/src/widgets/bulk_actions/abstract_bulk_action.ts b/apps/client/src/widgets/bulk_actions/abstract_bulk_action.ts
index 6c19f9764f..d7e449c423 100644
--- a/apps/client/src/widgets/bulk_actions/abstract_bulk_action.ts
+++ b/apps/client/src/widgets/bulk_actions/abstract_bulk_action.ts
@@ -51,6 +51,11 @@ export default abstract class AbstractBulkAction {
return "";
}
+ /** What the action does, shown as the tooltip of its entry in the add menu. */
+ static get actionDescription() {
+ return "";
+ }
+
async saveAction(data: {}) {
const actionObject = Object.assign({ name: (this.constructor as typeof AbstractBulkAction).actionName }, data);
diff --git a/apps/client/src/widgets/bulk_actions/execute_script.tsx b/apps/client/src/widgets/bulk_actions/execute_script.tsx
index 7af8f2d253..854deb59c0 100644
--- a/apps/client/src/widgets/bulk_actions/execute_script.tsx
+++ b/apps/client/src/widgets/bulk_actions/execute_script.tsx
@@ -14,17 +14,6 @@ function ExecuteScriptBulkActionComponent({ bulkAction, actionDef }: { bulkActio
<BulkAction
bulkAction={bulkAction}
label={t("execute_script.execute_script")}
- helpText={<>
- {t("execute_script.help_text")}
-
- {t("execute_script.example_1")}
-
- <pre>note.title = note.title + ' - suffix';</pre>
-
- {t("execute_script.example_2")}
-
- <pre>{"for (const attr of note.getOwnedAttributes) { attr.markAsDeleted(); }"}</pre>
- </>}
>
<FormTextBox
placeholder="note.title = note.title + '- suffix';"
@@ -45,6 +34,9 @@ export default class ExecuteScriptBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-play";
}
+ static get actionDescription() {
+ return t("execute_script.description");
+ }
doRender() {
return <ExecuteScriptBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/label/add_label.tsx b/apps/client/src/widgets/bulk_actions/label/add_label.tsx
index e8fdabc1bf..a14355e552 100644
--- a/apps/client/src/widgets/bulk_actions/label/add_label.tsx
+++ b/apps/client/src/widgets/bulk_actions/label/add_label.tsx
@@ -15,16 +15,6 @@ function AddLabelBulkActionComponent({ bulkAction, actionDef }: { bulkAction: Ab
<BulkAction
bulkAction={bulkAction}
label={t("add_label.add_label")}
- helpText={<>
- <p>{t("add_label.help_text")}</p>
-
- <ul>
- <li>{t("add_label.help_text_item1")}</li>
- <li>{t("add_label.help_text_item2")}</li>
- </ul>
-
- {t("add_label.help_text_note")}
- </>}
>
<FormTextBox
placeholder={t("add_label.label_name_placeholder")}
@@ -57,4 +47,7 @@ export default class AddLabelBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-hash bulk-action-marker-add";
}
+ static get actionDescription() {
+ return t("add_label.description");
+ }
}
diff --git a/apps/client/src/widgets/bulk_actions/label/delete_label.tsx b/apps/client/src/widgets/bulk_actions/label/delete_label.tsx
index b7ce0c731e..83c5c7e897 100644
--- a/apps/client/src/widgets/bulk_actions/label/delete_label.tsx
+++ b/apps/client/src/widgets/bulk_actions/label/delete_label.tsx
@@ -35,6 +35,9 @@ export default class DeleteLabelBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-hash bulk-action-marker-delete";
}
+ static get actionDescription() {
+ return t("delete_label.description");
+ }
doRender() {
return <DeleteLabelBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/label/rename_label.tsx b/apps/client/src/widgets/bulk_actions/label/rename_label.tsx
index bdc4728744..a6cbd3d1df 100644
--- a/apps/client/src/widgets/bulk_actions/label/rename_label.tsx
+++ b/apps/client/src/widgets/bulk_actions/label/rename_label.tsx
@@ -45,6 +45,9 @@ export default class RenameLabelBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-hash bulk-action-marker-rename";
}
+ static get actionDescription() {
+ return t("rename_label.description");
+ }
doRender() {
return <RenameLabelBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/label/update_label_value.tsx b/apps/client/src/widgets/bulk_actions/label/update_label_value.tsx
index 56f8c17a33..3d0f3770d0 100644
--- a/apps/client/src/widgets/bulk_actions/label/update_label_value.tsx
+++ b/apps/client/src/widgets/bulk_actions/label/update_label_value.tsx
@@ -15,11 +15,6 @@ function UpdateLabelValueComponent({ bulkAction, actionDef }: { bulkAction: Abst
<BulkAction
bulkAction={bulkAction}
label={t("update_label_value.update_label_value")}
- helpText={<>
- <p>{t("update_label_value.help_text")}</p>
-
- {t("update_label_value.help_text_note")}
- </>}
>
<FormTextBox
placeholder={t("update_label_value.label_name_placeholder")}
@@ -46,6 +41,9 @@ export default class UpdateLabelValueBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-hash bulk-action-marker-update";
}
+ static get actionDescription() {
+ return t("update_label_value.description");
+ }
doRender() {
return <UpdateLabelValueComponent bulkAction={this} actionDef={this.actionDef} />;
diff --git a/apps/client/src/widgets/bulk_actions/note/convert_note.tsx b/apps/client/src/widgets/bulk_actions/note/convert_note.tsx
index e7238fde5d..40a32cc544 100644
--- a/apps/client/src/widgets/bulk_actions/note/convert_note.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/convert_note.tsx
@@ -28,7 +28,6 @@ function ConvertNoteBulkActionComponent({ bulkAction, actionDef }: { bulkAction:
<BulkAction
bulkAction={bulkAction}
label={t("convert_note.convert_note_to")}
- helpText={<p>{t("convert_note.help_text")}</p>}
>
<FormSelect
values={conversionOptions}
@@ -68,4 +67,7 @@ export default class ConvertNoteBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-note bulk-action-marker-convert";
}
+ static get actionDescription() {
+ return t("convert_note.description");
+ }
}
diff --git a/apps/client/src/widgets/bulk_actions/note/delete_note.tsx b/apps/client/src/widgets/bulk_actions/note/delete_note.tsx
index bca5176f90..b42a3119fb 100644
--- a/apps/client/src/widgets/bulk_actions/note/delete_note.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/delete_note.tsx
@@ -8,13 +8,6 @@ function DeleteNoteBulkActionComponent({ bulkAction }: { bulkAction: AbstractBul
<BulkAction
bulkAction={bulkAction}
label={<><Icon icon="bx bx-trash" /> {t("delete_note.delete_matched_notes")}</>}
- helpText={<>
- <p>{t("delete_note.delete_matched_notes_description")}</p>
-
- <p>{t("delete_note.undelete_notes_instruction")}</p>
-
- {t("delete_note.erase_notes_instruction")}
- </>}
/>
);
}
@@ -29,6 +22,9 @@ export default class DeleteNoteBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-note bulk-action-marker-delete destructive-action-icon";
}
+ static get actionDescription() {
+ return t("delete_note.description");
+ }
doRender() {
return <DeleteNoteBulkActionComponent bulkAction={this} />
diff --git a/apps/client/src/widgets/bulk_actions/note/delete_revisions.tsx b/apps/client/src/widgets/bulk_actions/note/delete_revisions.tsx
index 929dca80e0..a9e2022fd8 100644
--- a/apps/client/src/widgets/bulk_actions/note/delete_revisions.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/delete_revisions.tsx
@@ -8,7 +8,6 @@ function DeleteRevisionsBulkActionComponent({ bulkAction }: { bulkAction: Abstra
<BulkAction
bulkAction={bulkAction}
label={<><Icon icon="bx bx-trash" /> {t("delete_revisions.delete_note_revisions")}</>}
- helpText={t("delete_revisions.all_past_note_revisions")}
/>
)
}
@@ -24,6 +23,9 @@ export default class DeleteRevisionsBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-history bulk-action-marker-delete destructive-action-icon";
}
+ static get actionDescription() {
+ return t("delete_revisions.description");
+ }
doRender() {
return <DeleteRevisionsBulkActionComponent bulkAction={this} />
diff --git a/apps/client/src/widgets/bulk_actions/note/move_note.tsx b/apps/client/src/widgets/bulk_actions/note/move_note.tsx
index 407aa06e2e..eb5dede603 100644
--- a/apps/client/src/widgets/bulk_actions/note/move_note.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/move_note.tsx
@@ -16,15 +16,6 @@ function MoveNoteBulkActionComponent({ bulkAction }: { bulkAction: AbstractBulkA
<BulkAction
bulkAction={bulkAction}
label={t("move_note.move_note")}
- helpText={<>
- <p>{t("move_note.on_all_matched_notes")}:</p>
-
- <ul style="margin-bottom: 0;">
- <li>{t("move_note.move_note_new_parent")}</li>
- <li>{t("move_note.clone_note_new_parent")}</li>
- <li>{t("move_note.nothing_will_happen")}</li>
- </ul>
- </>}
>
<BulkActionText text={t("move_note.to")} />
@@ -46,6 +37,9 @@ export default class MoveNoteBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-note bulk-action-marker-move";
}
+ static get actionDescription() {
+ return t("move_note.description");
+ }
doRender() {
return <MoveNoteBulkActionComponent bulkAction={this} />
diff --git a/apps/client/src/widgets/bulk_actions/note/rename_note.tsx b/apps/client/src/widgets/bulk_actions/note/rename_note.tsx
index d9d13a417f..93a996240c 100644
--- a/apps/client/src/widgets/bulk_actions/note/rename_note.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/rename_note.tsx
@@ -4,7 +4,6 @@ import BulkAction from "../BulkAction.jsx";
import FormTextBox from "../../react/FormTextBox.jsx";
import { useEffect, useState } from "preact/hooks";
import { useSpacedUpdate } from "../../react/hooks.jsx";
-import RawHtml from "../../react/RawHtml.jsx";
function RenameNoteBulkActionComponent({ bulkAction, actionDef }: { bulkAction: AbstractBulkAction, actionDef: ActionDefinition}) {
const [ newTitle, setNewTitle ] = useState<string>(actionDef.newTitle ?? "");
@@ -15,21 +14,10 @@ function RenameNoteBulkActionComponent({ bulkAction, actionDef }: { bulkAction:
<BulkAction
bulkAction={bulkAction}
label={t("rename_note.rename_note_title_to")}
- helpText={<>
- <p>{t("rename_note.evaluated_as_js_string")}</p>
-
- <ul>
- <li><RawHtml html={t("rename_note.example_note")} /></li>
- <li><RawHtml html={t("rename_note.example_new_title")} /></li>
- <li><RawHtml html={t("rename_note.example_date_prefix")} /></li>
- </ul>
-
- <RawHtml html={t("rename_note.api_docs")} />
- </>}
>
<FormTextBox
placeholder={t("rename_note.new_note_title")}
- title={("rename_note.click_help_icon")}
+ title={t("rename_note.description")}
currentValue={newTitle} onChange={setNewTitle}
/>
</BulkAction>
@@ -47,6 +35,9 @@ export default class RenameNoteBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-note bulk-action-marker-rename";
}
+ static get actionDescription() {
+ return t("rename_note.description");
+ }
doRender() {
return <RenameNoteBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/note/save_revision.tsx b/apps/client/src/widgets/bulk_actions/note/save_revision.tsx
index d695acac9e..ac618114a2 100644
--- a/apps/client/src/widgets/bulk_actions/note/save_revision.tsx
+++ b/apps/client/src/widgets/bulk_actions/note/save_revision.tsx
@@ -22,7 +22,6 @@ function SaveRevisionBulkActionComponent({ bulkAction, actionDef }: { bulkAction
<BulkAction
bulkAction={bulkAction}
label={<><Icon icon="bx bx-save" /> {t("save_revision.save_revision")}</>}
- helpText={t("save_revision.help")}
>
<FormTextBox
placeholder={t("save_revision.revision_name_placeholder")}
@@ -43,6 +42,9 @@ export default class SaveRevisionBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-history bulk-action-marker-add";
}
+ static get actionDescription() {
+ return t("save_revision.description");
+ }
doRender() {
return <SaveRevisionBulkActionComponent bulkAction={this} actionDef={this.actionDef} />;
diff --git a/apps/client/src/widgets/bulk_actions/relation/add_relation.tsx b/apps/client/src/widgets/bulk_actions/relation/add_relation.tsx
index 76c9296633..d046e2f1d2 100644
--- a/apps/client/src/widgets/bulk_actions/relation/add_relation.tsx
+++ b/apps/client/src/widgets/bulk_actions/relation/add_relation.tsx
@@ -16,7 +16,6 @@ function AddRelationBulkActionComponent({ bulkAction, actionDef }: { bulkAction:
<BulkAction
bulkAction={bulkAction}
label={t("add_relation.add_relation")}
- helpText={t("add_relation.create_relation_on_all_matched_notes")}
>
<FormTextBox
placeholder={t("add_relation.relation_name")}
@@ -47,6 +46,9 @@ export default class AddRelationBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-transfer bulk-action-marker-add";
}
+ static get actionDescription() {
+ return t("add_relation.description");
+ }
doRender() {
return <AddRelationBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/relation/delete_relation.tsx b/apps/client/src/widgets/bulk_actions/relation/delete_relation.tsx
index 75b67d8a53..cc8d0d2b7b 100644
--- a/apps/client/src/widgets/bulk_actions/relation/delete_relation.tsx
+++ b/apps/client/src/widgets/bulk_actions/relation/delete_relation.tsx
@@ -37,6 +37,9 @@ export default class DeleteRelationBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-transfer bulk-action-marker-delete";
}
+ static get actionDescription() {
+ return t("delete_relation.description");
+ }
doRender() {
return <DeleteRelationBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/relation/rename_relation.tsx b/apps/client/src/widgets/bulk_actions/relation/rename_relation.tsx
index a333667717..0ad451c6a8 100644
--- a/apps/client/src/widgets/bulk_actions/relation/rename_relation.tsx
+++ b/apps/client/src/widgets/bulk_actions/relation/rename_relation.tsx
@@ -45,6 +45,9 @@ export default class RenameRelationBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-transfer bulk-action-marker-rename";
}
+ static get actionDescription() {
+ return t("rename_relation.description");
+ }
doRender() {
return <RenameRelationBulkActionComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/bulk_actions/relation/update_relation_target.tsx b/apps/client/src/widgets/bulk_actions/relation/update_relation_target.tsx
index d54477e8b3..c3ba2cb952 100644
--- a/apps/client/src/widgets/bulk_actions/relation/update_relation_target.tsx
+++ b/apps/client/src/widgets/bulk_actions/relation/update_relation_target.tsx
@@ -16,13 +16,6 @@ function UpdateRelationTargetComponent({ bulkAction, actionDef }: { bulkAction:
<BulkAction
bulkAction={bulkAction}
label={t("update_relation_target.update_relation")}
- helpText={<>
- <p>{t("update_relation_target.on_all_matched_notes")}:</p>
-
- <ul style="margin-bottom: 0;">
- <li>{t("update_relation_target.change_target_note")}</li>
- </ul>
- </>}
>
<FormTextBox
placeholder={t("update_relation_target.relation_name")}
@@ -55,6 +48,9 @@ export default class UpdateRelationTargetBulkAction extends AbstractBulkAction {
static get actionIcon() {
return "bx bx-transfer bulk-action-marker-update";
}
+ static get actionDescription() {
+ return t("update_relation_target.description");
+ }
doRender() {
return <UpdateRelationTargetComponent bulkAction={this} actionDef={this.actionDef} />
diff --git a/apps/client/src/widgets/dialogs/bulk_actions.spec.tsx b/apps/client/src/widgets/dialogs/bulk_actions.spec.tsx
index ee46caf072..4e4ef4de15 100644
--- a/apps/client/src/widgets/dialogs/bulk_actions.spec.tsx
+++ b/apps/client/src/widgets/dialogs/bulk_actions.spec.tsx
@@ -81,6 +81,8 @@ describe("BulkActionsDialog", () => {
.find((el) => el.textContent?.includes("move_note.move_note"));
expect(item).toBeDefined();
expect(item?.querySelector(".bx-note.bulk-action-marker-move")).not.toBeNull();
+ expect(item?.getAttribute("title") ?? item?.getAttribute("data-bs-original-title"))
+ .toBe("move_note.description");
await act(async () => item?.click());
expect(server.post).toHaveBeenCalledWith("notes/_bulkAction/attributes", {
@@ -99,6 +101,9 @@ describe("BulkActionsDialog", () => {
expect(icon?.classList.contains("bx-note")).toBe(true);
expect(icon?.classList.contains("bulk-action-marker-delete")).toBe(true);
expect(icon?.classList.contains("destructive-action-icon")).toBe(true);
+ expect(container.querySelector(".bulk-existing-action-list .tn-chip-remove, .bulk-existing-action-list .search-option-del"))
+ .not.toBeNull();
+ expect(container.querySelector(".bulk-existing-action-list .help-dropdown")).toBeNull();
});
it("drops a removed chip from the notes the actions apply to, keeping the last one", async () => {
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Bulk Actions.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Bulk Actions.html
index 2404988d47..76cd1de9fe 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Bulk Actions.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Bulk Actions.html
@@ -32,8 +32,9 @@
The number of affected notes, shown below that option, updates to reflect
the change.</li>
<li>To add an action, click <em>Add action</em> at the bottom of the <em>Chosen actions</em> section
- and pick one from the menu. A detailed description of each is available
- in the next section.
+ and pick one from the menu. Hovering over an entry shows a short description
+ of what it does; a detailed description of each is available in the next
+ section.
<ul>
<li>Each chosen action appears as an entry in the <em>Chosen actions</em> section,
with its own configuration.</li>
@@ -50,14 +51,17 @@
<h2>Actions</h2>
<h3>Labels</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;of
- a note:</p>
+ a note. Except for <em>Add label</em>, they only affect labels set directly
+ on the note; inherited labels are left unchanged.</p>
<ul>
<li><strong>Add label</strong>
<ul>
- <li>For each note, if it doesn't already have a <a href="#root/_help_HI6GBBIduIgv">label</a> of
- the given name, it will create it. Keep the <em>New value</em> field empty
- to create a label without a value, or complete it to assign a value.</li>
- <li>If a note already has this label, its value will be updated.</li>
+ <li>For each note, it creates a <a href="#root/_help_HI6GBBIduIgv">label</a> of
+ the given name. Keep the <em>New value</em> field empty to create a label
+ without a value, or complete it to assign a value.</li>
+ <li>The label is added even if the note already has one of the same name,
+ so the note ends up with both. To change the value of an existing label
+ instead, use <em>Update label value</em>.</li>
</ul>
</li>
<li><strong>Update label value</strong>
@@ -86,12 +90,13 @@
</ul>
<h3>Relations</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;of
- a note:</p>
+ a note. Except for <em>Add relation</em>, they only affect relations set
+ directly on the note; inherited relations are left unchanged.</p>
<ul>
<li><strong>Add relation</strong>
<ul>
<li>For each note, it will create a relation pointing to the given note.</li>
- <li>Notes without this relation will not be affected.</li>
+ <li>The relation is added even if the note already has one of the same name.</li>
</ul>
</li>
<li><strong>Update relation target</strong>
@@ -134,6 +139,10 @@
<li><strong>Move note</strong>
<ul>
<li>For each note, it will be moved to the specified parent note.</li>
+ <li>A note with several parents is cloned to the new parent instead, since
+ it is not clear which of its places to remove.</li>
+ <li>A note that cannot be placed there, such as a parent of the target note,
+ stays where it is.</li>
<li>As an alternative for less complex situations, the notes can be moved
directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;via
cut → paste or via the contextual menu.</li>
@@ -166,7 +175,10 @@
</li>
<li><strong>Delete note</strong>
<ul>
- <li>For each note, it will be deleted.</li>
+ <li>For each note, it will be deleted, including all of its clones and any
+ child notes that are not cloned elsewhere.</li>
+ <li>Deleted notes can be restored from <em>Recent changes</em> until they are
+ erased.</li>
<li>As an alternative for less complex situations, the notes can be removed
directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;by
selecting them and pressing <kbd>Delete</kbd>.</li>
@@ -174,8 +186,8 @@
</li>
<li><strong>Delete note revisions</strong>
<ul>
- <li>This will delete all the&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;of
- the notes.</li>
+ <li>This will permanently erase all the&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;of
+ the notes. Unlike deleted notes, erased revisions cannot be restored.</li>
</ul>
</li>
</ul>
diff --git a/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md
index 5fb24d3452..e63280f086 100644
--- a/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md
+++ b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md
@@ -12,7 +12,7 @@ The _Bulk Actions_ dialog makes it easy to apply changes to multiple notes at on
* The _Selected notes_ section at the top of the dialog lists the notes the actions apply to. When many notes are selected, only the first few are shown; click _+N more_ to show the rest.
* To leave a note out without changing the selection in the note tree, press the X button on its entry. The last remaining note cannot be removed.
* By default, only the selected notes will be affected. To also include all the descendants of the notes, turn on _Include descendants of the selected notes_. The number of affected notes, shown below that option, updates to reflect the change.
-* To add an action, click _Add action_ at the bottom of the _Chosen actions_ section and pick one from the menu. A detailed description of each is available in the next section.
+* To add an action, click _Add action_ at the bottom of the _Chosen actions_ section and pick one from the menu. Hovering over an entry shows a short description of what it does; a detailed description of each is available in the next section.
* Each chosen action appears as an entry in the _Chosen actions_ section, with its own configuration.
* To remove an action, simply press the X button to the right of it.
* It is possible to apply multiple actions of the same type, such as adding multiple types.
@@ -23,11 +23,11 @@ The _Bulk Actions_ dialog makes it easy to apply changes to multiple notes at on
### Labels
-These actions operate the <a class="reference-link" href="Attributes/Labels.md">Labels</a> of a note:
+These actions operate the <a class="reference-link" href="Attributes/Labels.md">Labels</a> of a note. Except for _Add label_, they only affect labels set directly on the note; inherited labels are left unchanged.
* **Add label**
- * For each note, if it doesn't already have a [label](Attributes/Labels.md) of the given name, it will create it. Keep the _New value_ field empty to create a label without a value, or complete it to assign a value.
- * If a note already has this label, its value will be updated.
+ * For each note, it creates a [label](Attributes/Labels.md) of the given name. Keep the _New value_ field empty to create a label without a value, or complete it to assign a value.
+ * The label is added even if the note already has one of the same name, so the note ends up with both. To change the value of an existing label instead, use _Update label value_.
* **Update label value**
* For each note, if it has a [label](Attributes/Labels.md) of the given name, it will change its value to the specified one. Leave _New value_ field empty to create a label without a value.
* Notes without the label will not be affected.
@@ -40,11 +40,11 @@ These actions operate the <a class="reference-link" href="Attributes/Labels.md"
### Relations
-These actions operate the <a class="reference-link" href="Attributes/Relations.md">Relations</a> of a note:
+These actions operate the <a class="reference-link" href="Attributes/Relations.md">Relations</a> of a note. Except for _Add relation_, they only affect relations set directly on the note; inherited relations are left unchanged.
* **Add relation**
* For each note, it will create a relation pointing to the given note.
- * Notes without this relation will not be affected.
+ * The relation is added even if the note already has one of the same name.
* **Update relation target**
* For each note, it will modify a relation to point to the newly given note.
* Notes without this relation will not be affected.
@@ -64,6 +64,8 @@ These actions operate the <a class="reference-link" href="Attributes/Relations.
* `${note.dateCreatedObj.format('MM-DD:')}: ${note.title}` will prefix the note titles with each note's creation date (in month-day format).
* **Move note**
* For each note, it will be moved to the specified parent note.
+ * A note with several parents is cloned to the new parent instead, since it is not clear which of its places to remove.
+ * A note that cannot be placed there, such as a parent of the target note, stays where it is.
* As an alternative for less complex situations, the notes can be moved directly from within the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> via cut → paste or via the contextual menu.
* **Convert note**
* This allows a note to be converted from one type to another:
@@ -73,10 +75,11 @@ These actions operate the <a class="reference-link" href="Attributes/Relations.
* **Save revision**
* Automatically creates a revision of each note. Optionally, a name can be assigned to this revision. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a>.
* **Delete note**
- * For each note, it will be deleted.
+ * For each note, it will be deleted, including all of its clones and any child notes that are not cloned elsewhere.
+ * Deleted notes can be restored from _Recent changes_ until they are erased.
* As an alternative for less complex situations, the notes can be removed directly from within the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> by selecting them and pressing <kbd>Delete</kbd>.
* **Delete note revisions**
- * This will delete all the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a> of the notes.
+ * This will permanently erase all the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a> of the notes. Unlike deleted notes, erased revisions cannot be restored.
### Others