Skip to content

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

:art: Improve "Use Default Column Width" (#15046)

Jeffrey Chend968055aa79f
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 003a677123..8a3aca37d6 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -2153,14 +2153,14 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
});
}
const thMatchElement = nodeElement.querySelectorAll("col")[colIndex];
- if (thMatchElement.style.width || thMatchElement.style.minWidth) {
+ if (thMatchElement.style.width || thMatchElement.style.minWidth !== "60px") {
otherMenus.push({
id: "useDefaultWidth",
label: window.siyuan.languages.useDefaultWidth,
click: () => {
const html = nodeElement.outerHTML;
thMatchElement.style.width = "";
- thMatchElement.style.minWidth = "";
+ thMatchElement.style.minWidth = "60px";
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
}
});
diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts
index f2d83af3bd..6ac3533b5e 100644
--- a/app/src/protyle/util/table.ts
+++ b/app/src/protyle/util/table.ts
@@ -188,7 +188,7 @@ export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElemen
newCellElement.textContent = " ";
}
}
- tableElement.querySelectorAll("col")[index].insertAdjacentHTML(type, "<col>");
+ tableElement.querySelectorAll("col")[index].insertAdjacentHTML(type, "<col style='min-width: 60px;'>");
focusByWbr(nodeElement, range);
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
};