Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client/text editor/tables: tweak the context menu
Adorian Doranc110099281cc
diff --git a/apps/client/src/menus/note_context_menu.spec.ts b/apps/client/src/menus/note_context_menu.spec.tsindex 245a58b634..469722d269 100644--- a/apps/client/src/menus/note_context_menu.spec.ts+++ b/apps/client/src/menus/note_context_menu.spec.ts@@ -29,14 +29,18 @@ vi.mock("../services/utils.js", () => ({}));vi.mock("./context_menu.js", () => ({ default: { show: vi.fn() } }));vi.mock("./table_context_menu.js", () => ({- buildTableContextMenuItems: vi.fn(async () => null),+ buildTableContextMenuSections: vi.fn(async () => null),hasTableCellSelection: vi.fn(async () => false)}));import { copyHtml, copyTextWithToast } from "../services/clipboard_ext.js";import server from "../services/server.js";import contextMenu, { type MenuCommandItem, type MenuItem } from "./context_menu.js";-import { buildTableContextMenuItems, hasTableCellSelection } from "./table_context_menu.js";+import {+ buildTableContextMenuSections,+ hasTableCellSelection,+ type TableMenuSections+} from "./table_context_menu.js";import {buildNoteContextMenuItems,type ContextMenuHost,@@ -214,17 +218,19 @@ describe("buildNoteContextMenuItems", () => {});});- it("puts the table section ahead of the clipboard rows and hands it the element", async () => {+ it("puts the table sections around the clipboard rows and hands them the element", async () => {const cell = document.createElement("td");- vi.mocked(buildTableContextMenuItems).mockResolvedValueOnce([- { title: "T1" },- { kind: "separator" },- { title: "T2" }- ] as MenuItem<any>[]);+ vi.mocked(buildTableContextMenuSections).mockResolvedValueOnce({+ main: [ { title: "T1" }, { kind: "separator" }, { title: "T2" } ],+ delete: [ { title: "D1" }, { title: "D2" } ]+ } as TableMenuSections);+ const host = browserLikeHost({+ paste: { enabled: true, run: vi.fn(), runAsPlainText: vi.fn() }+ });- const items = await build({ isEditable: true, element: cell });+ const items = await build({ isEditable: true, element: cell }, host);- expect(buildTableContextMenuItems).toHaveBeenCalledWith(cell);+ expect(buildTableContextMenuSections).toHaveBeenCalledWith(cell);expect(titles(items)).toEqual(["T1","---",@@ -233,6 +239,11 @@ describe("buildNoteContextMenuItems", () => {"electron_context_menu.cut","electron_context_menu.copy","electron_context_menu.copy-as-markdown",+ "electron_context_menu.paste",+ "electron_context_menu.paste-as-plain-text",+ "---",+ "D1",+ "D2","---","electron_context_menu.search_online","electron_context_menu.search_in_trilium"@@ -242,7 +253,7 @@ describe("buildNoteContextMenuItems", () => {it("skips the table section for a non-editable target", async () => {await build({ element: document.createElement("td") });- expect(buildTableContextMenuItems).not.toHaveBeenCalled();+ expect(buildTableContextMenuSections).not.toHaveBeenCalled();});it("converts the selection through the to-markdown route", async () => {@@ -261,9 +272,10 @@ describe("buildNoteContextMenuItems", () => {it("enables the clipboard rows over a cell selection with no selection text", async () => {const cell = document.createElement("td");- vi.mocked(buildTableContextMenuItems).mockResolvedValue([- { title: "T1" }- ] as MenuItem<any>[]);+ vi.mocked(buildTableContextMenuSections).mockResolvedValue({+ main: [ { title: "T1" } ],+ delete: []+ } as TableMenuSections);// No cell selection and no text: the rows show but stay disabled.const disabled = await build({ isEditable: true, element: cell, selectionText: "" });@@ -277,15 +289,16 @@ describe("buildNoteContextMenuItems", () => {expect(findItem(enabled, "electron_context_menu.copy")?.enabled).toBe(true);expect(findItem(enabled, "electron_context_menu.copy-as-markdown")?.enabled).toBe(true);- vi.mocked(buildTableContextMenuItems).mockResolvedValue(null);+ vi.mocked(buildTableContextMenuSections).mockResolvedValue(null);vi.mocked(hasTableCellSelection).mockResolvedValue(false);});it("ignores the fake-selection label Electron reports over a cell selection", async () => {const cell = document.createElement("td");- vi.mocked(buildTableContextMenuItems).mockResolvedValueOnce([- { title: "T1" }- ] as MenuItem<any>[]);+ vi.mocked(buildTableContextMenuSections).mockResolvedValueOnce({+ main: [ { title: "T1" } ],+ delete: []+ } as TableMenuSections);vi.mocked(hasTableCellSelection).mockResolvedValueOnce(true);const shown = titles(await build({@@ -372,9 +385,10 @@ describe("setupContextMenu (browser)", () => {it("claims a bare-caret right-click on an editable table cell", async () => {const cell = editableTableCell();setSelection(null, "", "");- vi.mocked(buildTableContextMenuItems).mockResolvedValueOnce([- { title: "table_context_menu.merge_cells" }- ] as MenuItem<any>[]);+ vi.mocked(buildTableContextMenuSections).mockResolvedValueOnce({+ main: [ { title: "table_context_menu.merge_cells" } ],+ delete: []+ } as TableMenuSections);const event = rightClick(cell);@@ -382,7 +396,7 @@ describe("setupContextMenu (browser)", () => {await vi.waitFor(() => expect(contextMenu.show).toHaveBeenCalled());const shown = vi.mocked(contextMenu.show).mock.calls[0][0];expect(titles(shown.items)).toContain("table_context_menu.merge_cells");- expect(buildTableContextMenuItems).toHaveBeenCalledWith(cell);+ expect(buildTableContextMenuSections).toHaveBeenCalledWith(cell);});it("leaves a table cell to the browser when read-only, non-editable, or Shift is held", async () => {diff --git a/apps/client/src/menus/note_context_menu.ts b/apps/client/src/menus/note_context_menu.tsindex e87856f42e..36b5196bfd 100644--- a/apps/client/src/menus/note_context_menu.ts+++ b/apps/client/src/menus/note_context_menu.ts@@ -7,7 +7,7 @@ import options from "../services/options.js";import server from "../services/server.js";import utils from "../services/utils.js";import contextMenu, { type MenuItem } from "./context_menu.js";-import { buildTableContextMenuItems, hasTableCellSelection } from "./table_context_menu.js";+import { buildTableContextMenuSections, hasTableCellSelection } from "./table_context_menu.js";import { buildAiActionsMenuItem, getTextEditorAtSelection } from "./text_editor_context_menu.js";/** What the pointer was over when the menu was summoned. */@@ -124,12 +124,14 @@ export async function buildNoteContextMenuItems(// depend on how the editor answers, and `isEditable` keeps the lookup off every click that// lands somewhere a completion could not be committed anyway (a read-only note, the tree).const aiActions = target.isEditable ? await buildAiActionsMenuItem() : null;- const tableItems = target.isEditable ? await buildTableContextMenuItems(target.element) : null;+ const tableSections = target.isEditable+ ? await buildTableContextMenuSections(target.element)+ : null;- // Read after the table section is built, which moves the selection into the clicked cell.+ // Read after the table sections are built, which moves the selection into the clicked cell.// A cell selection supersedes `selectionText`: over one, Electron reports the hidden// fake-selection label as the selected text, which no row should act on.- const hasCellSelection = tableItems !== null && await hasTableCellSelection(target.element);+ const hasCellSelection = tableSections !== null && await hasTableCellSelection(target.element);const hasText = !hasCellSelection && target.selectionText.trim().length > 0;const hasClipboardContent = hasText || hasCellSelection;@@ -158,8 +160,8 @@ export async function buildNoteContextMenuItems(items.push(aiActions, { kind: "separator" });}- if (tableItems) {- items.push(...tableItems, { kind: "separator" });+ if (tableSections) {+ items.push(...tableSections.main, { kind: "separator" });}if (target.isEditable) {@@ -222,6 +224,10 @@ export async function buildNoteContextMenuItems(});}+ if (tableSections) {+ items.push({ kind: "separator" }, ...tableSections.delete);+ }+if (hasText) {const { selectionText } = target;const shortenedSelection = selectionText.length > 15diff --git a/apps/client/src/menus/table_context_menu.spec.ts b/apps/client/src/menus/table_context_menu.spec.tsindex 843b52ee6b..5d4f919f9f 100644--- a/apps/client/src/menus/table_context_menu.spec.ts+++ b/apps/client/src/menus/table_context_menu.spec.ts@@ -7,50 +7,55 @@ import type { CKTextEditor } from "@triliumnext/ckeditor5";import type { MenuCommandItem, MenuItem } from "./context_menu.js";import {- buildTableContextMenuItems,- buildTableMenuItems,- hasTableCellSelection+ buildTableContextMenuSections,+ buildTableMenuSections,+ hasTableCellSelection,+ type TableMenuSections} from "./table_context_menu.js";import { getTextEditorContaining } from "./text_editor_context_menu.js";-const SECTION_TITLES = [+const MAIN_TITLES = ["table_context_menu.insert_rows_above","table_context_menu.insert_rows_below","---","table_context_menu.insert_columns_left","table_context_menu.insert_columns_right","---",+ "table_context_menu.merge_cells",+ "table_context_menu.split_cells",+ "table_context_menu.distribute_columns"+];++const DELETE_TITLES = ["table_context_menu.delete_rows","table_context_menu.delete_columns",- "table_context_menu.delete_table",- "---",- "table_context_menu.distribute_columns",- "---",- "table_context_menu.merge_cells",- "table_context_menu.split_cells"+ "table_context_menu.delete_table"];-describe("buildTableMenuItems", () => {- it("returns the section in order, with a split submenu", () => {+describe("buildTableMenuSections", () => {+ it("returns the sections in order, with a split submenu", () => {const { editor, syncSelectionToDomTarget } = stubEditor();const element = cellElement();- const items = buildTableMenuItems(editor, element) ?? [];+ const sections = buildTableMenuSections(editor, element);expect(syncSelectionToDomTarget).toHaveBeenCalledWith(element);- expect(titles(items)).toEqual(SECTION_TITLES);+ expect(titles(sections?.main ?? [])).toEqual(MAIN_TITLES);+ expect(titles(sections?.delete ?? [])).toEqual(DELETE_TITLES);- const submenu = findItem(items, "table_context_menu.split_cells")?.items ?? [];+ const splitRow = findItem(sections?.main ?? [], "table_context_menu.split_cells");+ const submenu = splitRow?.items ?? [];expect(titles(submenu)).toEqual(["table_context_menu.split_vertically","table_context_menu.split_horizontally",+ "---","table_context_menu.split_reset"]);});it("executes the mapped command and refocuses the editor", () => {const { editor, executed, focus } = stubEditor();- const items = buildTableMenuItems(editor, cellElement()) ?? [];+ const items = allItems(buildTableMenuSections(editor, cellElement()));const submenu = findItem(items, "table_context_menu.split_cells")?.items ?? [];for (const title of titles(items).filter((t) => t !== "---")) {@@ -65,11 +70,11 @@ describe("buildTableMenuItems", () => {"triliumInsertTableRowsBelow","triliumInsertTableColumnsLeft","triliumInsertTableColumnsRight",+ "mergeTableCells",+ "triliumDistributeTableColumns","removeTableRow","removeTableColumn","triliumDeleteTable",- "triliumDistributeTableColumns",- "mergeTableCells","splitTableCellVertically","splitTableCellHorizontally","triliumResetTableCellSpans"@@ -84,7 +89,7 @@ describe("buildTableMenuItems", () => {"removeTableRow","triliumDistributeTableColumns"]);- const items = buildTableMenuItems(editor, cellElement()) ?? [];+ const items = allItems(buildTableMenuSections(editor, cellElement()));expect(findItem(items, "table_context_menu.distribute_columns")?.enabled).toBe(false);expect(findItem(items, "table_context_menu.merge_cells")?.enabled).toBe(false);@@ -102,8 +107,8 @@ describe("buildTableMenuItems", () => {];const splitRow = (disabled: string[]) => {const { editor } = stubEditor(disabled);- const items = buildTableMenuItems(editor, cellElement()) ?? [];- return findItem(items, "table_context_menu.split_cells")?.enabled;+ const main = buildTableMenuSections(editor, cellElement())?.main ?? [];+ return findItem(main, "table_context_menu.split_cells")?.enabled;};for (const enabled of SPLIT_COMMANDS) {@@ -115,14 +120,14 @@ describe("buildTableMenuItems", () => {it("returns null without the plugin or a table cell at the target", () => {const { editor: withoutPlugin } = stubEditor([], { hasPlugin: false });- expect(buildTableMenuItems(withoutPlugin, cellElement())).toBeNull();+ expect(buildTableMenuSections(withoutPlugin, cellElement())).toBeNull();const { editor } = stubEditor([], { syncResult: false });- expect(buildTableMenuItems(editor, cellElement())).toBeNull();+ expect(buildTableMenuSections(editor, cellElement())).toBeNull();});});-describe("buildTableContextMenuItems", () => {+describe("buildTableContextMenuSections", () => {const resolveEditor = vi.mocked(getTextEditorContaining);beforeEach(() => {@@ -130,25 +135,26 @@ describe("buildTableContextMenuItems", () => {});it("ignores targets outside a table cell without resolving the editor", async () => {- expect(await buildTableContextMenuItems(null)).toBeNull();- expect(await buildTableContextMenuItems(document.createElement("div"))).toBeNull();+ expect(await buildTableContextMenuSections(null)).toBeNull();+ expect(await buildTableContextMenuSections(document.createElement("div"))).toBeNull();expect(resolveEditor).not.toHaveBeenCalled();});- it("builds the section for a cell target inside the active text editor", async () => {+ it("builds the sections for a cell target inside the active text editor", async () => {const { editor } = stubEditor();resolveEditor.mockResolvedValue(editor);const element = cellElement();- const items = (await buildTableContextMenuItems(element)) ?? [];+ const sections = await buildTableContextMenuSections(element);expect(resolveEditor).toHaveBeenCalledWith(element);- expect(titles(items)).toEqual(SECTION_TITLES);+ expect(titles(sections?.main ?? [])).toEqual(MAIN_TITLES);+ expect(titles(sections?.delete ?? [])).toEqual(DELETE_TITLES);});it("returns null when no text editor contains the target", async () => {resolveEditor.mockResolvedValue(null);- expect(await buildTableContextMenuItems(cellElement())).toBeNull();+ expect(await buildTableContextMenuSections(cellElement())).toBeNull();});});@@ -222,6 +228,11 @@ function cellElement(): Element {return inner;}+/** Both sections as one list, main first. */+function allItems(sections: TableMenuSections | null) {+ return [...(sections?.main ?? []), ...(sections?.delete ?? [])];+}+/** The titles of `items`, with separators rendered as "---" so ordering stays readable. */function titles(items: MenuItem<any>[]) {return items.map((item) => ("kind" in item && item.kind === "separator"diff --git a/apps/client/src/menus/table_context_menu.ts b/apps/client/src/menus/table_context_menu.tsindex 623eceb1ed..c0cd05887c 100644--- a/apps/client/src/menus/table_context_menu.ts+++ b/apps/client/src/menus/table_context_menu.ts@@ -6,32 +6,30 @@ import type { MenuItem } from "./context_menu.js";import { getTextEditorContaining } from "./text_editor_context_menu.js";/**- * The table section of the text editor's right-click menu: row and column insertion sized by the- * selection, deletion of every spanned row or column or of the whole table, equal widths for the- * spanned columns, and merging or splitting of the selected cells.+ * The table sections of the text editor's right-click menu.** Returns `null` when the click is not on a table cell of the active text editor.*/-export async function buildTableContextMenuItems(+export async function buildTableContextMenuSections(element: Element | null | undefined-): Promise<MenuItem<CommandNames>[] | null> {+): Promise<TableMenuSections | null> {if (!element?.closest("td, th")) {return null;}const editor = await getTextEditorContaining(element);- return editor && buildTableMenuItems(editor, element);+ return editor && buildTableMenuSections(editor, element);}/**- * Builds the section against a resolved editor. The selection is first moved into the clicked+ * Builds the sections against a resolved editor. The selection is first moved into the clicked* cell (and kept when the cell is already part of it), so the enablement snapshots and the* executed commands agree with the cell the menu is opened on.*/-export function buildTableMenuItems(+export function buildTableMenuSections(editor: CKTextEditor,element: Element-): MenuItem<CommandNames>[] | null {+): TableMenuSections | null {if (!editor.plugins.has("TableContextMenu")|| !editor.plugins.get("TableContextMenu").syncSelectionToDomTarget(element)) {return null;@@ -48,40 +46,55 @@ export function buildTableMenuItems(});const splitItems = [- commandItem(t("table_context_menu.split_vertically"), "bx bx-empty",+ commandItem(t("table_context_menu.split_vertically"), "bx bx-reflect-vertical","splitTableCellVertically"),- commandItem(t("table_context_menu.split_horizontally"), "bx bx-empty",- "splitTableCellHorizontally"),- commandItem(t("table_context_menu.split_reset"), "bx bx-reset",- "triliumResetTableCellSpans")+ commandItem(t("table_context_menu.split_horizontally"), "bx bx-reflect-horizontal",+ "splitTableCellHorizontally")];+ const unmergeItem = commandItem(t("table_context_menu.split_reset"), "bx bx-reset",+ "triliumResetTableCellSpans");- return [- commandItem(t("table_context_menu.insert_rows_above"),- "bx bx-horizontal-left bx-rotate-90", "triliumInsertTableRowsAbove"),- commandItem(t("table_context_menu.insert_rows_below"),- "bx bx-horizontal-left bx-rotate-270", "triliumInsertTableRowsBelow"),- { kind: "separator" },- commandItem(t("table_context_menu.insert_columns_left"),- "bx bx-horizontal-left", "triliumInsertTableColumnsLeft"),- commandItem(t("table_context_menu.insert_columns_right"),- "bx bx-horizontal-right", "triliumInsertTableColumnsRight"),- { kind: "separator" },- commandItem(t("table_context_menu.delete_rows"), "bx bx-trash", "removeTableRow"),- commandItem(t("table_context_menu.delete_columns"), "bx bx-trash", "removeTableColumn"),- commandItem(t("table_context_menu.delete_table"), "bx bx-trash", "triliumDeleteTable"),- { kind: "separator" },- commandItem(t("table_context_menu.distribute_columns"), "bx bx-move-horizontal",- "triliumDistributeTableColumns"),- { kind: "separator" },- commandItem(t("table_context_menu.merge_cells"), "bx bx-border-outer", "mergeTableCells"),- {- title: t("table_context_menu.split_cells"),- uiIcon: "bx bx-border-inner",- enabled: splitItems.some((item) => item.enabled),- items: splitItems- }- ];+ return {+ main: [+ commandItem(t("table_context_menu.insert_rows_above"),+ "bx bx-horizontal-left bx-rotate-90", "triliumInsertTableRowsAbove"),+ commandItem(t("table_context_menu.insert_rows_below"),+ "bx bx-horizontal-left bx-rotate-270", "triliumInsertTableRowsBelow"),+ { kind: "separator" },+ commandItem(t("table_context_menu.insert_columns_left"),+ "bx bx-horizontal-left", "triliumInsertTableColumnsLeft"),+ commandItem(t("table_context_menu.insert_columns_right"),+ "bx bx-horizontal-right", "triliumInsertTableColumnsRight"),+ { kind: "separator" },+ commandItem(t("table_context_menu.merge_cells"), "bx bx-border-outer",+ "mergeTableCells"),+ {+ title: t("table_context_menu.split_cells"),+ uiIcon: "bx bx-border-inner",+ enabled: [...splitItems, unmergeItem].some((item) => item.enabled),+ items: [...splitItems, { kind: "separator" }, unmergeItem]+ },+ commandItem(t("table_context_menu.distribute_columns"), "bx bx-move-horizontal",+ "triliumDistributeTableColumns")+ ],+ delete: [+ commandItem(t("table_context_menu.delete_rows"), "bx bx-trash", "removeTableRow"),+ commandItem(t("table_context_menu.delete_columns"), "bx bx-trash",+ "removeTableColumn"),+ commandItem(t("table_context_menu.delete_table"), "bx bx-trash", "triliumDeleteTable")+ ]+ };+}++/** The table rows of the text editor's right-click menu, in two sections. */+export interface TableMenuSections {+ /**+ * Row and column insertion sized by the selection, merging or splitting of the selected cells,+ * and equal widths for the spanned columns. Shown above the clipboard.+ */+ main: MenuItem<CommandNames>[];+ /** Deletion of the spanned rows or columns, or of the table. Shown below the clipboard. */+ delete: MenuItem<CommandNames>[];}/**diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex f9b38630e8..5b6576114b 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -3507,15 +3507,15 @@"insert_rows_below": "Insert row below","insert_columns_left": "Insert column to the left","insert_columns_right": "Insert column to the right",- "delete_rows": "Delete rows",- "delete_columns": "Delete columns",+ "delete_rows": "Delete row",+ "delete_columns": "Delete column","delete_table": "Delete table","distribute_columns": "Distribute columns evenly","merge_cells": "Merge cells",- "split_cells": "Split cells",+ "split_cells": "Split cell","split_vertically": "Vertically","split_horizontally": "Horizontally",- "split_reset": "Reset"+ "split_reset": "Unmerge cells"},"board_view": {"delete-note": "Delete note...",diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.htmlindex bed30ccbb4..ed8a3b398f 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html@@ -32,23 +32,18 @@ src="3_Tables_image.png" width="384" height="100">rows, the same number of rows is inserted.</li><li><em>Insert column to the left</em> and <em>Insert column to the right</em> workthe same way for columns.</li>- <li><em>Delete rows</em> and <em>Delete columns</em> remove every row or column- the selection touches, even when only some of their cells are selected.</li>- <li><em>Delete table</em> removes the whole table and leaves an empty paragraph- in its place. In a table nested inside another, only the inner table is- removed.</li>+ <li><em>Merge cells</em> merges the selected cells into one. The selected cells+ must form a rectangle.</li>+ <li><em>Split cell</em> splits each selected cell in two, either <em>Vertically</em> or <em>Horizontally</em>. <em>Unmerge cells</em>,+ in the same submenu, turns each merged cell in the selection back into+ the single cells it covers, keeping its content in the top-left one; cells+ that are not merged stay as they are.</li><li><em>Distribute columns evenly</em> splits the combined width of the columnsthe selection touches equally between them. The other columns and the widthof the table stay as they are. It needs a selection spanning at least twocolumns; a merged cell counts for every column it covers.</li>- <li><em>Merge cells</em> merges the selected cells into one. The selected cells- must form a rectangle.</li>- <li><em>Split cells</em> splits each selected cell in two, either <em>Vertically</em> or <em>Horizontally</em>. <em>Reset</em> turns- each merged cell in the selection back into the single cells it covers,- keeping its content in the top-left one; cells that are not merged stay- as they are.</li>- <li><em>Cut</em>, <em>Copy</em> and <em>Copy as Markdown</em>, below the table- section, act on the selected cells:+ <li><em>Cut</em>, <em>Copy</em> and <em>Copy as Markdown</em> act on the selected+ cells:<ul><li>Cutting or copying produces a smaller table holding just the selectedcells. Pasting it over a cell selection replaces those cells; pasting elsewhere@@ -59,6 +54,12 @@ src="3_Tables_image.png" width="384" height="100">header row is emitted, since Markdown tables require one.</li></ul></li>+ <li><em>Delete row</em> and <em>Delete column</em>, below the clipboard section,+ remove every row or column the selection touches, even when only some of+ their cells are selected.</li>+ <li><em>Delete table</em> removes the whole table and leaves an empty paragraph+ in its place. In a table nested inside another, only the inner table is+ removed.</li></ul><p>Right-clicking a cell that is not part of the current selection movesthe cursor there first, so the menu always applies to the cell under the@@ -158,7 +159,7 @@ src="3_Tables_image.png" width="384" height="100"></ul><p><em>Merge selected cells</em> and <em>Reset merged cells</em> are availablesince v0.107.0. Merging and splitting are also available by right-clicking- the selected cells, via the <a href="#context-menu">context menu</a>, where <em>Split cells</em> → <em>Reset</em> does+ the selected cells, via the <a href="#context-menu">context menu</a>, where <em>Split cell</em> → <em>Unmerge cells</em> doesthe same as <em>Reset merged cells</em>.</p><h2>Table properties</h2><figure class="image image-style-align-right">diff --git a/docs/User Guide/User Guide/Note Types/Text/Tables.md b/docs/User Guide/User Guide/Note Types/Text/Tables.mdindex b1d949bdcf..12c8df9a8e 100644--- a/docs/User Guide/User Guide/Note Types/Text/Tables.md+++ b/docs/User Guide/User Guide/Note Types/Text/Tables.md@@ -25,14 +25,14 @@ Since v0.106.0, right-clicking anywhere inside a table opens a context menu with* _Insert row above_ and _Insert row below_ insert a blank row next to the row of the current cell. When the selection spans multiple rows, the same number of rows is inserted.* _Insert column to the left_ and _Insert column to the right_ work the same way for columns.-* _Delete rows_ and _Delete columns_ remove every row or column the selection touches, even when only some of their cells are selected.-* _Delete table_ removes the whole table and leaves an empty paragraph in its place. In a table nested inside another, only the inner table is removed.-* _Distribute columns evenly_ splits the combined width of the columns the selection touches equally between them. The other columns and the width of the table stay as they are. It needs a selection spanning at least two columns; a merged cell counts for every column it covers.* _Merge cells_ merges the selected cells into one. The selected cells must form a rectangle.-* _Split cells_ splits each selected cell in two, either _Vertically_ or _Horizontally_. _Reset_ turns each merged cell in the selection back into the single cells it covers, keeping its content in the top-left one; cells that are not merged stay as they are.-* _Cut_, _Copy_ and _Copy as Markdown_, below the table section, act on the selected cells:+* _Split cell_ splits each selected cell in two, either _Vertically_ or _Horizontally_. _Unmerge cells_, in the same submenu, turns each merged cell in the selection back into the single cells it covers, keeping its content in the top-left one; cells that are not merged stay as they are.+* _Distribute columns evenly_ splits the combined width of the columns the selection touches equally between them. The other columns and the width of the table stay as they are. It needs a selection spanning at least two columns; a merged cell counts for every column it covers.+* _Cut_, _Copy_ and _Copy as Markdown_ act on the selected cells:* Cutting or copying produces a smaller table holding just the selected cells. Pasting it over a cell selection replaces those cells; pasting elsewhere inserts it as a table of its own. Cutting clears the cells without removing rows or columns.* _Copy as Markdown_ converts the selected cells to a Markdown table. A selected header row becomes the Markdown header; without one, an empty header row is emitted, since Markdown tables require one.+* _Delete row_ and _Delete column_, below the clipboard section, remove every row or column the selection touches, even when only some of their cells are selected.+* _Delete table_ removes the whole table and leaves an empty paragraph in its place. In a table nested inside another, only the inner table is removed.Right-clicking a cell that is not part of the current selection moves the cursor there first, so the menu always applies to the cell under the pointer.@@ -89,7 +89,7 @@ More options are available by pressing the arrow next to it:* Select _Split cell vertically_ or _horizontally_, to split a cell into multiple cells (can also be used to undo a merge).* Select _Reset merged cells_ to turn each merged cell in the selection back into the single cells it covers, keeping its content in the top-left one.-_Merge selected cells_ and _Reset merged cells_ are available since v0.107.0. Merging and splitting are also available by right-clicking the selected cells, via the [context menu](#context-menu), where _Split cells_ → _Reset_ does the same as _Reset merged cells_.+_Merge selected cells_ and _Reset merged cells_ are available since v0.107.0. Merging and splitting are also available by right-clicking the selected cells, via the [context menu](#context-menu), where _Split cell_ → _Unmerge cells_ does the same as _Reset merged cells_.## Table properties