Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Group destructive table actions https://github.com/siyuan-note/siyuan/issues/4785

Danielcb06abd6a537
diff --git a/app/src/protyle/util/tableControl.ts b/app/src/protyle/util/tableControl.ts
index cfc084c841..11bf45c371 100644
--- a/app/src/protyle/util/tableControl.ts
+++ b/app/src/protyle/util/tableControl.ts
@@ -762,11 +762,6 @@ export class TableControl {
}).element);
menu.append(new MenuItem({type: "separator"}).element);
}
- menu.append(new MenuItem({
- icon: "iconClear",
- label: window.siyuan.languages.clear,
- click: () => this.clearCells(),
- }).element);
menu.append(new MenuItem({
icon: "iconTheme",
label: window.siyuan.languages.colorPrimary,
@@ -779,6 +774,11 @@ export class TableControl {
this.appendAlignmentMenus();
}
menu.append(new MenuItem({type: "separator"}).element);
+ menu.append(new MenuItem({
+ icon: "iconClear",
+ label: window.siyuan.languages.clear,
+ click: () => this.clearCells(),
+ }).element);
menu.append(new MenuItem({
icon: "iconTrashcan",
label: this.selection.mode === "row" ? window.siyuan.languages["delete-row"] :
@@ -976,9 +976,12 @@ export class TableControl {
}).element);
const rowSelection = getTableFullRowSelection(this.selection.table, cells);
const columnSelection = getTableFullColumnSelection(this.selection.table, cells);
- if (rowSelection.indexes.length > 0 || columnSelection.indexes.length > 0) {
- window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
- }
+ window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
+ window.siyuan.menus.menu.append(new MenuItem({
+ icon: "iconClear",
+ label: window.siyuan.languages.clear,
+ click: () => this.clearCells(),
+ }).element);
if (rowSelection.indexes.length > 0) {
window.siyuan.menus.menu.append(new MenuItem({
icon: "iconTrashcan",
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index b570dd143f..57b68ba3f7 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -2386,6 +2386,10 @@ export class WYSIWYG {
}
}
}).element);
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "deleteRowsSeparator",
+ type: "separator",
+ }).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "clear",
label: window.siyuan.languages.clear,
@@ -2411,12 +2415,6 @@ export class WYSIWYG {
});
const rowSelection = getTableFullRowSelection(tableElement, selectedCellElements);
const columnSelection = getTableFullColumnSelection(tableElement, selectedCellElements);
- if (rowSelection.indexes.length > 0 || columnSelection.indexes.length > 0) {
- window.siyuan.menus.menu.append(new MenuItem({
- id: "deleteRowsSeparator",
- type: "separator",
- }).element);
- }
if (rowSelection.indexes.length > 0) {
window.siyuan.menus.menu.append(new MenuItem({
id: "deleteRows",