Skip to content

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

:bug: Refresh database row width after editor setting changes https://github.com/siyuan-note/siyuan/issues/18321

Danielfe1b2cb3b868
diff --git a/app/src/config/tabs/editorRuntime.ts b/app/src/config/tabs/editorRuntime.ts
index 640ad86b6b..e6f4cd1a6e 100644
--- a/app/src/config/tabs/editorRuntime.ts
+++ b/app/src/config/tabs/editorRuntime.ts
@@ -6,6 +6,7 @@ import {resize} from "../../protyle/util/resize";
import {createConfigNamespaceApi} from "../util/namespaceApi";
const applyEditorConfig = (data: Config.IEditor) => {
+ const refreshDatabaseRowLayout = window.siyuan.config.editor.fullWidth !== data.fullWidth;
const refreshHeadingNumbers = window.siyuan.config.editor.headingNumber !== data.headingNumber ||
window.siyuan.config.editor.headingNumberFormat !== data.headingNumberFormat;
const remeasureHeadingNumbers = window.siyuan.config.editor.fontSize !== data.fontSize ||
@@ -14,6 +15,13 @@ const applyEditorConfig = (data: Config.IEditor) => {
window.siyuan.config.editor = data;
const models = getAllModels();
models.editor.forEach(item => item.updateBacklinkPanel());
+ if (refreshDatabaseRowLayout) {
+ models.custom.forEach(item => {
+ if (item.type === "siyuan-database-row") {
+ item.resize?.();
+ }
+ });
+ }
getAllEditor().forEach((editorItem) => {
const protyle = editorItem.protyle;
protyle.databaseAttributePanel?.updateDisplayConfig();
diff --git a/app/src/editor/databaseRow.ts b/app/src/editor/databaseRow.ts
index ab3523bfcb..61a46194dc 100644
--- a/app/src/editor/databaseRow.ts
+++ b/app/src/editor/databaseRow.ts
@@ -86,6 +86,9 @@ export const newDatabaseRowModel = (options: {
update() {
render(customModel);
},
+ resize() {
+ updateLayout(customModel);
+ },
});
return model;
};